how to load a joint trajectory (moveit)?
Hi! I'm losing my mind trying to understand it! I work with ubuntu 20.04 and ros noetic. I did my simulation using moveit and interfacing it with gazebo. I've obtained a trajectory though different joints goal, so using the movegroup commander i plan different trajectories. But i need one single trajectory so my aim is to save all the joints of the previous trajectories and load them all together. I thought to save all the joint waypoints from the topic (i'm not sure on how do that) but i can't understand then how to load it. Please help me! thanks
Asked by mancio on 2022-12-15 19:11:55 UTC
Answers
To make the arm follow a pre-determined path, you can dynamically create a JointTrajectory
object, then send it to the follow_joint_trajectory
action server using a SimpleActionClient
object.
A JointTrajectory object contains a list of waypoints (JointTrajectoryPoint objects.) For best results you need to specify the position, velocity and timestamp of each JointTrajectoryPoint, so you must store appropriate data in your file. Also be aware that the first Point has to be close to the arm's starting joint state, or you'll trigger an error condition.
You can do this in either c++ or python. Also, keep in mind that a follow_joint_trajectory action server does not perform collision detection.
Asked by Mike Scheutzow on 2022-12-16 15:56:19 UTC
Comments
I think this answer would benefit from code examples for loading and writing a message. I remember wanting to do something similar when I started, never got around to it, and by the time I could have found my way around serialization/deserialization, I didn't need to anymore.
"save load message ros" does not give any useful results for this either.
Asked by fvd on 2022-12-17 03:35:41 UTC
Comments
save all the joint waypoints from the topic
From which topic?
Does your ros setup have a
follow_joint_trajectory
action server?Asked by Mike Scheutzow on 2022-12-16 09:01:49 UTC
I have /joint_states topic, that i already use to check two values for another work. So the idea is to save all the joints from that topic in a file and then use it. I have a follow_joint_trajectory action server (/effort_joint_trajectory_controller/command /effort_joint_trajectory_controller/follow_joint_trajectory/cancel /effort_joint_trajectory_controller/follow_joint_trajectory/feedback /effort_joint_trajectory_controller/follow_joint_trajectory/goal /effort_joint_trajectory_controller/follow_joint_trajectory/result /effort_joint_trajectory_controller/follow_joint_trajectory/status) but i don't know how to use it. Thank you for your help!!
Asked by mancio on 2022-12-16 09:11:47 UTC