Feedback & Odometry: Coursera’s Control of Mobile Robots with ROS and ROSbots — Part 3

Welcome to part 3 of our multi-part Coursera’s Control of Mobile Robots (CMR) series. This series implements concepts learned from CMR with ROS and a ROSbots robot.

ROSbots is a ROS + OpenCV robot kit for Makers. Based off a Raspberry Pi and Arduino-compatible UNO board, the ROSbots robot kit caters to a Maker’s desire by being extremely hackable to implement any new robotics concepts you come across. All our code is open source on Github.

Previously in Part 2, What‘s in Part 3

Back in part 2 of our Control of Mobile Robots series, we wrote about the convenience of using a Unicycle Model to intuitively represent robot dynamics. But since our ROSbots robot is a differential drive robot, we need to talk about how the Unicycle Model relates to the Differential Drive Model dynamics. We then walked through ROS code to “drive” our ROSbots robot in a systematic manner, via remote control (RC).

In this part 3, we will build upon the Differential Drive dynamics to:

1. Introduce the concept of feedback
2. Describe how our ROSbots’ wheel encoder sensors work, and
3. Define the equations needed to compute the pose — the position and orientation — of our robot using feedback and our encoder readings.

Disclaimer: In this post, we actually won’t be showcasing any ROS code and will stick to talking about the equations and concepts behind feedback and odometry. But this sets us up for the next post which will have ROS code — promise!!

Need for Feedback

Even though we successfully sent drive commands to our robot, we cannot guarantee that our robot has executed on the commands. The packet may have dropped. The heavy payload may have stalled the motors.

In order to know if our robot has actually moved, we need sensors to return back some information. We need feedback.

In general, we define a couple of components in our feedback system:

1. r → a reference target which we want to achieve, ie a goal we want to get to, a speed we want to track, a line we want to follow.
2. u → r translates to some series of input commands we want to give to our robot to help us achieve, track r.
3. x → this is our current state. Our input u affects the state by a set of rules known as dynamics, or how the system evolves over time.
4. y → this is our measurement of the current state. Often times, it is impossible to actually observe the state x directly. But we can create sensors to measure it.

The measurement y is fed back to the beginning of the system to help us tweak our input u. Without y and a feedback process, we cannot know if we are tracking our reference preventing us from implementing an effective, stable controller to control our robot.

Odometry

Like with the Quickbot robot and Khepera robot used in the Coursera course, our ROSbots robot comes equipped with wheel encoders that measure the rotational velocity of the wheel.

The notches on the encoder disk of our ROSbots robot interfere with a light switch on the tips of the U arm on the speed sensor.