Duckiebot Assembly and Basic Development
I created the course Github repository, which can be found here: https://github.com/NicolasOng/CMPUT503
This is a screenshot of the dashboard, showing the Duckiebot's camera output and motor signals. To get these, we had to connect our laptops to the Duckiebot and go to http://csc22946.local/.
This is a screenshot of our Duckiebot running a script which gets it to output "Hello from csc22946!". To do this, we had to build a Docker image directly on the Duckiebot so we could run some code.
These are screenshots of the intrinsic and extrinsic yaml files which hold the camera calibration data. To get these, we performed the camera calibration steps.
This is a screenshot of the the kinematics yaml file. It holds the trim value we set while calibrating our wheels. To get this, we adjusted the trim while seeing if our bot drifted to the left or right.
This is a video of our Duckiebot driving in a straight line for a distance of 2 meters. You can even hear the TA Dikshant say "It's perfect!" at the end.
To achieve this, we adjusted the Duckiebot's "trim" value. Increasing the trim makes the robot drift more left, while decreasing the trim makes the robot drift more right.
Our Duckiebot initially drifted to the left, so we decreased our trim. After some trials, we settled on a trim of -0.063.
One frustrating thing was that our bot would drift in both directions on different trial runs, even with the same trim value. It's possible that the terrain wasn't perfectly flat or the wheels may not spin perfectly.
This is a video of our Duckiebot performing the Lane Following demo.
To achieve this, we had to calibrate both our wheels and the camera, then run the lane following demo.
In this exercise, we did the following:
Software Setup
Installed Ubuntu
Installed various (mostly Python related) dependencies
Installed Docker
Installed Duckietown Shell
Accounts Setup
Made Github account
Made Duckietown account
Made Docker account
Basic Duckiebot Operations
Charging/Turning on the Duckiebot
Accessing the Dashboard
Driving it with the keyboard
Running Python on it with Docker
Motor/Sensor Calibrations
Wheel Calibrations
Camera Calibrations
Intrinsic
Extrinsic
Lane Following Demo
In Exercise 1, we learned how to set up the Duckiebot - by installing software, creating accounts, performing calibrations - while getting familiar with basic functionality in the Duckiebot platform (driving, lane following demo, the dashboard, etc).
Most things went smoothly in this lab. However, there were some issues.
Our first issue was that the bot we initially chose, #08, didn't seem to charge. After an hour, its battery was still extremely low. So we swapped to bot #46 for the rest of the exercise.
Our second issue was with updating our Duckiebot. Our Duckiebot was unable to shutdown properly, so the TAs asked us to update it (plus it's part of the checklist). However, when we tried to run the update command, we got an authentication error from Docker.
To fix this, we had to do two things:
The Docker Token must have the highest privileges (read, write, delete)
When setting your Docker credentials in Duckietown, your username capitalization must match what is displayed on the Docker website
Overall, I enjoyed the lab. I think a good amount of time was given to complete it, and I learned a lot about the Duckiebot platform.
The exercise was straight forward. It felt like set up for larger and more complicated exercises in the future.
What is the purpose of calibrating the camera and motors?
All cameras/wheels are slightly different. Calibrating the camera allows the Duckiebot to correctly interpret the raw image coming from the camera. The wheels may not spin perfectly at the same speed, so calibrating them allows the Duckiebot to move in a straight line.
Why is docker useful?
Docker allows programs to be run on any hardware by packaging all its dependencies within a Docker environment. This is useful when you have different hardware devices, like in robotics. It is also lightweight, compared to something like VMs, which is also important in robotics. In a word: consistency.
Say your robot started to veer right when driving in a straight line. What do you think is causing the drift? What could your robot do to detect and adjust for this drift?
Possible causes of drift:
Wheels turning at different rates
Uneven terrain (height or friction) causing each wheel to drive the bot at different rates
To calibrate our wheels, we adjusted the trim value, which adjusted the wheel speeds.
To detect drift, the robot could use an accelerometer or camera. To adjust it, the robot can only really adjust wheel speeds. For uneven terrain, it would have to do this on the fly (the Duckiebot is unable to adjust the terrain).
While running the lane following demo, at which parts of the road did your robot have trouble following the lane? Why do you think this is?
Our robot only really struggled at the curves of the lane. This may be because the tape was hard for the image processing to recognise at the curves. Further, it may be hard for the bot itself to control its turning to follow the corners.
How does your DuckieBot follow the lane in the lane following demo? If you don't know - can you speculate on how it works?
To speculate, I think the bot looks for a certain color in the image - white and yellow - to mark the sides of the lanes. These images are then converted into lines, which are then used to define the bot's immediate surrounding lane. The bot then attempts to remain in the middle of the lines that surround it by staying straight or curving.
What is your key takeaway from this lab?
My key takeaway is that I now know how to setup the Duckiebot, calibrate it, and perform basic operations with it.
I collaborated with:
Martin McLaren
Truong Pham
Resources used:
The given Google site template to make this course website
Github to host my course repository
ChatGPT and Google mostly for questions about the terminal commands I'm running and some troubleshooting
Duckietown compliant Docker image