Detecting obstacles using a depth sensor
Previously, we manually added obstacles to the virtual environment using the MoveIt 2 wrapper and planning scene. This works well when the robot’s workspace is predefined with a 3D mesh. However, in dynamic environments, sensors are needed to detect obstacles in real time. In this section, we’ll add a depth sensor to the robot model and configure MoveIt 2 to automatically create a 3D shape of the surroundings.
A depth sensor provides 3D point cloud data of the area around the robot. We’ll begin by modifying the panda_arm.xacro
file to include this sensor:
- The sensor exists in the Gazebo simulator and is associated with a particular link – in our case, the first link of the robot. We are going to place the sensor at the base of the robot. The type of the sensor is
depth_camera
:<gazebo reference="${prefix}${link0_name}"> <sensor name='d435_depth' type=&apos...