Can you provide an example of publishing commands using the /arm_controller/command topic in the terminal?

asked 2020-09-01 08:17:39 -0500

StewartHemm74 gravatar image

updated 2020-09-01 08:44:26 -0500

Here's an example of me trying to publish trajectory_msgs/JointTrajectory to the gazebo UR10 robot.

rostopic pub -r 1 /arm_controller/command trajectory_msgs/JointTrajectory "header:
  secs: 0
  nsecs: 0
  frame_id: ''
joint_names: - 'shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint'
  - positions: [1]
    velocities: [1]
    accelerations: [0]
    effort: [0]
    time_from_start: {secs: 1, nsecs: 0}"

The error that I receive is: Cannot create trajectory from message. It does not contain the expected joints.

Could you please provide an example of publishing valid commands to the robot in gazebo?

Update: Posting my yamal file (This is arm_controller_ur10.yamal file found in ur_gazebo)

  type: position_controllers/JointTrajectoryController
     - shoulder_pan_joint
     - shoulder_lift_joint
     - elbow_joint
     - wrist_1_joint
     - wrist_2_joint
     - wrist_3_joint
      goal_time: 0.6
      stopped_velocity_tolerance: 0.05
      shoulder_pan_joint: {trajectory: 0.1, goal: 0.1}
      shoulder_lift_joint: {trajectory: 0.1, goal: 0.1}
      elbow_joint: {trajectory: 0.1, goal: 0.1}
      wrist_1_joint: {trajectory: 0.1, goal: 0.1}
      wrist_2_joint: {trajectory: 0.1, goal: 0.1}
      wrist_3_joint: {trajectory: 0.1, goal: 0.1}
  stop_trajectory_duration: 0.5
  state_publish_rate:  25
  action_monitor_rate: 10
  type: position_controllers/JointGroupPositionController
     - shoulder_pan_joint
     - shoulder_lift_joint
     - elbow_joint
     - wrist_1_joint
     - wrist_2_joint
     - wrist_3_joint
edit retag flag offensive close merge delete



This seems to be more a problem with yaml right now than with anything else.

Several things are not as they should be:

  • joint_names should be a list with each joint name as a separate element. You have everything in a single string (which is also missing the end quote btw). That won't work.
  • each point in the trajectory must specify values for each joint (or be completely empty, if you don't want to specify a setpoint, such as for effort). So a list with just a 1 in it can't work.
gvdhoorn gravatar image gvdhoorn  ( 2020-09-01 08:30:11 -0500 )edit

I'll add my yamal file and sorry some things didn't paste correctly regarding formatting (i.e. missing quotes). Could you show an example of the message regarding listing the joint name and what the vector should look like?

StewartHemm74 gravatar image StewartHemm74  ( 2020-09-01 08:35:14 -0500 )edit