We can add a collision object to the MoveIt! planning scene and can see how the motion planning works. For adding a collision object, we can use mesh files, which can directly be imported from the MoveIt! interface, and also can be added by writing a ROS node using MoveIt! APIs.
We will first discuss how to add a collision object using the ROS node:
In the node add_collision_objct.cpp which is inside the seven_dof_arm_test/src folder, we are starting an ROS node and creating an object of moveit::planning_interface::PlanningSceneInterface, which can access the planning scene of MoveIt! and can perform any action on the current scene. We are adding a sleep of 5 seconds to wait for the planningSceneIntertface ...