Ask Your Question
0

DistanceToCollision within a Moveit Planner

asked 2017-01-16 09:36:30 -0600

Guenther gravatar image

Hello,

I am trying to create a planner plugin within MoveIt, based on the CHOMP Planner already implemented. For this I need a distance function which returns the minimum distance between robot and environment, which DistanceToCollision provides. In order for the obstacles to be recognized and to avoid:

https://github.com/ros-planning/movei...

I use planning_scene_interface_.getObjects(). All of this works when the c++ code is run with moveit running, however when added to the planner this line causes an infinite loop, perhaps because the PlanningSceneInterface requires move_group, and the planner is run from it.

What could be done to solve this? Or alternatively is there another function that calculates distance to environment which does not require the PlanningSceneInterface and would work in the planner?

Thank you in advance.

edit retag flag offensive close merge delete

Comments

2

This is actually a cross-post of ros-planning/moveit#430.

gvdhoorn gravatar imagegvdhoorn ( 2017-01-31 15:22:20 -0600 )edit

hi, which sensor did you use !! @Guenther

zubair gravatar imagezubair ( 2019-01-07 08:17:08 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-01-31 15:09:05 -0600

Assuming that the "planning_scene" object has been updated to reflect the current state of the environment then you can use the checkCollision method, by setting the CollisionRequest.distance = true. The returned CollisionResult struct contains a map with the objects that collided and the shortest distance. Alternatively, you can use the distanceToCollision method.

edit flag offensive delete link more

Comments

Yes, you are correct. The problem was a planning scene that had not been updated. The planning_scene_interface is not intended to be used within a planner that is running as part of the move_group node, hence the errors. As gvdhoorn mentioned more details can be found at the moveit issue.

Guenther gravatar imageGuenther ( 2017-02-01 07:36:48 -0600 )edit

This correctly gives you the single closest distance to collision. I'm curious though, @jrgnicho is there a way to get a distance value for each robot link? https://answers.ros.org/question/2805...

alavin89 gravatar imagealavin89 ( 2018-01-24 20:13:03 -0600 )edit

@alavin89 I believe this feature is a work in progress at the moment, see here

jrgnicho gravatar imagejrgnicho ( 2018-02-12 17:54:19 -0600 )edit

looks like it was just merged!

alavin89 gravatar imagealavin89 ( 2018-04-19 12:35:54 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-01-16 09:36:30 -0600

Seen: 492 times

Last updated: Jan 31 '17