28 std::shared_ptr<AbstractMotor> itopRightMotor,
29 std::shared_ptr<AbstractMotor> ibottomRightMotor,
30 std::shared_ptr<AbstractMotor> ibottomLeftMotor,
31 std::shared_ptr<ContinuousRotarySensor> ileftEnc,
32 std::shared_ptr<ContinuousRotarySensor> irightEnc,
106 void tank(
double ileftSpeed,
double irightSpeed,
double ithreshold = 0)
override;
115 void arcade(
double iforwardSpeed,
double iyaw,
double ithreshold = 0)
override;
127 void curvature(
double iforwardSpeed,
double icurvature,
double ithreshold = 0)
override;
138 xArcade(
double irightSpeed,
double iforwardSpeed,
double iyaw,
double ithreshold = 0);
159 double ithreshold = 0);
166 void left(
double ispeed)
override;
brakeMode
Indicates the 'brake mode' of a motor.
gearset
Indicates the internal gear ratio of a motor.
encoderUnits
Indicates the units used by the motor encoders.
A version of the ReadOnlyChassisModel that also supports write methods, such as setting motor speed.
XDriveModel(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, double imaxVelocity, double imaxVoltage)
Model for an x drive (wheels at 45 deg from a skid steer drive).
void arcade(double iforwardSpeed, double iyaw, double ithreshold=0) override
Drive the robot with an arcade drive layout.
void strafe(double ipower)
Drive the robot side-ways (using open-loop control) where positive ipower is to the right and negativ...
std::shared_ptr< ContinuousRotarySensor > leftSensor
virtual void fieldOrientedXArcade(double ixSpeed, double iySpeed, double iyaw, QAngle iangle, double ithreshold=0)
Drive the robot with a field-oriented arcade drive layout.
void setBrakeMode(AbstractMotor::brakeMode mode) override
Set the brake mode for each motor.
void driveVectorVoltage(double iforwardSpeed, double iyaw) override
Drive the robot in an arc.
void forward(double ipower) override
Drive the robot forwards (using open-loop control).
void tank(double ileftSpeed, double irightSpeed, double ithreshold=0) override
Drive the robot with a tank drive layout.
void stop() override
Stop the robot (set all the motors to 0).
std::valarray< std::int32_t > getSensorVals() const override
Read the sensors.
double getMaxVoltage() const override
std::shared_ptr< AbstractMotor > bottomRightMotor
void setEncoderUnits(AbstractMotor::encoderUnits units) override
Set the encoder units for each motor.
void curvature(double iforwardSpeed, double icurvature, double ithreshold=0) override
Drive the robot with a curvature drive layout.
void setMaxVoltage(double imaxVoltage) override
Sets a new maximum voltage in mV in the range [0-12000].
std::shared_ptr< AbstractMotor > getTopLeftMotor() const
Returns the top left motor.
std::shared_ptr< AbstractMotor > topLeftMotor
void right(double ispeed) override
Power the right side motors.
std::shared_ptr< AbstractMotor > getBottomLeftMotor() const
Returns the bottom left motor.
double getMaxVelocity() const override
std::shared_ptr< AbstractMotor > getBottomRightMotor() const
Returns the bottom right motor.
void driveVector(double iforwardSpeed, double iyaw) override
Drive the robot in an arc (using open-loop control).
std::shared_ptr< ContinuousRotarySensor > rightSensor
void strafeVector(double istrafeSpeed, double iyaw)
Strafe the robot in an arc (using open-loop control) where positive istrafeSpeed is to the right and ...
void rotate(double ipower) override
Turn the robot clockwise (using open-loop control).
std::shared_ptr< AbstractMotor > getTopRightMotor() const
Returns the top right motor.
std::shared_ptr< AbstractMotor > topRightMotor
std::shared_ptr< AbstractMotor > bottomLeftMotor
virtual void xArcade(double irightSpeed, double iforwardSpeed, double iyaw, double ithreshold=0)
Drive the robot with an arcade drive layout.
void left(double ispeed) override
Power the left side motors.
void resetSensors() override
Reset the sensors to their zero point.
void setGearing(AbstractMotor::gearset gearset) override
Set the gearset for each motor.
void setMaxVelocity(double imaxVelocity) override
Sets a new maximum velocity in RPM.