Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Even if you want to create trajectories for single joints, both points and joint_names must still be lists - they'll just contain only a single element.

So something like the following should work:

vel_cmd.joint_names = [ "gripper_dummy_prismatic_joint" ]
vel_cmd.points.append(JointTrajectoryPoint())
vel_cmd.points[0].velocities = 0.1

etc.

rospy.exceptions.ROSSerializationException: field joint_names must be a list or tuple type.

Even if you want to create trajectories for single joints, both points and joint_names must still be lists - they'll just contain only a single element.

So something like the following should work:

vel_cmd.joint_names = [ "gripper_dummy_prismatic_joint" ]
vel_cmd.points.append(JointTrajectoryPoint())
vel_cmd.points[0].velocities = 0.1

etc.

rospy.exceptions.ROSSerializationException: field joint_names must be a list or tuple type.

Even if you want to create trajectories for single joints, both points and joint_names must still be lists a list - they'll it'll just contain only a single element.element. Same goes for all the fields in JointTrajectoryPoint: they are always lists (except time_from_start of course).

So something like the following should work:

vel_cmd.joint_names = [ "gripper_dummy_prismatic_joint" ]
vel_cmd.points.append(JointTrajectoryPoint())
vel_cmd.points[0].velocities 
# create a JTP instance and configure it
jtp = 0.1
JointTrajectoryPoint()
jtp.velocities = [0.1]
# setup the rest of the pt

vel_cmd.points.append(jtp)

etc.