JMotor
Loading...
Searching...
No Matches
Public Member Functions | List of all members
JDrivetrainBasic Class Referenceabstract

interface for a drivetrain with only simple velocity control More...

#include <JDrivetrainBasic.h>

Inheritance diagram for JDrivetrainBasic:
Inheritance graph
[legend]

Public Member Functions

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 bool enable ()=0
 enables movement
 
virtual bool disable ()=0
 disables movement
 
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 JTwoDTransform getMaxVel ()=0
 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.
 

Detailed Description

interface for a drivetrain with only simple velocity control

Member Function Documentation

◆ disable()

virtual bool JDrivetrainBasic::disable ( )
pure virtual

disables movement

Return values
didthe state change

Implemented in JDrivetrainFieldOriented, JDrivetrainMecanum, JDrivetrainSwerve< N >, JDrivetrainTwoSide, and JDrivetrainControllerBasic.

◆ enable()

virtual bool JDrivetrainBasic::enable ( )
pure virtual

enables movement

Return values
didthe state change

Implemented in JDrivetrainFieldOriented, JDrivetrainMecanum, JDrivetrainSwerve< N >, JDrivetrainTwoSide, and JDrivetrainControllerBasic.

◆ getEnable()

virtual bool JDrivetrainBasic::getEnable ( )
pure virtual

gets the current state (enabled or disabled)

Return values
(bool)true=enabled false=movement disabled

Implemented in JDrivetrainFieldOriented, JDrivetrainMecanum, JDrivetrainSwerve< N >, JDrivetrainTwoSide, and JDrivetrainControllerBasic.

◆ getMaxVel()

virtual JTwoDTransform JDrivetrainBasic::getMaxVel ( )
pure virtual

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)

Implemented in JDrivetrainFieldOriented, JDrivetrainMecanum, JDrivetrainTwoSide, and JDrivetrainControllerBasic.

◆ run()

virtual void JDrivetrainBasic::run ( )
pure virtual

call this in loop. it calls any encoder or motor update functions

Implemented in JDrivetrainFieldOriented, JDrivetrainMecanum, JDrivetrainSwerve< N >, JDrivetrainTwoSide, and JDrivetrainControllerBasic.

◆ setEnable()

virtual bool JDrivetrainBasic::setEnable ( bool  _enable)
pure virtual

enables or disables movement

Parameters
_enable(bool) true=enabled false=movement disabled
Return values
didthe state change

Implemented in JDrivetrainFieldOriented, JDrivetrainMecanum, JDrivetrainSwerve< N >, JDrivetrainTwoSide, and JDrivetrainControllerBasic.

◆ setVel()

virtual void JDrivetrainBasic::setVel ( JTwoDTransform  _vel,
bool  _run = false 
)
pure virtual

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
None

Implemented in JDrivetrainFieldOriented, JDrivetrainMecanum, JDrivetrainTwoSide, JDrivetrainControllerBasic, and JDrivetrainSwerve< N >.


The documentation for this class was generated from the following file: