|
JMotor
|
interface for a drivetrain that makes it into field oriented More...
#include <JDrivetrainFieldOriented.h>


Public Member Functions | |
| JDrivetrainFieldOriented (JDrivetrain &_drivetrain) | |
| float | getHeading () |
| void | giveHeading (float _heading) |
| 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) | |
| void | setVel (JTwoDTransform _vel, bool _run=false) |
| sets a velocity for the drivetrain to move at | |
| 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. | |
| JTwoDTransform | getVel (bool _run=false) |
| JTwoDTransform | getDist (bool _run=false) |
| void | setDistSetpoint (JTwoDTransform _dist, bool _run=false) |
| void | setDistDelta (JTwoDTransform _dist, bool _run=false) |
| void | resetDist () |
| void | setMotorVel (float vel, unsigned char i, bool _run=false) |
| float | getMotorVel (unsigned char i) |
| void | setMotorDistSetpoint (float distSetpoint, unsigned char i, bool _run=false) |
| void | setMotorDistDelta (float distDelta, unsigned char i, bool _run=false) |
| unsigned char | getNumberMotors () |
Protected Attributes | |
| JDrivetrain & | drivetrain |
| float | imuHeading = 0 |
| float | imuHeadingOffset = 0 |
| float | lastImuHeading = 0 |
| float | theta = 0 |
| int | fullRotations = 0 |
| JTwoDTransform | dist = { 0, 0, 0 } |
| JTwoDTransform | lastDrivetrainDist = { 0, 0, 0 } |
interface for a drivetrain that makes it into field oriented
/ TODO: NOT DONE YET* //TODO: COMMENT
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
gets the current state (enabled or disabled)
| (bool) | true=enabled false=movement disabled |
Implements JDrivetrainBasic.
|
inline |
|
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 |
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
call this in loop. it calls any encoder or motor update functions
Implements JDrivetrainBasic.
|
inlinevirtual |
Reimplemented from JDrivetrain.
|
inlinevirtual |
| _dist | |
| _run |
| None |
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 a velocity for the drivetrain to move at
| _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 |
| None |
Implements JDrivetrainBasic.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |