number of swerve modules
More...
#include <JDrivetrainSwerve.h>
|
| | JDrivetrainSwerve (JSwerveModule *_swerveModule[N], float _modPosForwards[N], float _modPosLeft[N], float _centerL=0, float _centerF=0) |
| |
| void | setCenter (float forwards, float left) |
| |
| 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=true) |
| | 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.
|
| |
template<byte N>
class JDrivetrainSwerve< N >
number of swerve modules
swerve drivetrain.
- Note
- not actually a subclass of JDrivetrain, since currently only velocity control is implemented The code for calculating speed and angles for each wheel is in this file.
◆ JDrivetrainSwerve()
- Note
- Parameters
-
| _swerveModule[N] | array of pointers to swerveModules. Sorry, couldn't figure out how to hide the pointers from you. example: pass swerveModules to constructor: JSwerveModule* swerveModules[3] = { &swerveModule1, &swerveModule2, &swerveModule3 }; where swerveModuleN is a subclass of JSwerveModule |
| _modPosForwards[N] | |
| _modPosLeft[N] | |
| _centerL | |
| _centerF | |
- Return values
-
◆ calcClosestAngle()
◆ disable()
◆ enable()
◆ getEnable()
gets the current state (enabled or disabled)
- Return values
-
| (bool) | true=enabled false=movement disabled |
Implements JDrivetrainBasic.
◆ run()
call this in loop. it calls any encoder or motor update functions
Implements JDrivetrainBasic.
◆ setCenter()
◆ setEnable()
enables or disables movement
- Parameters
-
| _enable | (bool) true=enabled false=movement disabled |
- Return values
-
Implements JDrivetrainBasic.
◆ setVel()
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.
◆ centerF
◆ centerL
◆ deadzone
◆ modPosF
◆ modPosL
◆ swerveModule
◆ targetSpeed
◆ targetTheta
The documentation for this class was generated from the following file: