child class of JDrivetrain for controlling a drivetrain with one JMotorController for each side of the drivetrain
More...
#include <JDrivetrainTwoSide.h>
|
| JDrivetrainTwoSide (JMotorController &_left, JMotorController &_right, float _width) |
|
void | run () |
| call this in loop. it calls any encoder or motor update functions
|
|
bool | setEnable (bool _enable) |
| enables or disables movement
|
|
bool | enable () |
| enables movement
|
|
bool | disable () |
| disables movement
|
|
bool | getEnable () |
| gets the current state (enabled or disabled)
|
|
JTwoDTransform | getVel (bool _run=false) |
|
JTwoDTransform | getDist (bool _run=false) |
|
void | setVel (JTwoDTransform _vel, bool _run=false) |
| sets a velocity for the drivetrain to move at
|
|
void | setDistSetpoint (JTwoDTransform _dist, bool _run=false) |
|
void | setDistDelta (JTwoDTransform _dist, bool _run=false) |
|
void | resetDist () |
|
JTwoDTransform | getMaxVel () |
| returns the approximate maximum velocity of the drivetrain, if the drivetrain is told to move at max velocity, it should set the motors to full power.
|
|
float | getMotorVel (unsigned char i) |
|
void | setMotorVel (float vel, unsigned char i, bool _run=false) |
|
void | setMotorDistSetpoint (float distSetpoint, unsigned char i, bool _run=false) |
|
void | setMotorDistDelta (float distDelta, unsigned char i, bool _run=false) |
|
unsigned char | getNumberMotors () |
|
float | getWidth () |
|
void | setWidth (float _width) |
|
child class of JDrivetrain for controlling a drivetrain with one JMotorController for each side of the drivetrain
- Note
- both sides should move forward when the controllers are given a positive speed
◆ JDrivetrainTwoSide()
◆ disable()
bool JDrivetrainTwoSide::disable |
( |
| ) |
|
|
inlinevirtual |
◆ enable()
bool JDrivetrainTwoSide::enable |
( |
| ) |
|
|
inlinevirtual |
◆ getDist()
◆ getEnable()
bool JDrivetrainTwoSide::getEnable |
( |
| ) |
|
|
inlinevirtual |
gets the current state (enabled or disabled)
- Return values
-
(bool) | true=enabled false=movement disabled |
Implements JDrivetrainBasic.
◆ getMaxVel()
returns the approximate maximum velocity of the drivetrain, if the drivetrain is told to move at max velocity, it should set the motors to full power.
- Note
- depends on how well calibrated the motor compensators are
- Return values
-
(JTwoDTransform) | maximum velocity (in whatever units your drivetrain and motors are set up for) |
Implements JDrivetrainBasic.
◆ getMotorVel()
float JDrivetrainTwoSide::getMotorVel |
( |
unsigned char |
i | ) |
|
|
inlinevirtual |
◆ getNumberMotors()
unsigned char JDrivetrainTwoSide::getNumberMotors |
( |
| ) |
|
|
inlinevirtual |
◆ getVel()
◆ getWidth()
float JDrivetrainTwoSide::getWidth |
( |
| ) |
|
|
inline |
◆ resetDist()
void JDrivetrainTwoSide::resetDist |
( |
| ) |
|
|
inlinevirtual |
◆ run()
void JDrivetrainTwoSide::run |
( |
| ) |
|
|
inlinevirtual |
call this in loop. it calls any encoder or motor update functions
Implements JDrivetrainBasic.
◆ setDistDelta()
void JDrivetrainTwoSide::setDistDelta |
( |
JTwoDTransform |
_dist, |
|
|
bool |
_run = false |
|
) |
| |
|
inlinevirtual |
◆ setDistSetpoint()
void JDrivetrainTwoSide::setDistSetpoint |
( |
JTwoDTransform |
_dist, |
|
|
bool |
_run = false |
|
) |
| |
|
inlinevirtual |
◆ setEnable()
bool JDrivetrainTwoSide::setEnable |
( |
bool |
_enable | ) |
|
|
inlinevirtual |
enables or disables movement
- Parameters
-
_enable | (bool) true=enabled false=movement disabled |
- Return values
-
Implements JDrivetrainBasic.
◆ setMotorDistDelta()
void JDrivetrainTwoSide::setMotorDistDelta |
( |
float |
distDelta, |
|
|
unsigned char |
i, |
|
|
bool |
_run = false |
|
) |
| |
|
inlinevirtual |
◆ setMotorDistSetpoint()
void JDrivetrainTwoSide::setMotorDistSetpoint |
( |
float |
distSetpoint, |
|
|
unsigned char |
i, |
|
|
bool |
_run = false |
|
) |
| |
|
inlinevirtual |
◆ setMotorVel()
void JDrivetrainTwoSide::setMotorVel |
( |
float |
vel, |
|
|
unsigned char |
i, |
|
|
bool |
_run = false |
|
) |
| |
|
inlinevirtual |
◆ setVel()
void JDrivetrainTwoSide::setVel |
( |
JTwoDTransform |
_vel, |
|
|
bool |
_run = false |
|
) |
| |
|
inlinevirtual |
sets a velocity for the drivetrain to move at
- Parameters
-
_vel | (JTwoDTransform) velocity to move at |
_run | (bool, default=true) if true setVel will call run() for you, if false you must call it yourself |
- Return values
-
Implements JDrivetrainBasic.
◆ setWidth()
void JDrivetrainTwoSide::setWidth |
( |
float |
_width | ) |
|
|
inline |
◆ dist
◆ left
◆ leftDist
float JDrivetrainTwoSide::leftDist |
|
protected |
◆ leftVel
float JDrivetrainTwoSide::leftVel |
|
protected |
◆ maxVel
◆ right
◆ rightDist
float JDrivetrainTwoSide::rightDist |
|
protected |
◆ rightVel
float JDrivetrainTwoSide::rightVel |
|
protected |
◆ vel
◆ width
float JDrivetrainTwoSide::width |
|
protected |
The documentation for this class was generated from the following file: