1#ifndef JDRIVETRAIN_FIELD_ORIENTED_H
2#define JDRIVETRAIN_FIELD_ORIENTED_H
virtual bool getEnable()=0
gets the current state (enabled or disabled)
virtual void setVel(JTwoDTransform _vel, bool _run=false)=0
sets a velocity for the drivetrain to move at
virtual bool enable()=0
enables movement
virtual void run()=0
call this in loop. it calls any encoder or motor update functions
virtual bool setEnable(bool _enable)=0
enables or disables movement
virtual JTwoDTransform getMaxVel()=0
returns the approximate maximum velocity of the drivetrain, if the drivetrain is told to move at max ...
virtual bool disable()=0
disables movement
interface for a drivetrain that makes it into field oriented
Definition JDrivetrainFieldOriented.h:37
void setVel(JTwoDTransform _vel, bool _run=false)
sets a velocity for the drivetrain to move at
Definition JDrivetrainFieldOriented.h:92
void setDistDelta(JTwoDTransform _dist, bool _run=false)
Definition JDrivetrainFieldOriented.h:123
unsigned char getNumberMotors()
Definition JDrivetrainFieldOriented.h:151
void setMotorDistDelta(float distDelta, unsigned char i, bool _run=false)
Definition JDrivetrainFieldOriented.h:147
bool setEnable(bool _enable)
enables or disables movement
Definition JDrivetrainFieldOriented.h:76
JTwoDTransform getMaxVel()
returns the approximate maximum velocity of the drivetrain, if the drivetrain is told to move at max ...
Definition JDrivetrainFieldOriented.h:96
void resetDist()
Definition JDrivetrainFieldOriented.h:127
float theta
Definition JDrivetrainFieldOriented.h:43
void setMotorDistSetpoint(float distSetpoint, unsigned char i, bool _run=false)
Definition JDrivetrainFieldOriented.h:143
bool enable()
enables movement
Definition JDrivetrainFieldOriented.h:80
JTwoDTransform dist
Definition JDrivetrainFieldOriented.h:45
void setDistSetpoint(JTwoDTransform _dist, bool _run=false)
Definition JDrivetrainFieldOriented.h:118
float imuHeading
Definition JDrivetrainFieldOriented.h:40
bool disable()
disables movement
Definition JDrivetrainFieldOriented.h:84
float getMotorVel(unsigned char i)
Definition JDrivetrainFieldOriented.h:139
void run()
call this in loop. it calls any encoder or motor update functions
Definition JDrivetrainFieldOriented.h:67
float lastImuHeading
Definition JDrivetrainFieldOriented.h:42
JDrivetrainFieldOriented(JDrivetrain &_drivetrain)
Definition JDrivetrainFieldOriented.h:49
JDrivetrain & drivetrain
Definition JDrivetrainFieldOriented.h:39
JTwoDTransform getVel(bool _run=false)
Definition JDrivetrainFieldOriented.h:100
float getHeading()
Definition JDrivetrainFieldOriented.h:53
JTwoDTransform getDist(bool _run=false)
Definition JDrivetrainFieldOriented.h:105
bool getEnable()
gets the current state (enabled or disabled)
Definition JDrivetrainFieldOriented.h:88
void setMotorVel(float vel, unsigned char i, bool _run=false)
Definition JDrivetrainFieldOriented.h:135
JTwoDTransform lastDrivetrainDist
Definition JDrivetrainFieldOriented.h:46
int fullRotations
Definition JDrivetrainFieldOriented.h:44
float imuHeadingOffset
Definition JDrivetrainFieldOriented.h:41
void giveHeading(float _heading)
Definition JDrivetrainFieldOriented.h:57
defines interface for controlling any ground-based drivetrain
Definition JDrivetrain.h:10
virtual void setMotorDistDelta(float distDelta, unsigned char i, bool _run=false)
virtual JTwoDTransform getVel(bool _run=false)
virtual JTwoDTransform getDist(bool _run=false)
virtual unsigned char getNumberMotors()
virtual void setMotorVel(float vel, unsigned char i, bool _run=false)
virtual void setDistDelta(JTwoDTransform _dist, bool _run=false)
virtual float getMotorVel(unsigned char i)
virtual void setMotorDistSetpoint(float distSetpoint, unsigned char i, bool _run=false)