behrooz-tahanzadeh/ROS.GH

How do I publish correctly to the trajectory_msgs/JointTrajectoryPoint through rosbridge

bastiannn opened this issue · 0 comments

Hi,
I am using your GH-plugin to publish to our robot via the websocket.

How do I publish correctly to the trajectory_msgs/JointTrajectoryPoint through rosbridge?

I guess I am doing something wrong in creating the trajectory_msgs/JointTrajectoryPoint Message. Here the python code for creating the message:

import json

topic = "goal"

data = {
"op":"publish",
"topic":topic,
"goal":{
"trajectory":{
"header":{
"seq":(0),
"stamp":(),
"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"
],
"points":{
"positions:":[0.293,-0.514,0.125,0.2647,1.8632,-1.5809],
"velocities":[0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
#"positions:":[0.2,-0.5,0.0,0.1,1.9,-1.7],
#"velocities":[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
}
}
}
}
print(data)

R = json.dumps(data)

The message should look like this:

header: seq: 0 stamp: secs: 1355824277 nsecs: 243513013 frame_id: '' goal_id: stamp: secs: 1355824277 nsecs: 243517830 id: /kurtana_move_arm-1-1355824277.243517830 goal: trajectory: header: seq: 0 stamp: secs: 1355824277 nsecs: 443477691 frame_id: '' joint_names: ['katana_motor1_pan_joint', 'katana_motor2_lift_joint', 'katana_motor3_lift_joint', 'katana_motor4_lift_joint', 'katana_motor5_wrist_roll_joint'] points: - positions: [-2.9641690268167444, 2.13549384276445, -2.1556486321117725, -1.9719493470579683, -2.9318804356548496] velocities: [0.0, 0.0, 0.0, 0.0, 0.0] accelerations: [0.0, 0.0, 0.0, 0.0, 0.0] time_from_start: secs: 0 nsecs: 0 -

It arrives in the topic though the fields joint_names and points stay empty. I get the error:

Received a goal with incorrect joint names.