Skip to content

Commit

Permalink
Avoid redundancy in node naming
Browse files Browse the repository at this point in the history
Instead of arm_id/arm_id_xxx use arm_id/xxx
  • Loading branch information
rhaschke committed Oct 28, 2021
1 parent 3dde644 commit 39dfdd1
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions franka_gazebo/launch/panda_ns.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
<rosparam file="$(find franka_gazebo)/config/franka_hw_sim.yaml" subst_value="true" />
<rosparam file="$(find franka_gazebo)/config/sim_controllers.yaml" subst_value="true" />

<!-- Avoid node names of the form arm_id/arm_id_xxx. Use arm_id/xxx instead. -->
<arg name="node_prefix" value="$(eval '' if arg('ns') == arg('arm_id') else arg('arm_id') + '_')" />

<arg name="unpause" value="$(eval '' if arg('paused') else '-unpause')" />
<node name="$(arg arm_id)_model_spawner"
<node name="$(arg node_prefix)model_spawner"
pkg="gazebo_ros"
type="spawn_model"
args="-param robot_description -urdf -model $(arg arm_id) $(arg unpause)
Expand All @@ -30,32 +33,32 @@
<!-- Spawn required ROS controllers -->
<node pkg="controller_manager"
type="spawner"
name="$(arg arm_id)_gripper_spawner"
name="$(arg node_prefix)gripper_spawner"
if="$(arg use_gripper)"
args="franka_gripper"
respawn="false"
/>

<node pkg="controller_manager"
type="spawner"
name="$(arg arm_id)_controller_spawner"
name="$(arg node_prefix)controller_spawner"
respawn="false" output="screen"
args="franka_state_controller $(arg controller)"
/>

<node name="$(arg arm_id)_robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<node name="$(arg arm_id)_joint_state_publisher" type="joint_state_publisher" pkg="joint_state_publisher">
<node name="$(arg node_prefix)robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<node name="$(arg node_prefix)joint_state_publisher" type="joint_state_publisher" pkg="joint_state_publisher">
<rosparam param="source_list">[franka_state_controller/joint_states, franka_gripper/joint_states] </rosparam>
<param name="rate" value="30"/>
</node>
<node name="$(arg arm_id)_joint_state_desired_publisher" type="joint_state_publisher" pkg="joint_state_publisher">
<node name="$(arg node_prefix)joint_state_desired_publisher" type="joint_state_publisher" pkg="joint_state_publisher">
<rosparam param="source_list">[franka_state_controller/joint_states_desired, franka_gripper/joint_states] </rosparam>
<param name="rate" value="30"/>
<remap from="joint_states" to="joint_states_desired" />
</node>

<!-- Start only if cartesian_impedance_example_controller -->
<node name="$(arg arm_id)_cartesian_goal_marker"
<node name="$(arg node_prefix)cartesian_goal_marker"
pkg="franka_example_controllers"
type="interactive_marker.py"
if="$(eval arg('controller') == 'cartesian_impedance_example_controller')">
Expand Down

0 comments on commit 39dfdd1

Please sign in to comment.