ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

planning scene collision distance

asked 2013-10-16 07:29:14 -0600

Robotnik gravatar image

updated 2013-10-16 07:30:04 -0600

Hi,

I am using Groovy with Ubuntu 12.04.

I am trying to call the planning_planning_scene::PlanningScene::distanceToCollision functions, but the returned value is always a constant huge number. The call to selfCollisionCheck does work perfectly.

... // Collision check

robot_state::RobotState& current_state = planning_scene_ptr_->getCurrentStateNonConst(); current_state = *kinematic_state_; collision_detection::CollisionRequest collision_request; collision_detection::CollisionResult collision_result; collision_request.group_name = "arm_tcp";
collision_result.clear(); planning_scene_ptr_->checkSelfCollision(collision_request, collision_result, current_state); if (collision_result.collision) ROS_ERROR("Robot in SELF-COLLISION");

double distance_to_collision = planning_scene_ptr_->distanceToCollision( current_state);

...

a working example measuring the distance to the nearest collision would be much appreciated.

Thanks and best regards,

Roberto

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-10-17 01:12:31 -0600

Robotnik gravatar image

Solved. The problem was related with the collision matrix generated from the setup_assistant. Just manually disabling some additional joints on the SRDF file, the following code does work:

 // Collision check
  robot_state::RobotState& current_state = planning_scene_ptr_->getCurrentStateNonConst();
  current_state = *kinematic_state_;
  collision_detection::CollisionRequest collision_request;
  collision_detection::CollisionResult collision_result;
  collision_request.group_name = "arm_tcp";  
  collision_request.distance = true;
  collision_result.clear();
  planning_scene_ptr_->checkSelfCollision(collision_request, collision_result, current_state);
  if (collision_result.collision) ROS_ERROR("Robot in SELF-COLLISION");
  ROS_INFO("Collision result %5.10f", collision_result.distance);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-10-16 07:29:14 -0600

Seen: 186 times

Last updated: Oct 17 '13