This is an old revision of the document!
====== Turtlebot: Sensing Part 1 ———————
Intro
It might seem weird to have an adventure entitle sensing the turtlebot, but in the world of controls actuation and sensing go hand in hand. We really need to sense the turtlebot to be able to properly control it. That said, the turtlebot does indeed have a few sensors on it that are used to measure movement of the turtlebot. The first are a pair of rotary encoders, used to measure the rotational velocity of the wheels (as you've seen, commanding a velocity and getting that particular velocity are two different things). They are used be the turtlebot to achieve, as best as possible, the desired rotational velocity of the wheels. The forward and rotational velocities defined by the twist are converted into desired wheel rotation velocities, which the robot attempts to match. The encoders help with this regulation.
Another on-board sensor is a z-axis gyro (where the z-axis is the body vertical vector on the turtlebot). Most importantly, the turtlebot also has “cliff” and “bump” sensors, which are really switches attached to pressable or pop-out-able body parts for sensing whether the turtlebot has run into a relatively solid object, or whether a part of its body is hanging over a vertical edge. Associated to this, there are also “wheel drop” sensors that let the turtlebot know when it is raised off of the ground (or maybe when you've jumped it off of a stunt ramp).
The encoder and the gyro sensors are indeed sensing the robot proper. The other switch-type sensors measure what sort of local, tactile interaction the robot is having with its environment (or could possibly have!). Typically the goal is to not have these interactions, unless of course your goal is to push an object or have the turtlebot catch air.
Investigation
What are the ROS topics that must be subscribed to in order to get these sensor measurements?
- Copy the goforward code to another file. Modify it so that the robot moves with a constant slow velocity. Add a condition to stop when it bumps into something or senses a wheel drop condition. It should start again 2 seconds after the condition is removed. -