|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
#include <defaultOdomChassisController.hpp>
Public Member Functions | |
| DefaultOdomChassisController (const TimeUtil &itimeUtil, std::shared_ptr< Odometry > iodometry, std::shared_ptr< ChassisController > icontroller, const StateMode &imode=StateMode::FRAME_TRANSFORMATION, QLength imoveThreshold=0_mm, QAngle iturnThreshold=0_deg, std::shared_ptr< Logger > ilogger=Logger::getDefaultLogger()) | |
| Odometry based chassis controller that moves using a separately constructed chassis controller. | |
| DefaultOdomChassisController (const DefaultOdomChassisController &)=delete | |
| DefaultOdomChassisController (DefaultOdomChassisController &&other)=delete | |
| DefaultOdomChassisController & | operator= (const DefaultOdomChassisController &other)=delete |
| DefaultOdomChassisController & | operator= (DefaultOdomChassisController &&other)=delete |
| void | driveToPoint (const Point &ipoint, bool ibackwards=false, const QLength &ioffset=0_mm) override |
| Drives the robot straight to a point in the odom frame. | |
| void | turnToPoint (const Point &ipoint) override |
| Turns the robot to face a point in the odom frame. | |
| std::shared_ptr< ChassisController > | getChassisController () |
| ChassisController & | chassisController () |
| void | turnToAngle (const QAngle &iangle) override |
| This delegates to the input ChassisController. | |
| void | moveDistance (QLength itarget) override |
| This delegates to the input ChassisController. | |
| void | moveRaw (double itarget) override |
| This delegates to the input ChassisController. | |
| void | moveDistanceAsync (QLength itarget) override |
| This delegates to the input ChassisController. | |
| void | moveRawAsync (double itarget) override |
| This delegates to the input ChassisController. | |
| void | turnAngle (QAngle idegTarget) override |
| Turns chassis to desired angle (turns in the direction of smallest angle) (ex. | |
| void | turnRaw (double idegTarget) override |
| This delegates to the input ChassisController. | |
| void | turnAngleAsync (QAngle idegTarget) override |
| Turns chassis to desired angle (turns in the direction of smallest angle) (ex. | |
| void | turnRawAsync (double idegTarget) override |
| This delegates to the input ChassisController. | |
| void | setTurnsMirrored (bool ishouldMirror) override |
| This delegates to the input ChassisController. | |
| bool | isSettled () override |
| This delegates to the input ChassisController. | |
| void | waitUntilSettled () override |
| This delegates to the input ChassisController. | |
| void | stop () override |
| This delegates to the input ChassisController. | |
| void | setMaxVelocity (double imaxVelocity) override |
| This delegates to the input ChassisController. | |
| double | getMaxVelocity () const override |
| This delegates to the input ChassisController. | |
| ChassisScales | getChassisScales () const override |
| This delegates to the input ChassisController. | |
| AbstractMotor::GearsetRatioPair | getGearsetRatioPair () const override |
| This delegates to the input ChassisController. | |
| std::shared_ptr< ChassisModel > | getModel () override |
| This delegates to the input ChassisController. | |
| ChassisModel & | model () override |
| This delegates to the input ChassisController. | |
Public Member Functions inherited from okapi::OdomChassisController | |
| OdomChassisController (TimeUtil itimeUtil, std::shared_ptr< Odometry > iodometry, const StateMode &imode=StateMode::FRAME_TRANSFORMATION, const QLength &imoveThreshold=0_mm, const QAngle &iturnThreshold=0_deg, std::shared_ptr< Logger > ilogger=Logger::getDefaultLogger()) | |
| Odometry based chassis controller. | |
| ~OdomChassisController () override | |
| OdomChassisController (const OdomChassisController &)=delete | |
| OdomChassisController (OdomChassisController &&other)=delete | |
| OdomChassisController & | operator= (const OdomChassisController &other)=delete |
| OdomChassisController & | operator= (OdomChassisController &&other)=delete |
| virtual OdomState | getState () const |
| virtual void | setState (const OdomState &istate) |
| Set a new state to be the current state. | |
| void | setDefaultStateMode (const StateMode &imode) |
| Sets a default StateMode that will be used to interpret target points and query the Odometry state. | |
| virtual void | setMoveThreshold (const QLength &imoveThreshold) |
| Set a new move threshold. | |
| virtual void | setTurnThreshold (const QAngle &iturnTreshold) |
| Set a new turn threshold. | |
| virtual QLength | getMoveThreshold () const |
| virtual QAngle | getTurnThreshold () const |
| void | startOdomThread () |
| Starts the internal odometry thread. | |
| CrossplatformThread * | getOdomThread () const |
| std::shared_ptr< Odometry > | getOdometry () |
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 Member Functions | |
| void | waitForOdomTask () |
Protected Member Functions inherited from okapi::OdomChassisController | |
| void | loop () |
Protected Attributes | |
| std::shared_ptr< Logger > | logger |
| std::shared_ptr< ChassisController > | controller |
Protected Attributes inherited from okapi::OdomChassisController | |
| std::shared_ptr< Logger > | logger |
| TimeUtil | timeUtil |
| QLength | moveThreshold |
| QAngle | turnThreshold |
| std::shared_ptr< Odometry > | odom |
| CrossplatformThread * | odomTask {nullptr} |
| std::atomic_bool | dtorCalled {false} |
| StateMode | defaultStateMode {StateMode::FRAME_TRANSFORMATION} |
| std::atomic_bool | odomTaskRunning {false} |
Additional Inherited Members | |
Static Protected Member Functions inherited from okapi::OdomChassisController | |
| static void | trampoline (void *context) |
Definition at line 15 of file defaultOdomChassisController.hpp.
| okapi::DefaultOdomChassisController::DefaultOdomChassisController | ( | const TimeUtil & | itimeUtil, |
| std::shared_ptr< Odometry > | iodometry, | ||
| std::shared_ptr< ChassisController > | icontroller, | ||
| const StateMode & | imode = StateMode::FRAME_TRANSFORMATION, |
||
| QLength | imoveThreshold = 0_mm, |
||
| QAngle | iturnThreshold = 0_deg, |
||
| std::shared_ptr< Logger > | ilogger = Logger::getDefaultLogger() |
||
| ) |
Odometry based chassis controller that moves using a separately constructed chassis controller.
Spins up a task at the default priority plus 1 for odometry when constructed.
Moves the robot around in the odom frame. Instead of telling the robot to drive forward or turn some amount, you instead tell it to drive to a specific point on the field or turn to a specific angle, relative to its starting position.
| itimeUtil | The TimeUtil. |
| iodometry | The odometry to read state estimates from. |
| icontroller | The chassis controller to delegate to. |
| imode | The new default StateMode used to interpret target points and query the Odometry state. |
| imoveThreshold | minimum length movement (smaller movements will be skipped) |
| iturnThreshold | minimum angle turn (smaller turns will be skipped) |
| ilogger | The logger this instance will log to. |
|
delete |
|
delete |
| ChassisController & okapi::DefaultOdomChassisController::chassisController | ( | ) |
|
overridevirtual |
Drives the robot straight to a point in the odom frame.
| ipoint | The target point to navigate to. |
| ibackwards | Whether to drive to the target point backwards. |
| ioffset | An offset from the target point in the direction pointing towards the robot. The robot will stop this far away from the target point. |
Implements okapi::OdomChassisController.
| std::shared_ptr< ChassisController > okapi::DefaultOdomChassisController::getChassisController | ( | ) |
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
delete |
|
delete |
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
Turns chassis to desired angle (turns in the direction of smallest angle) (ex.
If current angle is 0 and target is 270, the chassis will turn -90 degrees)
| idegTarget | target angle |
Implements okapi::ChassisController.
|
overridevirtual |
Turns chassis to desired angle (turns in the direction of smallest angle) (ex.
If current angle is 0 and target is 270, the chassis will turn -90 degrees)
| idegTarget | target angle |
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::OdomChassisController.
|
overridevirtual |
Turns the robot to face a point in the odom frame.
| ipoint | The target point to turn to face. |
Implements okapi::OdomChassisController.
|
protected |
|
overridevirtual |
This delegates to the input ChassisController.
Implements okapi::ChassisController.
|
protected |
Definition at line 179 of file defaultOdomChassisController.hpp.
|
protected |
Definition at line 178 of file defaultOdomChassisController.hpp.