|
JMotor
|
basic drivetrain controller, supports smoothed movements on each axis More...
#include <JDrivetrainControllerBasic.h>


Public Member Functions | |
| JDrivetrainControllerBasic (JDrivetrain &_drivetrain, JTwoDTransform _velLimit, JTwoDTransform _accelLimit, JTwoDTransform _distError, bool _velNotPosDelta=true) | |
| void | run () |
| run as frequently as possible | |
| void | moveVel (JTwoDTransform _vel, bool _run=false) |
| make drivetrain approach set velocity following acceleration limits | |
| boolean | isDrivetrainAtTarget () |
| are all the drivetrain distance Derivs_Limiters at their position targets? | |
| void | moveDist (JTwoDTransform _dist, bool _run=false) |
| make each axis of the drivetrain go to target position, following accel and vel limits | |
| void | moveDistY (float _y, bool _run=false) |
| void | moveDistTheta (float _theta, bool _run=false) |
| void | moveDistX (float _x, bool _run=false) |
| void | moveDistInc (JTwoDTransform _d, bool _run=false) |
| void | moveDistYInc (float _y, bool _run=false) |
| void | moveDistThetaInc (float _theta, bool _run=false) |
| void | moveDistXInc (float _x, bool _run=false) |
| bool | isVelZero () |
| bool | getDistMode () |
| true if going to distance target, false if velocity based | |
| bool | getIsControlled () |
| true=velocity and acceleration is limited, false=writing directly to drivetrain | |
| JTwoDTransform | getDistTarget () |
| void | setVelLimit (JTwoDTransform _velLim) |
| void | setAccelLimit (JTwoDTransform _accelLim) |
| JTwoDTransform | getVelLimit () |
| JTwoDTransform | getAccelLimit () |
| void | setVelLimitY (float l) |
| void | setVelLimitX (float l) |
| void | setVelLimitTheta (float l) |
| void | setAccelLimitY (float l) |
| void | setAccelLimitX (float l) |
| void | setAccelLimitTheta (float l) |
| void | setVelNotPosDelta (bool _velNotPosDelta) |
| true = uses setVel() when setting drivetrain velocity, false = uses setPosDelta() when setting drivetrain velocity | |
| void | setVel (JTwoDTransform _vel, bool _run=false) |
| sets drivetrain velocity immediately | |
| void | setDistSetpoint (JTwoDTransform _dist, bool _run=false) |
| void | setDistDelta (JTwoDTransform _dist, bool _run=false) |
| void | resetDist () |
| JTwoDTransform | getVel (bool _run=false) |
| JTwoDTransform | getDist (bool _run=false) |
| JTwoDTransform | getDistSetpoint () |
| returns what distances are being set as the setpoints for each axis of the drivetrain | |
| 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 () |
| 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) | |
Public Attributes | |
| JDrivetrain & | drivetrain |
| Derivs_Limiter | XLimiter |
| Derivs_Limiter | YLimiter |
| Derivs_Limiter | ThetaLimiter |
| JTwoDTransform | distError |
Protected Attributes | |
| bool | controlled |
| bool | distMode |
| unsigned long | lastCalcMillis |
| JTwoDTransform | velTarget |
| bool | velNotPosDelta |
basic drivetrain controller, supports smoothed movements on each axis
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inline |
true if going to distance target, false if velocity based
| bool |
|
inline |
returns what distances are being set as the setpoints for each axis of the drivetrain
| (JTwoDTransform) |
|
inline |
|
inlinevirtual |
gets the current state (enabled or disabled)
| (bool) | true=enabled false=movement disabled |
Implements JDrivetrainBasic.
|
inline |
true=velocity and acceleration is limited, false=writing directly to drivetrain
| (bool) |
|
inlinevirtual |
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.
| (JTwoDTransform) | maximum velocity (in whatever units your drivetrain and motors are set up for) |
Implements JDrivetrainBasic.
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inline |
|
inline |
are all the drivetrain distance Derivs_Limiters at their position targets?
| boolean |
|
inline |
|
inline |
make each axis of the drivetrain go to target position, following accel and vel limits
| _dist | (JTwoDTransform) target distance |
| _run | (bool) default=false, true=run gets called within this function, false=call run yourself outside this function |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
make drivetrain approach set velocity following acceleration limits
| _vel | (JTwoDTransform) target velocity |
| _run | (bool) default=false, true=run gets called within this function, false=call run yourself outside this function |
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
run as frequently as possible
Implements JDrivetrainBasic.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
enables or disables movement
| _enable | (bool) true=enabled false=movement disabled |
| did | the state change |
Implements JDrivetrainBasic.
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
sets drivetrain velocity immediately
| _vel | JTwoDTransform of velocity wanted for drivetrain |
| _run | (bool) default=false, true=run gets called within this function, false=call run yourself outside this function |
| None |
Implements JDrivetrainBasic.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
true = uses setVel() when setting drivetrain velocity, false = uses setPosDelta() when setting drivetrain velocity
| _velNotPosDelta | (bool) |
|
protected |
| JTwoDTransform JDrivetrainControllerBasic::distError |
|
protected |
| JDrivetrain& JDrivetrainControllerBasic::drivetrain |
|
protected |
| Derivs_Limiter JDrivetrainControllerBasic::ThetaLimiter |
|
protected |
|
protected |
| Derivs_Limiter JDrivetrainControllerBasic::XLimiter |
| Derivs_Limiter JDrivetrainControllerBasic::YLimiter |