ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Robot distance/angle positioning with sensors

asked 2016-07-15 23:49:35 -0600

stefano77 gravatar image

Hello guys,

In my project - which I successfully simulated with Gazebo ROS my robots needs to position itself exactly in perpendicular position to a metallic surface - specifically 3 meters from the side-door of a car so that the front of the robot points the same direction of the car.

I successfully solved the issue in Gazebo ROS using a lidar sensor.

image description

The algorithm works the following way. I calculated the distance/angle from the target surface using 3 different scan ranges from the lidar output. Using a few trigonometric functions I was able to calculate the angle correction that had to be applied to the robot base_link to be perfectly perpendicular to the target.

So everything is perfect in simulation!

image description

The pain now comes in the real world...

I tested my align-base function in real world using a RPLidar (robot peak lidar). I noticed that the lidar scan output on a black metal surface is very unreliable. Consider that black and metal is very common on a car body (I didn't test on other colors yet)

Now my question is: did I use the wrong type of sensor for this sort of application - or there's any work around you can suggest to solve the issue?

Can't wait to hear your opinions!


edit retag flag offensive close merge delete


Hello! I want to create a specific car in to implement in ROS and i can't find a something like tutorial or examples of creating cars from scratch (these cars should look well, like your car) and simulate them in rviz. Do you have some ideas which programs or packages I should use? I know that is my answer is not common with topic but I can't send you a private message :) Thanks a lot

aleksandra gravatar image aleksandra  ( 2017-04-20 06:22:36 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-07-16 00:55:04 -0600

ahendrix gravatar image

The RoboPeak and other low-price lidar sensors tend to have trouble with dark surfaces that are at the far end of their sensing range (>50% of rated range); the Hokuyo URG-04LX and the Neato Lidar have similar issues in similar situations.

These sensors tend to do better a close range.

I can think of a few options:

  • I'm not sure what your algorithm is doing, but you may be able take more samples and average out the noise
  • Take advantage of better sensor performance at close range by starting your robot closer to the vehicle, doing the alignment, and then drive directly away from the vehicle
  • Get a more powerful lidar like the Hokuyo UTM-30LX (Maybe Scanse?)
edit flag offensive delete link more


Hello, thank you very much for your suggestion. Anyway what I noticed is that the black metal surface is almost invisibile even if placed at 1.5mt of distance (...i know it seems really strange, but it doesn't happen with a white wall for example!). I will send you rviz screen capture!

stefano77 gravatar image stefano77  ( 2016-07-16 02:06:38 -0600 )edit

Most of the trouble I've seen with these types of sensors has been with matte black surfaces indoors, which mostly absorb the laser beam instead of scattering it and sending some back to the sensor. Reflective black surfaces may be worse because they reflect the laser away from the sensor.

ahendrix gravatar image ahendrix  ( 2016-07-16 02:41:15 -0600 )edit

Perhaps you can solve material problems with materials. For instance, apply tape or a poster to the wall where the lidar reads the points. Consider it an alternative in case a more expensive sensor it out of the question.

Another possible solution is to use ultrasonics instead. Very cheap sensors, and if you only need two distances, then two sensors are enough. A third option is to use a depth camera, although dark matte materials can be problematic for stereoscopic cameras as well. A final, brute force option, is to move closer, if possible.

Per Edwardsson gravatar image Per Edwardsson  ( 2022-06-01 01:59:08 -0600 )edit

Question Tools

1 follower


Asked: 2016-07-15 23:49:35 -0600

Seen: 1,409 times

Last updated: May 30 '22