ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Make sure that the action name you use when you create the client matches the name of the action provided by the server. Since the action topics that were listed when you used rostopic list are all under /arm_controller/follow_joint_trajectory, there are two things wrong with this line:

traj_client_ = new TrajClient("arm_controller/follow_joint_trajectory_action", true);
  1. Instead of follow_joint_trajectory_action, you should use follow_joint_trajectory to match the name advertised by the server.
  2. If you begin a ROS topic name without a slash (/) then the name will be evaluated as a relative name under the node's namespace. Because the node with the client is named robot_driver, as currently written the action client is looking for an action named /robot_driver/arm_controller/follow_joint_trajectory_action, which doesn't exist. There's a wiki page with an overview of ROS naming rules here.

After fixing these issues the line where you create the action client should look like this:

    traj_client_ = new TrajClient("/arm_controller/follow_joint_trajectory", true);