Trajectory Stuck in loop!

379 views
Skip to first unread message

Muhammad Asif Rana

unread,
Apr 7, 2014, 3:40:27 PM4/7/14
to moveit...@googlegroups.com
Hi,

I am trying to make a robot arm pick an object, follow a trajectory through waypoints and then place the object at the target.

I am having the following problem:

1) Whenever I call group.computeCartesianPath(...) it automatically executes the trajectory as well which. Thats fine as well, but it keeps on going through the trajectory as if in a loop. I just want to go to the target, stop there and place the object.

2) Also, is there any way of checking and changing the robot-state while the trajectory is being executed? I want to see when the robot reaches a particular point and then detach the object from it.


This seems pretty trivial task and I am sure people would have done that. So, any code snippets/functions in C++ would help.



Thanks in Advance!



Acorn Pooley

unread,
Apr 7, 2014, 4:16:52 PM4/7/14
to Muhammad Asif Rana, moveit...@googlegroups.com
Is the physical robot repeating this trajectory, or just the image of the robot in rviz?  Rviz will loop the last plan as long as PlannedPath->LoopAnimation is checked.

-Acorn

From: moveit...@googlegroups.com [moveit...@googlegroups.com] on behalf of Muhammad Asif Rana [asif...@gmail.com]
Sent: Monday, April 07, 2014 12:40 PM
To: moveit...@googlegroups.com
Subject: Trajectory Stuck in loop!

Muhammad Asif Rana

unread,
Apr 7, 2014, 5:34:57 PM4/7/14
to moveit...@googlegroups.com, Muhammad Asif Rana
No, not the actual robot. I am talking about the robot in Rviz.

How do you uncheck that? I am pretty new to ROS and moveit so pardon  me if this is a stupid question.

Further, can you help me out with the other tasks I am trying to achieve here. Like detaching the object and stuff.

waldez junior

unread,
Apr 7, 2014, 7:42:50 PM4/7/14
to moveit...@googlegroups.com, Muhammad Asif Rana

All you have to do is to uncheck the box which says "loop animation" inside the planned path tab inside motion planning plugin in RViz =D
loop_animation.jpg

Muhammad Asif Rana

unread,
Apr 7, 2014, 8:57:16 PM4/7/14
to waldez junior, moveit...@googlegroups.com
Is there a way to do it in code?

waldez junior

unread,
Apr 7, 2014, 9:02:14 PM4/7/14
to moveit...@googlegroups.com, waldez junior
Im not sure, never looked into that really, but a quick fix would be to uncheck it and save the rviz configuration, the next time you launch it, the box should be unchecked already.

Muhammad Asif Rana

unread,
Apr 7, 2014, 11:14:06 PM4/7/14
to moveit...@googlegroups.com, waldez junior
Hey thanks for the help.

I tried that and now its not looping anymore. However, the problem now is that the robot goes to final state and then disappears :/ Why do you think thats happening?

Moreover, do you know why the group.computeCartesianPath() and group.plan() functions executing the trajectories as well? I though they should just compute the trajectories only but not execute them.

Also, is there a way to know the state of robot during the trajectory execution. I wish to detach the object when it reaches a certain place.


Thanks!

savan...@gmail.com

unread,
Apr 8, 2014, 3:33:13 AM4/8/14
to Muhammad Asif Rana, waldez junior, moveit...@googlegroups.com

Hello,

group.getCartesianPath and group.plan will just display the planned trajectory, by default in a loop.
If you want the trajectory to be executed, then you must call group.execute(plan).

group.getCurrentState will return a RobotState which can be used to get position of any link.

savan...@gmail.com

unread,
Apr 8, 2014, 4:27:42 AM4/8/14
to moveit...@googlegroups.com

It doesn't exactly execute the plan when you do group.plan(&plan). It just displays the planned path. The state of the robot is not changed.

I guess you could turn off the planned trajectory display from Rviz settings checkboxes.

Hi,

Thanks for the reply.

I have to first call group.plan(&my_plan) to make a plan for me. Then, I want to do some other task before executing the plan using group.execute(my_plan).

However, group.plan executes the plan before letting me call the execution. Am I doing something wrong?
Reply all
Reply to author
Forward
0 new messages