|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
#include <skidSteerModel.hpp>
Public Member Functions | |
| 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. | |
| std::valarray< std::int32_t > | getSensorVals () const override |
| Read the sensors. | |
| void | resetSensors () override |
| Reset the sensors to their zero point. | |
| 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< AbstractMotor > | getLeftSideMotor () const |
| Returns the left side motor. | |
| std::shared_ptr< AbstractMotor > | getRightSideMotor () const |
| Returns the left side motor. | |
Public Member Functions inherited from okapi::ChassisModel | |
| ChassisModel ()=default | |
| ChassisModel (const ChassisModel &)=delete | |
| ChassisModel & | operator= (const ChassisModel &)=delete |
Public Member Functions inherited from okapi::ReadOnlyChassisModel | |
| virtual | ~ReadOnlyChassisModel ()=default |
Protected Attributes | |
| double | maxVelocity |
| double | maxVoltage |
| std::shared_ptr< AbstractMotor > | leftSideMotor |
| std::shared_ptr< AbstractMotor > | rightSideMotor |
| std::shared_ptr< ContinuousRotarySensor > | leftSensor |
| std::shared_ptr< ContinuousRotarySensor > | rightSensor |
Definition at line 13 of file skidSteerModel.hpp.
| 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).
When all motors are powered +100%, the robot should move forward in a straight line.
| ileftSideMotor | The left side motor. |
| irightSideMotor | The right side motor. |
| ileftEnc | The left side encoder. |
| irightEnc | The right side encoder. |
|
overridevirtual |
Drive the robot with an arcade drive layout.
Uses voltage mode.
| iforwardSpeed | speed in the forward direction |
| iyaw | speed around the vertical axis |
| ithreshold | deadband on joystick values |
Implements okapi::ChassisModel.
|
overridevirtual |
Drive the robot with a curvature drive layout.
The robot drives in constant radius turns where you control the curvature (inverse of radius) you drive in. This is advantageous because the forward speed will not affect the rate of turning. The algorithm switches to arcade if the forward speed is 0. Uses voltage mode.
| iforwardSpeed | speed in the forward direction |
| icurvature | curvature (inverse of radius) to drive in |
| ithreshold | deadband on joystick values |
Implements okapi::ChassisModel.
|
overridevirtual |
Drive the robot in an arc (using open-loop control).
Uses velocity mode. The algorithm is (approximately): leftPower = ySpeed + zRotation rightPower = ySpeed - zRotation
| iySpeed | speed on y axis (forward) |
| izRotation | speed around z axis (up) |
Implements okapi::ChassisModel.
|
overridevirtual |
Drive the robot in an arc.
Uses voltage mode. The algorithm is (approximately): leftPower = forwardSpeed + yaw rightPower = forwardSpeed - yaw
| iforwadSpeed | speed in the forward direction |
| iyaw | speed around the vertical axis |
Implements okapi::ChassisModel.
|
overridevirtual |
Drive the robot forwards (using open-loop control).
Uses velocity mode.
| ispeed | motor power |
Implements okapi::ChassisModel.
| std::shared_ptr< AbstractMotor > okapi::SkidSteerModel::getLeftSideMotor | ( | ) | const |
Returns the left side motor.
|
overridevirtual |
Implements okapi::ChassisModel.
|
overridevirtual |
[0-12000]. Implements okapi::ChassisModel.
| std::shared_ptr< AbstractMotor > okapi::SkidSteerModel::getRightSideMotor | ( | ) | const |
Returns the left side motor.
|
overridevirtual |
Read the sensors.
Implements okapi::ReadOnlyChassisModel.
Reimplemented in okapi::ThreeEncoderSkidSteerModel.
|
overridevirtual |
Power the left side motors.
Uses velocity mode.
| ispeed | The motor power. |
Implements okapi::ChassisModel.
|
overridevirtual |
Reset the sensors to their zero point.
Implements okapi::ChassisModel.
Reimplemented in okapi::ThreeEncoderSkidSteerModel.
|
overridevirtual |
Power the right side motors.
Uses velocity mode.
| ispeed | The motor power. |
Implements okapi::ChassisModel.
|
overridevirtual |
Turn the robot clockwise (using open-loop control).
Uses velocity mode.
| ispeed | motor power |
Implements okapi::ChassisModel.
|
overridevirtual |
|
overridevirtual |
Set the encoder units for each motor.
| units | new motor encoder units |
Implements okapi::ChassisModel.
|
overridevirtual |
|
overridevirtual |
Sets a new maximum velocity in RPM.
The usable maximum depends on the maximum velocity of the currently installed gearset. If the configured maximum velocity is greater than the attainable maximum velocity from the currently installed gearset, the ChassisModel will still scale to that velocity.
| imaxVelocity | The new maximum velocity. |
Implements okapi::ChassisModel.
|
overridevirtual |
Sets a new maximum voltage in mV in the range [0-12000].
| imaxVoltage | The new maximum voltage. |
Implements okapi::ChassisModel.
|
overridevirtual |
|
overridevirtual |
Drive the robot with a tank drive layout.
Uses voltage mode.
| ileftSpeed | left side speed |
| irightSpeed | right side speed |
| ithreshold | deadband on joystick values |
Implements okapi::ChassisModel.
|
protected |
Definition at line 195 of file skidSteerModel.hpp.
|
protected |
Definition at line 193 of file skidSteerModel.hpp.
|
protected |
Definition at line 191 of file skidSteerModel.hpp.
|
protected |
Definition at line 192 of file skidSteerModel.hpp.
|
protected |
Definition at line 196 of file skidSteerModel.hpp.
|
protected |
Definition at line 194 of file skidSteerModel.hpp.