Encoders

For computing the distance traveled by a mobile robot, we are going to use sensors that mesure the motion of the wheels, i.e. the angle turned by each wheel.

Optical encoders are vey popular in mobile robotics for measuring the position within a motor drive of at the shaft of a wheel. They consist of a source of light, a pattern disc, and a light detector. As the disc turns, light pulses are converted to a binary signal, which is counted and as a result an angle is produced.

First, as usual, let's initialize the robot.


In [ ]:
import packages.initialization
import pioneer3dx as p3dx
p3dx.init()

Now, the GUI widget controls the speed of each wheel independently, and displays the value (in radians) of the angle turned by each wheel.


In [ ]:
import encoder_widget

For the propor use of encoders, it's time for a bit of geometry in the next notebook: Angles and Distances


Try-a-Bot: an open source guide for robot programming

Developed by:

Sponsored by:

[![IEEE Robotics and Automation Society](img/logo/ras.png "IEEE Robotics and Automation Society")](http://www.ieee-ras.org) [![Cyberbotics](img/logo/cyberbotics.png "Cyberbotics")](http://www.cyberbotics.com) [![The Construct](img/logo/theconstruct.png "The Construct")](http://www.theconstructsim.com)

Follow us:

[![Facebook](img/logo/facebook.png "Facebook")](https://www.facebook.com/RobotProgrammingNetwork) [![YouTube](img/logo/youtube.png "YouTube")](https://www.youtube.com/user/robotprogrammingnet)