Ramapping ros-control controller topic
I am using a force controller integrated with ros-control to control a simulated robot arm. The controller relies on data from an ft sensor publishing to /robot_controller/ft_sensor_wrench
. I am using the gazebo ft sensor plugin described here to get ft data. The plugin publishes to a topic called /gazebo_ft_wrench
.
How do I make the force controller subscribe to /gazebo_ft_wrench
rather than /robot_controller/ft_sensor_topic
? I have tried to remap using:
<remap from="/robot_controller/ft_sensor_wrench" to="gazebo_ft_wrench" />
in the launch file, before loading the controller using controller_manager, but this does not work.
Edit: Adding the code from my launch file.
1) Adding the remap tag before loading the controller:
<remap from="/robot_controller/ft_sensor_wrench" to="gazebo_ft_wrench" /><node name="robot_controller_spawner" pkg="controller_manager" type="controller_manager" args="load robot_controller" respawn="false" output="screen"/>
2) Adding the remap tag inside the node block (as suggested in the comments):
<node name="robot_controller_spawner" pkg="controller_manager" type="controller_manager" args="load robot_controller" respawn="false" output="screen"><remap from="/robot_controller/ft_sensor_wrench" to="/gazebo_ft_wrench"/></node>