LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::ChassisController Class Referenceabstract

#include <chassisController.hpp>

Inheritance diagram for okapi::ChassisController:
okapi::ChassisControllerIntegrated okapi::ChassisControllerPID okapi::OdomChassisController okapi::DefaultOdomChassisController

Public Member Functions

 ChassisController ()=default
 A ChassisController adds a closed-loop layer on top of a ChassisModel.
 
virtual ~ChassisController ()=default
 
virtual void moveDistance (QLength itarget)=0
 Drives the robot straight for a distance (using closed-loop control).
 
virtual void moveRaw (double itarget)=0
 Drives the robot straight for a distance (using closed-loop control).
 
virtual void moveDistanceAsync (QLength itarget)=0
 Sets the target distance for the robot to drive straight (using closed-loop control).
 
virtual void moveRawAsync (double itarget)=0
 Sets the target distance for the robot to drive straight (using closed-loop control).
 
virtual void turnAngle (QAngle idegTarget)=0
 Turns the robot clockwise in place (using closed-loop control).
 
virtual void turnRaw (double idegTarget)=0
 Turns the robot clockwise in place (using closed-loop control).
 
virtual void turnAngleAsync (QAngle idegTarget)=0
 Sets the target angle for the robot to turn clockwise in place (using closed-loop control).
 
virtual void turnRawAsync (double idegTarget)=0
 Sets the target angle for the robot to turn clockwise in place (using closed-loop control).
 
virtual void setTurnsMirrored (bool ishouldMirror)=0
 Sets whether turns should be mirrored.
 
virtual bool isSettled ()=0
 Checks whether the internal controllers are currently settled.
 
virtual void waitUntilSettled ()=0
 Delays until the currently executing movement completes.
 
virtual void stop ()=0
 Interrupts the current movement to stop the robot.
 
virtual void setMaxVelocity (double imaxVelocity)=0
 Sets a new maximum velocity in RPM [0-600].
 
virtual double getMaxVelocity () const =0
 
virtual ChassisScales getChassisScales () const =0
 Get the ChassisScales.
 
virtual AbstractMotor::GearsetRatioPair getGearsetRatioPair () const =0
 Get the GearsetRatioPair.
 
virtual std::shared_ptr< ChassisModelgetModel ()=0
 
virtual ChassisModelmodel ()=0
 

Detailed Description

Definition at line 17 of file chassisController.hpp.

Constructor & Destructor Documentation

◆ ChassisController()

okapi::ChassisController::ChassisController ( )
explicitdefault

A ChassisController adds a closed-loop layer on top of a ChassisModel.

moveDistance and turnAngle both use closed-loop control to move the robot. There are passthrough functions for everything defined in ChassisModel.

Parameters
imodelunderlying ChassisModel

◆ ~ChassisController()

virtual okapi::ChassisController::~ChassisController ( )
virtualdefault

Member Function Documentation

◆ getChassisScales()

virtual ChassisScales okapi::ChassisController::getChassisScales ( ) const
pure virtual

◆ getGearsetRatioPair()

virtual AbstractMotor::GearsetRatioPair okapi::ChassisController::getGearsetRatioPair ( ) const
pure virtual

◆ getMaxVelocity()

virtual double okapi::ChassisController::getMaxVelocity ( ) const
pure virtual
Returns
The maximum velocity in RPM [0-600].

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ getModel()

virtual std::shared_ptr< ChassisModel > okapi::ChassisController::getModel ( )
pure virtual

◆ isSettled()

virtual bool okapi::ChassisController::isSettled ( )
pure virtual

Checks whether the internal controllers are currently settled.

Returns
Whether this ChassisController is settled.

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ model()

virtual ChassisModel & okapi::ChassisController::model ( )
pure virtual

◆ moveDistance()

virtual void okapi::ChassisController::moveDistance ( QLength  itarget)
pure virtual

Drives the robot straight for a distance (using closed-loop control).

Parameters
itargetdistance to travel

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ moveDistanceAsync()

virtual void okapi::ChassisController::moveDistanceAsync ( QLength  itarget)
pure virtual

Sets the target distance for the robot to drive straight (using closed-loop control).

Parameters
itargetdistance to travel

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ moveRaw()

virtual void okapi::ChassisController::moveRaw ( double  itarget)
pure virtual

Drives the robot straight for a distance (using closed-loop control).

Parameters
itargetdistance to travel in motor degrees

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ moveRawAsync()

virtual void okapi::ChassisController::moveRawAsync ( double  itarget)
pure virtual

Sets the target distance for the robot to drive straight (using closed-loop control).

Parameters
itargetdistance to travel in motor degrees

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ setMaxVelocity()

virtual void okapi::ChassisController::setMaxVelocity ( double  imaxVelocity)
pure virtual

Sets a new maximum velocity in RPM [0-600].

Parameters
imaxVelocityThe new maximum velocity.

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ setTurnsMirrored()

virtual void okapi::ChassisController::setTurnsMirrored ( bool  ishouldMirror)
pure virtual

Sets whether turns should be mirrored.

Parameters
ishouldMirrorwhether turns should be mirrored

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ stop()

virtual void okapi::ChassisController::stop ( )
pure virtual

Interrupts the current movement to stop the robot.

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ turnAngle()

virtual void okapi::ChassisController::turnAngle ( QAngle  idegTarget)
pure virtual

Turns the robot clockwise in place (using closed-loop control).

Parameters
idegTargetangle to turn for

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ turnAngleAsync()

virtual void okapi::ChassisController::turnAngleAsync ( QAngle  idegTarget)
pure virtual

Sets the target angle for the robot to turn clockwise in place (using closed-loop control).

Parameters
idegTargetangle to turn for

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ turnRaw()

virtual void okapi::ChassisController::turnRaw ( double  idegTarget)
pure virtual

Turns the robot clockwise in place (using closed-loop control).

Parameters
idegTargetangle to turn for in motor degrees

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ turnRawAsync()

virtual void okapi::ChassisController::turnRawAsync ( double  idegTarget)
pure virtual

Sets the target angle for the robot to turn clockwise in place (using closed-loop control).

Parameters
idegTargetangle to turn for in motor degrees

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.

◆ waitUntilSettled()

virtual void okapi::ChassisController::waitUntilSettled ( )
pure virtual

Delays until the currently executing movement completes.

Implemented in okapi::ChassisControllerIntegrated, okapi::ChassisControllerPID, and okapi::DefaultOdomChassisController.


The documentation for this class was generated from the following file: