Further Exercises
Optionally, go beyond the tutorial and try to add features to this example. Two options are:
Adjustable rates
Define two kivy Slider
widgets that allow changing max_speed & max_angular_rate!
Play around with where you can put these and how you can link
them directly to the value in the VirtualJoystickApp.
Just remember, the actual rates the amiga drives at are limited by the vehicle control unit (VCU), so don't be surprised if the true max speed doesn't reflect the slider.
Toggle between Auto modes
Try to add a kivy Button widget that toggles the requested
AmigaControlState so the brain is not constantly trying to take
control of the dashboard while running.
Customizing an app
In order to customize an app we leverage the setup.cfg that contains all the metadata and package configuration.
More can be found here!
The most important first steps are to modify the metadata of the project and dependencies:
- Inside the
setup.cfgfile, adjust the fields under the tag[metadata]-
For basic users, the package name (
project_namein the project structure above) goes in thenamefield, and must match with the directory name right under thelibs/directory.- I.e., change both the
namefield and the directory name underlibs/to your new app name. - VScode should prompt you to change the import
names in
test_dummy.pyonce you change the directory name.-
If not, manually change:
from amiga_package import __version__
from amiga_package import ops -
To:
from <project_name> import __version__
from <project_name> import ops
-
- I.e., change both the
-
For advanced users, you can modify as much is compliant with Python
setuptools.
-
- Adjust the package dependencies
- Include whatever extra dependency you need in the
install_requiresfield. - Our only requirements are:
wheel: for packaging the app.kivy: to generate the graphical user interface (GUI).farm-ng-amiga: the Farm-ng Amiga public SDK.
- Include whatever extra dependency you need in the
Development and Debug an app
The workflow for development is pretty much the same as any standard gui application.
- Make changes in the code.
- Run the code with the play button in vs-code.
- [Optionally] Add a breakpoint to any line and use the Debug Console to interact.
- Go to step 1