remapping actionlib topics

asked 2018-04-05 08:56:36 -0500

BrettHemes gravatar image

I have a node that contains a SimpleActionClient that subscribes to a hard-coded action name. In my network I have an action server that provides an action of the same type but under a different name. I was trying to remap the node's (client) action name to match the servers name but couldn't get it to work. In general, how do you remap actions via launch files? (e.g., can the client use remapping, do I need to remap all of the individual topics or is the high-level action topic sufficient, etc.)

To be a bit more specific I have the following:

actionlib::SimpleActionClient<control_msgs::FollowJointTrajectoryAction> ac("joint_trajectory_action", true)

and was trying to remap in the launch file node with the following:

<remap to="follow_joint_trajectory" from="joint_trajectory_action"/>

As above, the action client was failing to connect. If I hard-coded the correct name it connects.. Should this remapping work in theory or am I doing something else wrong.

edit retag flag offensive close merge delete


that subscribes to a hard-coded action name

just an observation: this is actually accepted practice. Your phrasing made it sound (to me) like this is a bad thing, but imo, making topic/service/action names a parameter is worse. Remapping should always be used for these things.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-05 09:00:50 -0500 )edit

Sure. I've never done it any other way. Just typing and trying to be specific...

BrettHemes gravatar image BrettHemes  ( 2018-04-05 19:35:45 -0500 )edit

It's not the best example, but remapping individual topics will work: abb_irb120_gazebo/launch/irb120_3_58_gazebo.launch.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-06 02:25:16 -0500 )edit

Thanks, this works now for me remapping the server's (driver) topics. I was changing a bunch of stuff simultaneously the other day (shame on me) and had trouble getting a client to work with the renaming pushed down into a different namespace.

BrettHemes gravatar image BrettHemes  ( 2018-04-10 07:58:45 -0500 )edit