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

#include <threeEncoderSkidSteerModel.hpp>

Inheritance diagram for okapi::ThreeEncoderSkidSteerModel:
okapi::SkidSteerModel okapi::ChassisModel okapi::ReadOnlyChassisModel

Public Member Functions

 ThreeEncoderSkidSteerModel (std::shared_ptr< AbstractMotor > ileftSideMotor, std::shared_ptr< AbstractMotor > irightSideMotor, std::shared_ptr< ContinuousRotarySensor > ileftEnc, std::shared_ptr< ContinuousRotarySensor > irightEnc, std::shared_ptr< ContinuousRotarySensor > imiddleEnc, double imaxVelocity, double imaxVoltage)
 Model for a skid steer drive (wheels parallel with robot's direction of motion).
 
std::valarray< std::int32_t > getSensorVals () const override
 Read the sensors.
 
void resetSensors () override
 Reset the sensors to their zero point.
 
- Public Member Functions inherited from okapi::SkidSteerModel
 SkidSteerModel (std::shared_ptr< AbstractMotor > ileftSideMotor, std::shared_ptr< AbstractMotor > irightSideMotor, std::shared_ptr< ContinuousRotarySensor > ileftEnc, std::shared_ptr< ContinuousRotarySensor > irightEnc, double imaxVelocity, double imaxVoltage)
 Model for a skid steer drive (wheels parallel with robot's direction of motion).
 
void forward (double ispeed) override
 Drive the robot forwards (using open-loop control).
 
void driveVector (double iySpeed, double izRotation) override
 Drive the robot in an arc (using open-loop control).
 
void driveVectorVoltage (double iforwardSpeed, double iyaw) override
 Drive the robot in an arc.
 
void rotate (double ispeed) override
 Turn the robot clockwise (using open-loop control).
 
void stop () override
 Stop the robot (set all the motors to 0).
 
void tank (double ileftSpeed, double irightSpeed, double ithreshold=0) override
 Drive the robot with a tank drive layout.
 
void arcade (double iforwardSpeed, double iyaw, double ithreshold=0) override
 Drive the robot with an arcade drive layout.
 
void curvature (double iforwardSpeed, double icurvature, double ithreshold=0) override
 Drive the robot with a curvature drive layout.
 
void left (double ispeed) override
 Power the left side motors.
 
void right (double ispeed) override
 Power the right side motors.
 
void setBrakeMode (AbstractMotor::brakeMode mode) override
 Set the brake mode for each motor.
 
void setEncoderUnits (AbstractMotor::encoderUnits units) override
 Set the encoder units for each motor.
 
void setGearing (AbstractMotor::gearset gearset) override
 Set the gearset for each motor.
 
void setMaxVelocity (double imaxVelocity) override
 Sets a new maximum velocity in RPM.
 
double getMaxVelocity () const override
 
void setMaxVoltage (double imaxVoltage) override
 Sets a new maximum voltage in mV in the range [0-12000].
 
double getMaxVoltage () const override
 
std::shared_ptr< AbstractMotorgetLeftSideMotor () const
 Returns the left side motor.
 
std::shared_ptr< AbstractMotorgetRightSideMotor () const
 Returns the left side motor.
 
- Public Member Functions inherited from okapi::ChassisModel
 ChassisModel ()=default
 
 ChassisModel (const ChassisModel &)=delete
 
ChassisModeloperator= (const ChassisModel &)=delete
 
- Public Member Functions inherited from okapi::ReadOnlyChassisModel
virtual ~ReadOnlyChassisModel ()=default
 

Protected Attributes

std::shared_ptr< ContinuousRotarySensormiddleSensor
 
- Protected Attributes inherited from okapi::SkidSteerModel
double maxVelocity
 
double maxVoltage
 
std::shared_ptr< AbstractMotorleftSideMotor
 
std::shared_ptr< AbstractMotorrightSideMotor
 
std::shared_ptr< ContinuousRotarySensorleftSensor
 
std::shared_ptr< ContinuousRotarySensorrightSensor
 

Detailed Description

Definition at line 11 of file threeEncoderSkidSteerModel.hpp.

Constructor & Destructor Documentation

◆ ThreeEncoderSkidSteerModel()

okapi::ThreeEncoderSkidSteerModel::ThreeEncoderSkidSteerModel ( std::shared_ptr< AbstractMotor ileftSideMotor,
std::shared_ptr< AbstractMotor irightSideMotor,
std::shared_ptr< ContinuousRotarySensor ileftEnc,
std::shared_ptr< ContinuousRotarySensor irightEnc,
std::shared_ptr< ContinuousRotarySensor imiddleEnc,
double  imaxVelocity,
double  imaxVoltage 
)

Model for a skid steer drive (wheels parallel with robot's direction of motion).

When all motors are powered +127, the robot should move forward in a straight line.

Parameters
ileftSideMotorleft side motor
irightSideMotorright side motor
ileftEncleft side encoder
imiddleEncmiddle encoder (mounted perpendicular to the left and right side encoders)
irightEncright side encoder

Member Function Documentation

◆ getSensorVals()

std::valarray< std::int32_t > okapi::ThreeEncoderSkidSteerModel::getSensorVals ( ) const
overridevirtual

Read the sensors.

Returns
sensor readings in the format {left, right, middle}

Reimplemented from okapi::SkidSteerModel.

◆ resetSensors()

void okapi::ThreeEncoderSkidSteerModel::resetSensors ( )
overridevirtual

Reset the sensors to their zero point.

Reimplemented from okapi::SkidSteerModel.

Member Data Documentation

◆ middleSensor

std::shared_ptr<ContinuousRotarySensor> okapi::ThreeEncoderSkidSteerModel::middleSensor
protected

Definition at line 44 of file threeEncoderSkidSteerModel.hpp.


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