-
Select a serial communications library for Python and install it. As an example
PySerial
works well. -
Serial communications under Ubuntu require some permission adjustments.
Run these commands:sudo usermod -a -G tty robot sudo usermod -a -G dialout robot
and then log out and in. Without this, opening a serial port won’t work without sudo permissions.
-
Open the cloned repository in your IDE.
-
Use
motion.py
as an example and create the classOmniMotionRobot
that implements theIRobotMotion
interface.-
Create the new class
OmniMotionRobot
that extendsIRobotMotion
. -
Add implementations for the
open
andclose
methods. UseTurtleRobot
as an example. Consider that you should be able to define what port the serial connection should be created for. -
Define a new method for sending commands to the mainboard over serial. Refer to Test robot page for a detailed explanation of the command structure and how to assemble a command.
-
Test your code to validate that you can connect to and disconnect from the mainboard.
-
In case of issues, debug and ask instructors for help.
-
Connect the mainboard to the computer and check that the mainboard is wired to a motor driver correctly. It should be able to control motors.
-
Use your created functionality to control the motors. Tell the motor to spin with a speed of 20 and after 2 seconds, reverse its direction.
-
-
Show your progress to an instructor.
-
If everything works, you can continue to the next step. In case of issues, consult with instructors.