Collision Checking using move group commander in ROS (python)

1,458 views
Skip to first unread message

Fatma Faruq

unread,
Nov 18, 2013, 10:26:03 AM11/18/13
to moveit...@googlegroups.com
Hi Everyone, 

I've been using moveit! for baxter and wanted to use the ROS api provided to do some planning. 
The python interface is quite simple but I was wondering if there is any way to know whether a collision will happen or not using moveGroupCommander. 
I can get it to plan using moveGroupCommander.plan but is there a way I could find out about collisions through this api?

I see the collision robot class in moveit but I can't figure out how to access it through the ROS api provided. 

Baxter has built in collision avoidance so if I move one arm's end effector to where the other arms end effector is , it automatically moves the other arm away. I basically want to know when this will happen. Even in moveit! it seems to do the same i.e move the other arm away, even when I plan for say the left arm group only. 

I'm new to moveit!

Thanks so much for your help, 

Sam Pfeiffer

unread,
Aug 14, 2014, 9:55:22 AM8/14/14
to moveit...@googlegroups.com
I find myself in the same situation, I would like to have a Python interface to be able to check for collision in a RobotState or in a full RobotTrajectory computed elsewhere. For now I see no way on how to do it.
I expected the /compute_fk service to check for collisions but it doesn't do it.

Sam Pfeiffer

unread,
Aug 26, 2014, 5:23:10 AM8/26/14
to moveit...@googlegroups.com
Hello,

I found out there is the service:
/check_state_validity

Which accepts messages of type:

I make use of this service to check if a generated trajectory is safe to be executed (by testing every point in the trajectory). You can see a snippet of code doing this here: https://github.com/awesomebytes/dmp_gestures/blob/master/dmp_gestures/src/dmp_gestures/dmp_execution.py#L60-L85
(Beware of lots of random code... which is changing as we speak).

The service is quite fast (even checking collision with all the robot, which is what I'm doing) from python code a call takes for me 0.008s aprox. There is probably a lot of networking involved... maybe making a node in C++ that instantiates the collision checker and checks all the trajectory without doing the service call parts would be a lot faster to check trajectories.

I hope this is useful for someone else :)
Reply all
Reply to author
Forward
0 new messages