Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F dont load description at lower level #660

Open
wants to merge 3 commits into
base: noetic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<!-- Specify if the system has "both" hands, only "right", only "left", or "none"-->
<arg name="hands" default="both"/>
<arg name="arm_ctrl" default="true"/>

<!-- ROBOT CONFIG-->
<arg name="robot_model" default="ur10e"/>
<!-- HANDS AND ARMS -->
Expand All @@ -17,9 +18,7 @@
<arg name="robot_description" if="$(eval not arg('hands') == 'none' and not arg('arm_ctrl'))" default="'$(find sr_description)/robots/bimanual_shadowhand_motor_plus.urdf.xacro'"/>
<arg name="robot_config_file" if="$(eval not arg('hands') == 'none' and not arg('arm_ctrl'))" default="$(find sr_multi_moveit_config)/config/robot_configs/bimanual_sh.yaml"/>

<!-- If the arm is available the automatic calibration script will load the robot_description,
otherwise the robot description is loaded at lower level -->
<arg name="load_robot_description_at_lower_level" default="$(eval not arm_ctrl)"/>
<arg name="load_robot_description_command" default="xacro $(arg robot_description) arm_1_z:=$(arg arm_1_z) arm_2_z:=$(arg arm_2_z) arm_x_separation:=$(arg arm_x_separation) arm_y_separation:=$(arg arm_y_separation)"/>

<!-- HANDS CONFIG-->
<arg name="rh_serial" default="1370"/>
Expand Down Expand Up @@ -59,8 +58,6 @@
<arg if="$(eval hands == 'none')" name="arm_payload_mass" default="0.0"/>
<arg if="$(eval hands == 'none')" name="arm_payload_cog" default="[0.0, 0.0, 0.0]"/>

<arg name="load_robot_description_command" default="xacro $(arg robot_description) arm_1_z:=$(arg arm_1_z) arm_2_z:=$(arg arm_2_z) arm_x_separation:=$(arg arm_x_separation) arm_y_separation:=$(arg arm_y_separation)"/>

<node pkg="rosservice" type="rosservice" name="set_right_speed_scale" args="call --wait /ra_sr_ur_robot_hw/set_speed_slider 'speed_slider_fraction: $(arg right_arm_speed_scale)'"/>
<node pkg="rosservice" type="rosservice" name="set_left_speed_scale" args="call --wait /la_sr_ur_robot_hw/set_speed_slider 'speed_slider_fraction: $(arg left_arm_speed_scale)'"/>

Expand All @@ -79,7 +76,7 @@
<include file="$(find sr_robot_launch)/launch/bimanual_controller_stopper.launch"/>

<!-- Constructs robot description string and loads it -->
<node unless="$(arg load_robot_description_at_lower_level)" name="construct_robot_description" pkg="sr_robot_launch" type="construct_robot_description" output="screen">
<node if="$(arg arm_ctrl)" name="construct_robot_description" pkg="sr_robot_launch" type="construct_robot_description" output="screen">
<param name="arm_type" value="$(arg robot_model)"/>
<param name="robot_description_file" value="$(arg robot_description)"/>
<param name="arm_1_z" value="$(arg arm_1_z)"/>
Expand All @@ -88,6 +85,9 @@
<param name="arm_y_separation" value="$(arg arm_y_separation)"/>
</node>

<!-- Loads the robot description unless requested to be done at lower lever -->
<param unless="$(arg arm_ctrl)" name="robot_description" command="$(arg load_robot_description_command)"/>

