How to set velocity : MoveGroupInterface or Planning Pipeline ?

asked 2020-05-22 10:44:33 -0600

edote gravatar image

updated 2020-05-22 10:45:01 -0600


I needed to generate simulated velocity curves for my custom robot. I followed the Moveit tutorials about time parameterization to generate timestamps, velocites and accelerations.

I used a MotionPlanRequest to set the max velocity, called the planning pipeline to generate a plan, called the iterative parabolic time parameterization algorythm to compute the timestamps, then I copied the result in a MoveGroupInterface::Plan object and I called execute(plan). The results I got seem consistent.

I realized recently that the MoveGroupInterface provided the same function with plan(), setMaxVelocityFactor(), setMaxAccelerationFactor() and move(). When I read the plan computed by MGI, I alsoget timestamps and velocities, but when I change the velocity factor from 1 to 0.5 the durations printed are always the same, so i guess this function doesn't work, or there is something that I did wrong.

moveit::planning_interface::MoveGroupInterface::Plan plan;

for(int n = 0; n<=plan.trajectory_.joint_trajectory.points.size(); ++n){
    cout<<n<<"  duree : "<<plan.trajectory_.joint_trajectory.points[n].time_from_start<<endl;

My questions are about the usage of MGI and planning pipeline for time computation :

Why is there a specific algorythm for that (IPTP) when there is a simple way to do it with MoveGroupInterface ? What are the advantages of the planning pipeline for simulation ? What am I doing wrong with MGI so that I always get the same duration, even when I set the velocity to 10, 20 or 30 °/s ?

And finally, When I use IPTP I get timestamps with different durations in a trajectory (from ~0.015 to ~0.15 s per stamp). I need to have equal timestamps, they will be sent to a controller. It is bad even for simulation : with a low velocity the trajectory has jolts. So I need to adapt the trajectory myself. Is there a function that provide equal timestamps ? Does the MGI provide it ? I didn't find it in IPTP.

Best regards

edit retag flag offensive close merge delete