okapi::ThreeEncoderSkidSteerModel class

Base classes

class SkidSteerModel

Constructors, destructors, conversion operators

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).

Public functions

auto getSensorVals() const -> std::valarray<std::int32_t> override
Read the sensors.
void resetSensors() override
Reset the sensors to their zero point.

Protected variables

std::shared_ptr<ContinuousRotarySensor> middleSensor

Function documentation

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).

Parameters
ileftSideMotor left side motor
irightSideMotor right side motor
ileftEnc left side encoder
irightEnc right side encoder
imiddleEnc middle encoder (mounted perpendicular to the left and right side encoders)
imaxVelocity
imaxVoltage

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

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

Read the sensors.

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