Today:
Taking Advantage of Object-Oriented Programming
We'll do an overview of translating our wall approach node to use classes.
Whirlwind Tour of Gazebo
Next, I just want to show you a demo of running Gazebo in case you want to use it to make progress on your warmup project. A more complete treatment of will be done in class next time.
Coordinate Frames
Sometimes thinking about a problem in a single global coordinate system is not the most elegant solution to a particular problem. In fact, we are used to working with multiple coordinate systems in our daily lives. Can you think of some examples?
In robotics, coordinate frames are especially useful. Even the simple Neato robot has a several built-in coordinate frames.
There are several more coordinate frames that might be useful to add on (but are not there yet). Can you think of any?
More complex robots have quite a few more coordinate frames. For instance, here is a diagram of all of the coordinate frames from the PR2. When dealing with robots this complicated, there is no way to manage the coordinate frames manually, you will make use of a 3-d robot model (for instance one created in solidworks).
Coordinate Frames and ROS
ROS has built-in capabilities for handling multiple coordinate systems. Further, ROS allows us to have multiple coordinate systems that even change over time! ROS maintains services for recording new coordinate transforms (which it learns about by receiving specially formatted messages). Additionally, ROS provides services for performing transformations between various coordinate frames.
Coordinate Frame Tutorials
There are some really nice tutorials that will help you learn coordinate frames on ROS wiki. If you want to see what you will be producing, check out the finished product here. Otherwise you can get there step by step:
Odometry
Odometry involves using motion data to estimate the position of a robot relative to its starting location. According to Wikipedia, "The word odometry is composed from the Greek words odos (meaning "travel", "journey", "route") and metron (meaning "measure")."
The Neatos have built-in rotary encoders that measure the angular velocity (about the wheel axle) for each of the wheels. Given the radius of each wheel, we can easily convert this into a linear velocity of each wheel. Therefore, if we want to perform odometry using the Neato, we'd have to estimate its position relative to a starting location given the time series of linear velocities of each wheel. This problem is known as the forward kinematics problem.
This page has some good notes on solving the problem for the specific case of a differential drive robot. Let's go over the derivation together. This page may help fill in some of the magic bits regarding rotation matrices.