JMotor
Loading...
Searching...
No Matches
JSwerveModule.h
Go to the documentation of this file.
1#ifndef JSWERVE_MODULE_H
2#define JSWERVE_MODULE_H
3#include <Arduino.h>
8public:
16 virtual void set(float _speed, float _angle, bool _run = true);
21 virtual float getAngle();
25 virtual float getMaxSpeed();
30 virtual long zeroTurnCounter();
36 virtual bool setEnable(bool _enable);
41 virtual bool getEnable();
47 bool enable()
48 {
49 return setEnable(true);
50 }
51
57 bool disable()
58 {
59 return setEnable(false);
60 }
64 virtual void run();
65};
66
68
69#endif // JSWERVE_MODULE_H
defines a common interface for swerve modules
Definition JSwerveModule.h:7
virtual bool setEnable(bool _enable)
set enable state of swerve module motors
virtual void run()
call this in loop() so that the swerve module can update its motors and angle control loop
bool disable()
disable motor
Definition JSwerveModule.h:57
virtual void set(float _speed, float _angle, bool _run=true)
set speed and angle setpoints for wheel
virtual bool getEnable()
get enable state of module
virtual float getAngle()
get angle measurement from wheel
bool enable()
enable motor
Definition JSwerveModule.h:47
virtual long zeroTurnCounter()
zeros the encoder's counter of full turns, leaving only the fractional turn
virtual float getMaxSpeed()
maximum drive speed