Rosanswers logo

hi guys, i'm new with ROS. how to get real robot odometry XYZ in the room by using lidar? right now i wanted to write simple code to move the roboto without IMU or Tick, just lidar. so basically i want Odometry data with Lidar.

my specs real robot is;

  1. YDLidar X4
  2. H bridge
  3. Raspberry pi 3B+
  4. 2 DC Motors

if you can help me i would really appreciate that, thank you very much.

Originally posted by Ridy on ROS Answers with karma: 3 on 2020-08-13

Post score: 0


1 Answer 1


Rosanswers logo

It won't do Z, but Hector mapping will allow you to map X,Y without encoders and the laser-scan-matcher can generate ODOM using laser scan.

But if your motors do not have any feedback, you need to really run the robot very slowly as the lidar is relatively slow and you'll be using the lidar essentially as the feedback for your motor control. I trust the motors have very steep gearing.

Do your self a favor and spend a few days going through the tutorials carefully. In the end it will save you a lot of time.

Originally posted by billy with karma: 1850 on 2020-08-14

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by Ridy on 2020-08-17:
Hi thank you for helping me. i know scanmatcher can generate odom but i don't understand why my odom don't show a message. I try echo the odom but it's seem the odom didn't realise, it's showing nothing.

Comment by billy on 2020-08-18:
OK I owe you some clarification. The scan-matcher outputs the pose - not odom directly. You can calculate ODOM by evaluating the change in the pose in time. Depending on the reason you want ODOM, you may find having the pose directly is more convenient. Sorry for the confusion.

Read more here: http://wiki.ros.org/laser_scan_matcher

Comment by Ridy on 2020-08-18:
thank you so much, finally i can get the real robot position now :D.

Comment by Mr Tai on 2021-04-28:
Hi Ridy, i have the same. I don have motor encoder, but I see tutorial which have encoder. Can you help me?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.