Checking self-collisions using MoveIt! APIs

We have seen how to detect collision in RViz, but what do we have to do if we want to get collision information in our ROS node? In this section, we will discuss how to get the collision information of our robot in a ROS code. This example can check self collisions and environment collisions, and also tell which links were collided. The example called X is placed in the seven_dof_arm_test/src folder. This code is a modified version of the collision-checking example of PR2 MoveIt! robot tutorials. In this code, the following snippet loads the kinematic model of the robot to the planning scene:

robot_model_loader::RobotModelLoader robot_model_loader("robot_description"); robot_model::RobotModelPtr ...

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.