|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
#include <chassisControllerIntegrated.hpp>
Public Member Functions | |
| ChassisControllerIntegrated (const TimeUtil &itimeUtil, std::shared_ptr< ChassisModel > imodel, std::unique_ptr< AsyncPosIntegratedController > ileftController, std::unique_ptr< AsyncPosIntegratedController > irightController, const AbstractMotor::GearsetRatioPair &igearset=AbstractMotor::gearset::green, const ChassisScales &iscales=ChassisScales({1, 1}, imev5GreenTPR), std::shared_ptr< Logger > ilogger=Logger::getDefaultLogger()) | |
| ChassisController using the V5 motor's integrated control. | |
| void | moveDistance (QLength itarget) override |
| Drives the robot straight for a distance (using closed-loop control). | |
| void | moveRaw (double itarget) override |
| Drives the robot straight for a distance (using closed-loop control). | |
| void | moveDistanceAsync (QLength itarget) override |
| Sets the target distance for the robot to drive straight (using closed-loop control). | |
| void | moveRawAsync (double itarget) override |
| Sets the target distance for the robot to drive straight (using closed-loop control). | |
| void | turnAngle (QAngle idegTarget) override |
| Turns the robot clockwise in place (using closed-loop control). | |
| void | turnRaw (double idegTarget) override |
| Turns the robot clockwise in place (using closed-loop control). | |
| void | turnAngleAsync (QAngle idegTarget) override |
| Sets the target angle for the robot to turn clockwise in place (using closed-loop control). | |
| void | turnRawAsync (double idegTarget) override |
| Sets the target angle for the robot to turn clockwise in place (using closed-loop control). | |
| void | setTurnsMirrored (bool ishouldMirror) override |
| Sets whether turns should be mirrored. | |
| bool | isSettled () override |
| Checks whether the internal controllers are currently settled. | |
| void | waitUntilSettled () override |
| Delays until the currently executing movement completes. | |
| void | stop () override |
| Interrupts the current movement to stop the robot. | |
| ChassisScales | getChassisScales () const override |
| Get the ChassisScales. | |
| AbstractMotor::GearsetRatioPair | getGearsetRatioPair () const override |
| Get the GearsetRatioPair. | |
| std::shared_ptr< ChassisModel > | getModel () override |
| ChassisModel & | model () override |
| void | setMaxVelocity (double imaxVelocity) override |
| Sets a new maximum velocity in RPM [0-600]. | |
| double | getMaxVelocity () const override |
Public Member Functions inherited from okapi::ChassisController | |
| ChassisController ()=default | |
| A ChassisController adds a closed-loop layer on top of a ChassisModel. | |
| virtual | ~ChassisController ()=default |
Protected Attributes | |
| std::shared_ptr< Logger > | logger |
| bool | normalTurns {true} |
| std::shared_ptr< ChassisModel > | chassisModel |
| TimeUtil | timeUtil |
| std::unique_ptr< AsyncPosIntegratedController > | leftController |
| std::unique_ptr< AsyncPosIntegratedController > | rightController |
| int | lastTarget |
| ChassisScales | scales |
| AbstractMotor::GearsetRatioPair | gearsetRatioPair |
Definition at line 14 of file chassisControllerIntegrated.hpp.
| okapi::ChassisControllerIntegrated::ChassisControllerIntegrated | ( | const TimeUtil & | itimeUtil, |
| std::shared_ptr< ChassisModel > | imodel, | ||
| std::unique_ptr< AsyncPosIntegratedController > | ileftController, | ||
| std::unique_ptr< AsyncPosIntegratedController > | irightController, | ||
| const AbstractMotor::GearsetRatioPair & | igearset = AbstractMotor::gearset::green, |
||
| const ChassisScales & | iscales = ChassisScales({1, 1}, imev5GreenTPR), |
||
| std::shared_ptr< Logger > | ilogger = Logger::getDefaultLogger() |
||
| ) |
ChassisController using the V5 motor's integrated control.
Puts the motors into encoder count units. Throws a std::invalid_argument exception if the gear ratio is zero. The initial model's max velocity will be propagated to the controllers.
| itimeUtil | The TimeUtil. |
| imodel | The ChassisModel used to read from sensors/write to motors. |
| ileftController | The controller used for the left side motors. |
| irightController | The controller used for the right side motors. |
| igearset | The internal gearset and external ratio used on the drive motors. |
| iscales | The ChassisScales. |
| ilogger | The logger this instance will log to. |
|
overridevirtual |
Get the ChassisScales.
Implements okapi::ChassisController.
|
overridevirtual |
Get the GearsetRatioPair.
Implements okapi::ChassisController.
|
overridevirtual |
Implements okapi::ChassisController.
|
overridevirtual |
Implements okapi::ChassisController.
|
overridevirtual |
Checks whether the internal controllers are currently settled.
Implements okapi::ChassisController.
|
overridevirtual |
Implements okapi::ChassisController.
|
overridevirtual |
Drives the robot straight for a distance (using closed-loop control).
| itarget | distance to travel |
Implements okapi::ChassisController.
|
overridevirtual |
Sets the target distance for the robot to drive straight (using closed-loop control).
| itarget | distance to travel |
Implements okapi::ChassisController.
|
overridevirtual |
Drives the robot straight for a distance (using closed-loop control).
| itarget | distance to travel in motor degrees |
Implements okapi::ChassisController.
|
overridevirtual |
Sets the target distance for the robot to drive straight (using closed-loop control).
| itarget | distance to travel in motor degrees |
Implements okapi::ChassisController.
|
overridevirtual |
Sets a new maximum velocity in RPM [0-600].
| imaxVelocity | The new maximum velocity. |
Implements okapi::ChassisController.
|
overridevirtual |
Sets whether turns should be mirrored.
| ishouldMirror | whether turns should be mirrored |
Implements okapi::ChassisController.
|
overridevirtual |
Interrupts the current movement to stop the robot.
Implements okapi::ChassisController.
|
overridevirtual |
Turns the robot clockwise in place (using closed-loop control).
| idegTarget | angle to turn for |
Implements okapi::ChassisController.
|
overridevirtual |
Sets the target angle for the robot to turn clockwise in place (using closed-loop control).
| idegTarget | angle to turn for |
Implements okapi::ChassisController.
|
overridevirtual |
Turns the robot clockwise in place (using closed-loop control).
| idegTarget | angle to turn for in motor degrees |
Implements okapi::ChassisController.
|
overridevirtual |
Sets the target angle for the robot to turn clockwise in place (using closed-loop control).
| idegTarget | angle to turn for in motor degrees |
Implements okapi::ChassisController.
|
overridevirtual |
Delays until the currently executing movement completes.
Implements okapi::ChassisController.
|
protected |
Definition at line 176 of file chassisControllerIntegrated.hpp.
|
protected |
Definition at line 182 of file chassisControllerIntegrated.hpp.
|
protected |
Definition at line 180 of file chassisControllerIntegrated.hpp.
|
protected |
Definition at line 178 of file chassisControllerIntegrated.hpp.
|
protected |
Definition at line 174 of file chassisControllerIntegrated.hpp.
|
protected |
Definition at line 175 of file chassisControllerIntegrated.hpp.
|
protected |
Definition at line 179 of file chassisControllerIntegrated.hpp.
|
protected |
Definition at line 181 of file chassisControllerIntegrated.hpp.
|
protected |
Definition at line 177 of file chassisControllerIntegrated.hpp.