Operation - Make it Move
Contents
Operation - Make it Move#
This section describes how to make your Duckiebot move.
Tip
Troubleshooting sections are provided at the end of each operation page - start there if you run into any issues.
Keyboard control#
The easiest way to move a Duckiebot is by using the keyboard_control
command provided in the Duckietown shell. This video shows how to drive a Duckiebot using the keyboard, through the Duckietown Shell.
Option 1: Use the GUI (For Linux Users)#
If you are using Mac OSX, see Option 2.
To move your Duckiebot using your computer’s keyboard open a terminal and run:
dts duckiebot keyboard_control ![DUCKIEBOT_NAME]
Attention
For all operation commands that use the Duckiebot’s name - replace ![DUCKIEBOT_NAME]
with just the Duckiebot’s hostname
, do not include .local
part that you used previously to access the dashboard.
After startup, the keyboard_control
command will open an interface window. Make sure the window is active by selecting it, and use the keys in the table below to command your Duckiebot:
The following keys control the Duckiebot:
KEY |
Function |
---|---|
Arrow Keys - ↑ ↓ ← → |
Steer your Duckiebot |
q |
Quit |
a |
Turn on lane following (see note below) |
s |
Stop lane following |
i |
Toggle Anti-Instagram |
Note
The a, s, and i functions require the lane following demo to be running. For now, just try out the keyboard control and get your Duckiebot moving!
Option 2: Use the CLI (For Mac Users)#
If you are using MacOSX and find the keyboard interface is not responsive, run the stack directly on the Duckiebot and use the same keys within the command line interface as listed in the table above:
dts duckiebot keyboard_control ![DUCKIEBOT_NAME] --cli
Troubleshooting#
Troubleshooting
SYMPTOM
The Duckiebot does not move, and I cannot see the commands being sent to the Duckiebot when looking at the Dashboard > Mission Control page.
RESOLUTION
Make sure that the keyboard gui window is active by selecting it, then try the keyboard commands again. Some keyboard configurations may require that you use w a s d rather than ↑ ↓ ← →.
Troubleshooting
SYMPTOM
I can see the commands being sent to the Duckiebot (e.g., through the Dashboard > Mission Control), but the Duckiebot does not move. My Dashboard > Robot > Components page shows a red alert for the HUT
.
RESOLUTION
If you have a HUT
v3.1 you will stumble on this problem the first time you try to move your Duckiebot. Re-flash your HUT
following the procedure described in Debug - Re-flash Microcontroller.
Troubleshooting
SYMPTOM
I have reflashed the HUT but the joystick commands still do not work or the Duckiebot operates in a jerky manner. Additionally, the ToF sensor and front bumper are not detected on the dashboard Components page. I may also be having issues with the screen.
RESOLUTION
Disconnect the ToF sensor from the front bumper and use the long cable that originally connected the front bumper to the HUT to connect the ToF sensor directly to that same HUT port. Then reboot. This bypasses a known multiplexer issue on some bumpers that can cause other HUT misbehaviors.
Troubleshooting
SYMPTOM
I checked the two troubleshooting issues above, and my Duckiebot still doesn’t move.
RESOLUTION
Check that the duckiebot-interface
container is running
Open the Portainer interface and check the running containers. You should see one that has a name that contains duckiebot-interface
(exact container name will depend on your robot version).
You can also determine this by running:
docker -H ![ROBOT_NAME].local ps
and look at the output to find the duckiebot-interface
container and verify that it is running.
If you don’t see the container, your base image is out of date - update your Duckiebot with the command
dts duckiebot update ![ROBOT_NAME]
Troubleshooting
SYMPTOM
Duckiebot goes backwards, even though I command it to go forward.
RESOLUTION
If you have a DB17
or DB18
, revert the polarities (plus and minus cables) of the cables that go to the motor driver (HUT
) for both motors.