okapi::ThreeEncoderXDriveModel class

Base classes

class XDriveModel

Constructors, destructors, conversion operators

ThreeEncoderXDriveModel(std::shared_ptr<AbstractMotor> itopLeftMotor, std::shared_ptr<AbstractMotor> itopRightMotor, std::shared_ptr<AbstractMotor> ibottomRightMotor, std::shared_ptr<AbstractMotor> ibottomLeftMotor, std::shared_ptr<ContinuousRotarySensor> ileftEnc, std::shared_ptr<ContinuousRotarySensor> irightEnc, std::shared_ptr<ContinuousRotarySensor> imiddleEnc, double imaxVelocity, double imaxVoltage)
Model for an x drive (wheels at 45 deg from a skid steer drive).

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::ThreeEncoderXDriveModel::ThreeEncoderXDriveModel(std::shared_ptr<AbstractMotor> itopLeftMotor, std::shared_ptr<AbstractMotor> itopRightMotor, std::shared_ptr<AbstractMotor> ibottomRightMotor, std::shared_ptr<AbstractMotor> ibottomLeftMotor, std::shared_ptr<ContinuousRotarySensor> ileftEnc, std::shared_ptr<ContinuousRotarySensor> irightEnc, std::shared_ptr<ContinuousRotarySensor> imiddleEnc, double imaxVelocity, double imaxVoltage)

Model for an x drive (wheels at 45 deg from a skid steer drive).

Parameters
itopLeftMotor The top left motor.
itopRightMotor The top right motor.
ibottomRightMotor The bottom right motor.
ibottomLeftMotor The bottom left motor.
ileftEnc The left side encoder.
irightEnc The right side encoder.
imiddleEnc The middle encoder.
imaxVelocity
imaxVoltage

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

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

Read the sensors.

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