Exercises
You could enhance the system in many ways. Here are some suggestions for building further:
- In the
manual_drive.py
file, thehandle_instruction
function uses a bunch ofif
statements to handle the instruction. If this list of command handlers exceeds five, you could improve it by using a dictionary (such asmenu_modes
) and then calling different handler methods. - Could you change the touch interface into two circular pads—perhaps so the left controls motor movement and the right changes the camera position?
- What about creating phone-friendly interfaces for other behaviors to control their parameters?
- You could embellish the CSS by adding round buttons or putting spacing between the buttons.
- The menu still uses text buttons. Could you find a way to associate an image with each behavior and make a button grid?
- Adding a Shutdown menu button will mean you could more gracefully shut down the Pi, where it would start the
sudo poweroff
command.
...