okapi::ChassisController class

Derived classes

class ChassisControllerIntegrated
class ChassisControllerPID
class OdomChassisController

Constructors, destructors, conversion operators

ChassisController() defaulted explicit
A ChassisController adds a closed-loop layer on top of a ChassisModel.
~ChassisController() defaulted virtual

Public functions

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

Function documentation

okapi::ChassisController::ChassisController() explicit defaulted

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.

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

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

Parameters
itarget distance to travel

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

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

Parameters
itarget distance to travel in motor degrees

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

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

Parameters
itarget distance to travel

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

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

Parameters
itarget distance to travel in motor degrees

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

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

Parameters
idegTarget angle to turn for

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

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

Parameters
idegTarget angle to turn for in motor degrees

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
idegTarget angle to turn for

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
idegTarget angle to turn for in motor degrees

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

Sets whether turns should be mirrored.

Parameters
ishouldMirror whether turns should be mirrored

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

Checks whether the internal controllers are currently settled.

Returns Whether this ChassisController is settled.

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

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

Parameters
imaxVelocity The new maximum velocity.

double okapi::ChassisController::getMaxVelocity() const pure virtual

Returns The maximum velocity in RPM [0-600].

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

Returns The internal ChassisModel.

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

Returns The internal ChassisModel.