# Avoid collision with "difficult to detect" obstacles : desk ...

Hi everybody, Just wanted to share my experience on this and profit from yours. I'm using Ros melodic with full navigation stack and a Realsense RGBD camera. My main goal here is to avoid collision with "difficult to detect" object. As my robot height is around 1.2meters, I have to detect tables, desk (....).

To illustrate this, you'll find a screenshot from RVIZ here and the corresponding image here. NB: please, don't mind the bad position of the blue and red laserscans on the second pic. The laserscan frames are fixed for testing purposes. On this picture, you see 2 laserscans, when the robot is arround 2 meters away from a desk. My main goal is to avoid collision with the "right desk"

I'm using a depth camera and the depthimage_to_laserscan node (see here) to build the input of navigation stack (Slam, amcl ...). As I am in a constrained environment, I can't just take full height of depth image to generate the "full height" corresponding laserscan. Instead, I hacked depthimage_to_laserscan in order to generate 2 differents laserscans from the depthimage :

• the red one is the "centered" laserscan (scan height of 100 px around the center of the depthimage)
• the blue one is the "top" laserscan (same height, but from the top of the depth image)

I managed to get 2 topics : scan and scan_top.

During the slam phase:
- scan is used to build the map.
- scan_top is not used.

- scan is used by both amcl (to compute actual pose) and move_base - obstacle layer to compute the costmap)
- scan_top is only used to add what it detect to the costmap.