-
Notifications
You must be signed in to change notification settings - Fork 0
UniBot Subsystems
Many VexOS robots have similar subsystems, such as a drive, a lift and some form of rotary intake. This leads to boiler-plate code between similar robots. To eliminate this, VexOS includes "Uni_versal Ro_bot" subsystems that, along with their standard commands, can be configured and used with multiple robots.
To use the UniBot classes, add the following line to your Robot.h file:
#include "UniBot.h"If you are using easyC, you will also need to add the header to your project: in the Project Explorer, right-click on Header Files and choose Add Existing Item.... The UniBot.h is distributed with VexOS or is in the public include/ subdirectory of the source archive.
The available UniBot classes are:
- UniDrive - A universal drive-train
- UniLift - A lift (single arm, 4-bar, 6-bar, elevator) with pre-defined positions
- UniIntake - A rotary input
When each class is used in the DefineRobot(...systems...) directive, the linker then asks you to implement two functions per subsystem. The functions are named based on the Subsystem name. All subsystem methods follow the same pattern.
- There is a "configure" method that receives a pointer to a hardware setup structure that you must populate with hardware and values. The layout of the structure is in
UniBot.h. This method is called during the Subsystem constructor (hardware setup RunMode). - There is also a "getDefaultCommand" method that can return a Command instance to use as the default Command. Return NULL if there is no default Command. This method is called during the Subsystem initializer (initialize RunMode).
Documentation for Commands to operate UniBot hardware can be found in Built-in Commands.
A universal drive-train that can be configured for tank, holonomic (mechanum or X-holo) or H-drive.
(more info soon)
A universal lift (either single or split motor control) that can occupy pre-defined positions. This class can, in fact, be applied for any function that moves to pre-defined positions, but lifts are the most common use.
(more info soon)
A simple rotary intake used to collect game pieces. This can be used for any function that runs one group of motors at pre-set speeds.
(more info soon)