Basics
Creating a robot
from Roomba import Roomba
my_robot = Roomba.Roomba()
The robot should respond with the following message, showing that the connection was made.
----------------------------------------
Create opened serial connection
port: /dev/ttyUSB0
datarate: 115200 bps
----------------------------------------
Motion commands
- Set the speed of the two motors in millimeters per second
my_robot.set_motors(left_speed, right_speed)
- Set the robot's linear and rotational speeds in millimeters per second and degrees per second. If one of the two arguments is not provided, it will be assumed to be zero
my_robot.kinematic(lin_speed=x, rot_speed=y)
- Make the robot drive a certain distance in millimeters.
my_robot.move(distance)
- Make the robot turn some degrees. Positive angles are clockwise (right), and negative angles are counterclockwise (left).
my_robot.turn(degrees)
- Stopping the robot. In an emergency, picking up the robot will also stop it.
my_robot.stop()
Additional commands
- Setting the onboard Roomba display. The onboard display can show up to four characters.
my_robot.set_display(text)