<!-- Default hand controller groups -->
<arg if="$(arg hybrid_controller)" name="hand_controller_group" default="hybrid"/>
<arg if="$(eval hand_trajectory and not hybrid_controller)" name="hand_controller_group" default="trajectory"/>
Expand All @@ -100,9 +100,8 @@
<!-- HAND (N.B. Arm robot harware is implicitly started here if ra_sr_ur_robot_hw is present in param /robot_hardware-->
<include file="$(find sr_edc_launch)/sr_edc_bimanual_ros_control.launch">
<arg name="define_robot_hardware" value="false"/>
<arg name="load_robot_description" value="false"/>
<arg name="debug" value="$(arg debug)"/>
<arg name="load_robot_description" value="$(arg load_robot_description_at_lower_level)"/>
<arg name="load_robot_description_command" value="$(arg load_robot_description_command)"/>
<arg name="rh_serial" value="$(arg rh_serial)"/>
<arg name="lh_serial" value="$(arg lh_serial)"/>
<arg name="rh_mapping_path" value="$(arg rh_mapping_path)"/>
Expand Down
19 changes: 8 additions & 11 deletions sr_robot_launch/launch/sr_hardware_control_loop.launch
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@

<!-- Whether there is an arm. -->
<arg name="arm" default="true"/>

<!-- If the arm is available the automatic calibration script will load the robot_description,
otherwise the robot description is loaded at lower level -->
<arg name="load_robot_description_at_lower_level" value="$(eval not arm)"/>

<!-- Whether there is a hand. -->
<arg name="hand" default="true"/>
<!-- Whether to run arm controllers. -->
Expand All @@ -33,17 +28,18 @@
<arg if="$(eval arg('hand') and arg('hand_id')=='lh' and not arg('arm'))" name="robot_description" default="$(find sr_description)/robots/shadowhand_left_motor_plus.urdf.xacro"/>
<arg if="$(eval arg('hand') and not arg('arm'))" name="robot_config_file" default="$(find sr_multi_moveit_config)/config/robot_configs/$(arg side)_sh.yaml"/>

<!-- Robot config -->
<arg name="load_robot_description_command" default="xacro $(arg robot_description) prefix:=$(arg hand_id)_ initial_z:=$(arg initial_z) arm_x_separation:=$(arg arm_x_separation) arm_y_separation:=$(arg arm_y_separation) kinematics_config:=$(arg kinematics_config)"/>

<!-- HANDS CONFIG-->
<arg name="hand_serial" default="1082"/>
<arg name="mapping_path" default="$(find sr_edc_launch)/mappings/default_mappings/$(arg hand_id)_E_v4.yaml"/>
<arg name="eth_port" default="$(optenv ETHERCAT_PORT enp2s0)"/>
<arg name="pwm_control" default="true"/>
<arg name="hand_trajectory" default="true"/>
<!-- Set to true if you want to use grasp controller -->
<arg name="grasp_controller" default="false"/>
<!-- Set to true if you want to use hybrid controller -->
<arg name="hybrid_controller" default="false"/>
<arg name="hand_trajectory" default="true"/>

<!-- ARMS CONFIG-->
<arg name="initial_z" if="$(arg arm)" default="0.7551"/>
Expand All @@ -64,7 +60,6 @@
<arg name="kinematics_config" if="$(eval robot_model[-1] == 'e')" default="$(find ur_e_description)/config/$(arg robot_model)_default.yaml"/>
<arg name="kinematics_config" if="$(eval not robot_model[-1] == 'e')" default="$(find ur_description)/config/$(arg robot_model)_default.yaml"/>
<arg name="urcap_program_name" default="external_ctrl.urp"/>
<arg name="load_robot_description_command" default="xacro $(arg robot_description) prefix:=$(arg hand_id)_ initial_z:=$(arg initial_z) arm_x_separation:=$(arg arm_x_separation) arm_y_separation:=$(arg arm_y_separation) kinematics_config:=$(arg kinematics_config)"/>

<node pkg="rosservice" type="rosservice" name="set_speed_scale" args="call --wait /$(arg arm_prefix)_sr_ur_robot_hw/set_speed_slider 'speed_slider_fraction: $(arg arm_speed_scale)'"/>
<node pkg="rosservice" type="rosservice" name="set_payload" args="call --wait /$(arg arm_prefix)_sr_ur_robot_hw/set_payload '{payload: $(arg arm_payload_mass), center_of_gravity: $(arg arm_payload_cog)}'"/>
Expand All @@ -83,14 +78,17 @@
</include>

<!-- Constructs robot description string and loads it -->
<node unless="$(arg load_robot_description_at_lower_level)" name="construct_robot_description" pkg="sr_robot_launch" type="construct_robot_description" output="screen">
<node if="$(arg arm)" name="construct_robot_description" pkg="sr_robot_launch" type="construct_robot_description" output="screen">
<param name="arm_type" value="$(arg robot_model)"/>
<param name="robot_description_file" value="$(arg robot_description)"/>
<param name="arm_x_separation" value="$(arg arm_x_separation)"/>
<param name="arm_y_separation" value="$(arg arm_y_separation)"/>
<param name="initial_z" value="$(arg initial_z)"/>
<param name="prefix" value="$(arg hand_id)_"/>
</node>

<!-- Loads the robot description unless requested to be done at lower lever -->
<param unless="$(arg arm)" name="robot_description" command="$(arg load_robot_description_command)"/>

<!-- Default hand controller groups -->
<arg if="$(arg grasp_controller)" name="hand_controller_group" default="grasp"/>
Expand All @@ -105,11 +103,10 @@
<!-- HAND (N.B. Arm robot harware is implicitly started here if ra_sr_ur_robot_hw is present in param /robot_hardware-->
<include file="$(find sr_edc_launch)/sr_edc_ros_control.launch">
<arg name="define_robot_hardware" value="false"/>
<arg name="load_robot_description" value="false"/>
<arg name="hand_robot_hardware_name" value="unique_robot_hw"/>
<arg name="debug" value="$(arg debug)"/>
<arg name="eth_port" value="$(arg eth_port)"/>
<arg name="load_robot_description" value="$(arg load_robot_description_at_lower_level)"/>
<arg name="load_robot_description_command" value="$(arg load_robot_description_command)"/>
<arg name="pwm_control" value="$(arg pwm_control)"/>
<arg name="hand_serial" value="$(arg hand_serial)"/>
<arg name="hand_id" value="$(arg hand_id)"/>
Expand Down