ROS obstacles avoidance using LIDAR or depth camera

Hello dear,
As I understand from this amazing platform till now(where I finish 45% of ROS basics in 5 days with python), that the procedure of obstacles avoidance is:

  1. get the distance for front/right/left from the msg that send by topic (/scan)
  2. use python code to make procedure
  3. send this procedure via cml_vel to move the robot

from my experience, many LIDAR sensors don’t offer their data by sample way,
for that I was asking is their any industrial LIDAR recommended that offer easy way to extract the distance for each angle?

My 2’nd question:
Do you recommend use depth camera for obstacles avoidance?
is there any recommended modules?
what about realsense D435 from intel?


Hello @aameralshamy3 ,

I’m not sure if I fully understand your first question, but in ROS, the laser data is provided using a LaserScan message (sensor_msgs/LaserScan Documentation). With this message, it’s pretty straightforward to extract the angles data using the angle_min, angle_max, and angle_increment fields. Here you have some models:

As for the Depth Camera question, it really depends on the application you want to build. For mobile robots, it’s usually enough with a Laser sensor for doing Object Avoidance, so I wouldn’t recommend it. But yes, the D435 from Intel is a good option in any case:

1 Like

Thanks you for your reply @albertoezquerro
in my application I have mobile robot with low speed,I need to provide it with avoidance obstacles ability and implement object detection, do you think I can do both tasks depending on the depth camera data analysis?

If your answer is no, do you recommend any reliable Lidar module with price less than 1000 USD ?
do you think 2d 360 digree Lidar good or 3d one best?

Hello @aameralshamy3 ,

Yes, you should be able to do both obstacle avoidance and object detection using a Depth camera. You can also convert the PointCloud data of the Depth camera into LaserScan data (using something like this: which you can directly feed into the ROS Navigation stack.


1 Like

Thank you very much alberto :+1: :+1: