|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
A version of the ReadOnlyChassisModel that also supports write methods, such as setting motor speed. More...
#include <chassisModel.hpp>
Public Member Functions | |
| ChassisModel ()=default | |
| ChassisModel (const ChassisModel &)=delete | |
| ChassisModel & | operator= (const ChassisModel &)=delete |
| virtual void | forward (double ispeed)=0 |
| Drive the robot forwards (using open-loop control). | |
| virtual void | driveVector (double iforwardSpeed, double iyaw)=0 |
| Drive the robot in an arc (using open-loop control). | |
| virtual void | driveVectorVoltage (double iforwardSpeed, double iyaw)=0 |
| Drive the robot in an arc. | |
| virtual void | rotate (double ispeed)=0 |
| Turn the robot clockwise (using open-loop control). | |
| virtual void | stop ()=0 |
| Stop the robot (set all the motors to 0). | |
| virtual void | tank (double ileftSpeed, double irightSpeed, double ithreshold=0)=0 |
| Drive the robot with a tank drive layout. | |
| virtual void | arcade (double iforwardSpeed, double iyaw, double ithreshold=0)=0 |
| Drive the robot with an arcade drive layout. | |
| virtual void | curvature (double iforwardSpeed, double icurvature, double ithreshold=0)=0 |
| Drive the robot with a curvature drive layout. | |
| virtual void | left (double ispeed)=0 |
| Power the left side motors. | |
| virtual void | right (double ispeed)=0 |
| Power the right side motors. | |
| virtual void | resetSensors ()=0 |
| Reset the sensors to their zero point. | |
| virtual void | setBrakeMode (AbstractMotor::brakeMode mode)=0 |
| Set the brake mode for each motor. | |
| virtual void | setEncoderUnits (AbstractMotor::encoderUnits units)=0 |
| Set the encoder units for each motor. | |
| virtual void | setGearing (AbstractMotor::gearset gearset)=0 |
| Set the gearset for each motor. | |
| virtual void | setMaxVelocity (double imaxVelocity)=0 |
| Sets a new maximum velocity in RPM. | |
| virtual double | getMaxVelocity () const =0 |
| virtual void | setMaxVoltage (double imaxVoltage)=0 |
Sets a new maximum voltage in mV in the range [0-12000]. | |
| virtual double | getMaxVoltage () const =0 |
Public Member Functions inherited from okapi::ReadOnlyChassisModel | |
| virtual | ~ReadOnlyChassisModel ()=default |
| virtual std::valarray< std::int32_t > | getSensorVals () const =0 |
| Read the sensors. | |
A version of the ReadOnlyChassisModel that also supports write methods, such as setting motor speed.
Because this class can write to motors, there can only be one owner and as such copying is disabled.
Definition at line 21 of file chassisModel.hpp.
|
explicitdefault |
|
delete |
|
pure virtual |
Drive the robot with an arcade drive layout.
Uses voltage mode.
| iforwardSpeed | speed forward direction |
| iyaw | speed around the vertical axis |
| ithreshold | deadband on joystick values |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
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 |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Drive the robot in an arc (using open-loop control).
Uses velocity mode. The algorithm is (approximately): leftPower = forwardSpeed + yaw rightPower = forwardSpeed - yaw
| iforwadSpeed | speed in the forward direction |
| iyaw | speed around the vertical axis |
Implemented in okapi::XDriveModel, okapi::HDriveModel, and okapi::SkidSteerModel.
|
pure virtual |
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 |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Drive the robot forwards (using open-loop control).
Uses velocity mode.
| ipower | motor power |
Implemented in okapi::XDriveModel, okapi::HDriveModel, and okapi::SkidSteerModel.
|
pure virtual |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
[0-12000]. Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Power the left side motors.
Uses velocity mode.
| ipower | motor power |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
delete |
|
pure virtual |
Reset the sensors to their zero point.
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, okapi::ThreeEncoderSkidSteerModel, okapi::ThreeEncoderXDriveModel, and okapi::XDriveModel.
|
pure virtual |
Power the right side motors.
Uses velocity mode.
| ipower | motor power |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Turn the robot clockwise (using open-loop control).
Uses velocity mode.
| ispeed | motor power |
Implemented in okapi::XDriveModel, okapi::HDriveModel, and okapi::SkidSteerModel.
|
pure virtual |
Set the brake mode for each motor.
| mode | new brake mode |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Set the encoder units for each motor.
| units | new motor encoder units |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Set the gearset for each motor.
| gearset | new motor gearset |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
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. |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Sets a new maximum voltage in mV in the range [0-12000].
| imaxVoltage | The new maximum voltage. |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Stop the robot (set all the motors to 0).
Uses velocity mode.
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.
|
pure virtual |
Drive the robot with a tank drive layout.
Uses voltage mode.
| ileftSpeed | left side speed |
| irightSpeed | right side speed |
| ithreshold | deadband on joystick values |
Implemented in okapi::HDriveModel, okapi::SkidSteerModel, and okapi::XDriveModel.