JointTrajectory time_from_start resets to all zeros after publish()
Ubuntu 12.04 ROS Hydro
I am publishing a JointTrajectory to Gazebo and monitoring the topic using rostopic echo. The data that I publish is different from what gets captured by rostopic echo. Somehow the "time_from_start" portion of the data gets zeroed out.
A snippet of my code is as follows
# this is where I create and populate the JointTrajectory
jt = make_trajectory_msg(plan=plan, secs=0.5, dt=0.2, frame_id='base_link' )
rospy.loginfo("Publishing joint trajectory")
while not rospy.is_shutdown():
print jt
gazebo_command_publisher.publish(jt)
r.sleep()
As you can see, right before I call publish() I print the trajectory. Here is what the trajectory looks like before the publish()
header:
seq: 5
stamp:
secs: 0
nsecs: 0
frame_id: base_link
joint_names: ['arm_joint_1', 'arm_joint_2', 'arm_joint_3', 'arm_joint_4', 'arm_joint_5']
points:
-
positions: [0.2792831707677692, 0.4627657000396006, -0.8622084888670658, 0.8533643604717218, 0.1568816032950613]
velocities: [0.0, 0.0, 0.0, 0.0, 0.0]
accelerations: [0.0, 0.0, 0.0, 0.0, 0.0]
effort: []
time_from_start:
secs: 0.7
nsecs: 0
And here is the trajectory after it is captured by rostopic echo:
header:
seq: 5
stamp:
secs: 0
nsecs: 0
frame_id: base_link
joint_names: ['arm_joint_1', 'arm_joint_2', 'arm_joint_3', 'arm_joint_4', 'arm_joint_5']
points:
-
positions: [0.2792831707677692, 0.4627657000396006, -0.8622084888670658, 0.8533643604717218, 0.1568816032950613]
velocities: [0.0, 0.0, 0.0, 0.0, 0.0]
accelerations: [0.0, 0.0, 0.0, 0.0, 0.0]
effort: []
time_from_start:
secs: 0
nsecs: 0