Publishing JointTrajectory from terminal

asked 2020-10-08 06:07:49 -0500

fenixkz gravatar image

updated 2020-10-20 03:39:47 -0500

Hello, I have a Franka robot in Gazebo with JointTrajectory controller. Here is my .yaml file:

panda_arm_controller:

  type: position_controllers/JointTrajectoryController
  joints:
    - panda_joint1
    - panda_joint2
    - panda_joint3
    - panda_joint4
    - panda_joint5
    - panda_joint6
    - panda_joint7
  constraints:
      goal_time: 2.0
  state_publish_rate: 100

I am trying to publish something to this controller from the terminal, but getting several errors, first after searching in the internet how to do this I published:

rostopic pub /panda_arm_controller/command trajectory_msgs/JointTrajectory "header:
seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
joint_names:
- ['panda_joint1','panda_joint2','panda_joint3','panda_joint4','panda_joint5','panda_joint6','panda_joint7'] 
points:
- positions: [0,-0.785,0,-2.356,0,1.571, 0.785]
  velocities: [0]
  accelerations: [0]
  effort: [0]
  time_from_start: {secs: 2, nsecs: 0}"

But the error is shown: [WARN] [1602152989.786602]: Inbound TCP/IP connection failed: field joint_names[] must be of type str

Then, the same output when trying:

rostopic pub /panda_arm_controller/command trajectory_msgs/JointTrajectory "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
joint_names:
- [panda_joint1, panda_joint2, panda_joint3, panda_joint4, panda_joint5, panda_joint6, panda_joint7] 
points:
- positions: [0,-0.785,0,-2.356,0,1.571, 0.785]
  velocities: [0]
  accelerations: [0]
  effort: [0]
  time_from_start: {secs: 2, nsecs: 0}"

Also, tried to put joint_names list in quotes '', but

[ERROR] [1602155010.768816976, 752.644000000]: Could not stop controller 'panda_arm_controller' since it is not running

output is shown.

What is wrong? Results from rosparam get /panda_arm_controller/joints

[panda_joint1, panda_joint2, panda_joint3, panda_joint4, panda_joint5, panda_joint6,
  panda_joint7]

I noticed that there is an empty line between panda_joint6 and panda_joint7, can this be a issue? Also, the same output from rostopic echo /panda_arm_controller/state

joint_names: [panda_joint1, panda_joint2, panda_joint3, panda_joint4, panda_joint5, panda_joint6,
  panda_joint7]

Appreciate any help.

edit retag flag offensive close merge delete