Mars Utilities
Utilties for building better robot code
View the docs online at Read the Docs
ControlManager
ControlManager provides a wrapper that makes making alternate control modes (alternate drivers, different controlers) incredibly simple. It is designed primarially for MagicRobot components, however, it should work with any type.
See example/ for an example robot.
Usage
First, all of the controls must be implemented as classes that subclass marsutils.ControlInterface. The primary control code defined in the teleopPeriodic method.
Then, you must define the _DISPLAY_NAME field which will be displayed on the dashboard autochooser.
You can set _SORT to prioritize certain interfaces, the higher the number, the higher on the chooser list.
Because it is a magic bot component, you can access injected components.
But you must make an empty execute function to be a valid magicbot function.
After you have the control components there are two ways to create the manager.
MagicBot magic
If you are using the MagicRobot framework you can use the @with_ctrl_manager decorator to automagically set everything up. Just annotate your robot class with @with_ctrl_manager and you are done. It will magically detect any ControlInterfaces, construct the ControlManager and automatically call the periodic functions.
Using the decorator also means you don't need to define an execute function.
Manually
Otherwize, you must must set up manager by initializing ControlManager with all of your components after createObjects has been called. This is not technically possible with the MagicBot framework yet.
self.control_manager = marsutils.ControlManager(self.xbox_ctrl, self.joystick_ctrl)
After you have created the control manager, you must call its periodic functions. This means adding self.control_manager.teleopPeriodic() to your teleopPeriodic function and so on for each function you use.
Metadata
Release files for marsutils 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| marsutils-0.5.0.tar.gz | 5.0 kB | Without provenance | Details for marsutils-0.5.0.tar.gz |
Release files / marsutils-0.5.0.tar.gz
| Download URL | marsutils-0.5.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2fc1085fb6f828b4e4128511fcb1a586b0f2b0f2281d370a35d5794a314c3489
|
|
BLAKE2b-256 checksum How to use checksums |
417fc7e4d7f6d3a4f94e39ee4e0da7e49fad0abb63cd4f79cef63126c03cdd3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
|
Security for marsutils 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.