Skip to content

Commit

Permalink
Replace re-publishing joint_states with remapping
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Nov 7, 2021
1 parent f376283 commit c0463f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions franka_control/launch/franka_control.launch
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

<param name="robot_description" command="$(find xacro)/xacro $(find franka_description)/robots/panda_arm.urdf.xacro hand:=$(arg load_gripper)" />

<!-- Remap both, arm and gripper joint states to default ROS topic joint_states -->
<remap from="franka_state_controller/joint_states" to="joint_states" />
<remap from="franka_gripper/joint_states" to="joint_states" />

<include file="$(find franka_gripper)/launch/franka_gripper.launch" if="$(arg load_gripper)">
<arg name="robot_ip" value="$(arg robot_ip)" />
</include>
Expand All @@ -17,9 +21,4 @@
<rosparam command="load" file="$(find franka_control)/config/default_controllers.yaml" />
<node name="state_controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="franka_state_controller"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" output="screen"/>
<node name="joint_state_publisher" type="joint_state_publisher" pkg="joint_state_publisher" output="screen">
<rosparam if="$(arg load_gripper)" param="source_list">[franka_state_controller/joint_states, franka_gripper/joint_states] </rosparam>
<rosparam unless="$(arg load_gripper)" param="source_list">[franka_state_controller/joint_states] </rosparam>
<param name="rate" value="30"/>
</node>
</launch>
7 changes: 3 additions & 4 deletions franka_gazebo/launch/panda.launch
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<arg name="paused" value="true"/>
<arg name="gui" value="$(eval not arg('headless'))"/>
<arg name="use_sim_time" value="true"/>
<!-- Remap both, arm and gripper joint states to default ROS topic joint_states -->
<remap from="franka_state_controller/joint_states" to="joint_states" />
<remap from="franka_gripper/joint_states" to="joint_states" />
</include>

<group ns="$(arg arm_id)">
Expand Down Expand Up @@ -88,10 +91,6 @@
<remap to="cartesian_impedance_example_controller/equilibrium_pose" from="equilibrium_pose" />

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<node name="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>

<!-- Start only if cartesian_impedance_example_controller -->
<node name="interactive_marker"
Expand Down

0 comments on commit c0463f6

Please sign in to comment.