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

can somebody clarify odometry in layman's term?

asked 2020-06-15 11:22:53 -0500

Viv6429 gravatar image

Hi,

I am new to ros and robotics, I went through the ros tutorials and is still confused about odometry. I am thinking about a differential drive bot, I get that I can get the ticks from a rotary encoder but how do I convert it to the odometry message? do I need a gyro to generate odometry data? and what is the use of the covariance?

what I get from google is that I can use ros-serial to communicate with the MCU and retrieve data from MCU publish it.

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-06-15 17:21:48 -0500

achille gravatar image

I wrote a pretty detailed description of this in this blog. It also includes a description of covariance (and whether you should bother to set it)

In ROS speak, odometry means an estimate of a) how fast your robot is going and b) an estimate of where it is relative to where it started, based on the estimate in a). Wheel odometry is the most commonly used one, but you can have various sources of odometry (an IMU, or successive laser scans, and so on) which you can combine. There's a covariance matrices associated with each estimate a) and b) and those basically express how confident the robot is in its estimate.

So now that you know that odometry is just an estimate of velocity, you can see how you can convert encoder ticks to a speed. If you are using a motor controller or motor shield instead of doing this yourself as @billy describes in his answer, that device will tell you how fast the wheel is spinning. If you're rolling your own, you measure the number of encoder ticks per second (and how many ticks there are for one motor revolution) to find the angular velocity of the wheel. How that the speeds of each wheel then gets converted to robot velocity depends on the type of robot you're using.

edit flag offensive delete link more
0

answered 2020-06-15 17:01:28 -0500

billy gravatar image

How you get ODOM will depend on the hardware you're using, but at a high level you seem to understand it. You do not need a gyro for ODOM. Odometry is typically understood to come from encoders that measure rotation of wheels.

In a typical small/hobby/learning differential drive robot the encoder counts for wheel rotation will come from whatever is controlling the motors. Sometimes people will try to control the motors directly with a PC or RPi and issue PWM to a driver chip and try to monitor the encoder lines directly, some will use a small MCU as you mention to do this HW-centric work with a serial or I2C connection to PC, or maybe the best compromise is to buy a purpose built motor controller that does the motor control and the encoder counting for you.

Which one is best depends on your situation. If you're up against a deadline the purpose built motor controller is the way to go. If you're on a tight budget and this is just for fun and learning then an aurdino, H-bridge, and maybe encoder counter chip may by best. If you're looking for a stress induced stomach disorder, try to get an RPi to directly read two high speed encoders, drive dual PWMs and run ROS.

As example, the 3 units on teh right side of this table all provide position feedback which means they can do the encoder counting and pass that data to the PC. https://www.pololu.com/category/10/br...

  • I do not work for or represent pololu or any of the products shown. But have used one of them.
edit flag offensive delete link more

Question Tools

Stats

Asked: 2020-06-15 11:22:53 -0500

Seen: 139 times

Last updated: Jun 15 '20