LRT14
1.0
|
Container for multiple speed controllers for the drivetrain. Features dithered braking and current limiting. More...
#include <DriveESC.h>
Public Member Functions | |
DriveESC (LRTSpeedController *esc, LRTEncoder *encoder, std::string name) | |
Constructs a new drivetrain ESC object with one motor. | |
DriveESC (LRTSpeedController *esc1, LRTSpeedController *esc2, LRTEncoder *encoder, std::string name) | |
Constructs a new drivetrain ESC object with two motors. | |
~DriveESC () | |
Cleans up the speed controller container. | |
void | SetDutyCycle (float dutycycle) |
Sets the duty cycle. Includes dithered braking to ensure a linear response. | |
void | SetForwardCurrentLimit (float limit) |
Sets the acceleration current limit. | |
void | SetReverseCurrentLimit (float limit) |
Sets the reverse direction current limit. | |
void | ResetCache () |
Resets the caching. | |
void | Log () |
Logs data to the Logger. | |
Additional Inherited Members | |
![]() | |
template<typename T > | |
void | LogToFile (T *field, std::string name) |
Saves a variable to the Logger for logging. | |
template<typename T > | |
void | LogToFile (T *field, int count, std::string name) |
Saves a dynamically allocated array to the Logger for logging. | |
template<typename T > | |
void | LogToFile (T value, std::string name) |
Saves a value to the Logger for logging. | |
Container for multiple speed controllers for the drivetrain. Features dithered braking and current limiting.
DriveESC::DriveESC | ( | LRTSpeedController * | esc, |
LRTEncoder * | encoder, | ||
std::string | name | ||
) |
Constructs a new drivetrain ESC object with one motor.
esc | the LRTSpeedController |
encoder | the encoder that measures the speed of this ESC |
name | the name of this ESC |
DriveESC::DriveESC | ( | LRTSpeedController * | esc1, |
LRTSpeedController * | esc2, | ||
LRTEncoder * | encoder, | ||
std::string | name | ||
) |
Constructs a new drivetrain ESC object with two motors.
esc1 | the first LRTSpeedController |
esc2 | the second LRTSpeedController |
encoder | the encoder that measures the speed of this ESC |
name | the name of this ESC |
void DriveESC::SetDutyCycle | ( | float | dutycycle | ) |
Sets the duty cycle. Includes dithered braking to ensure a linear response.
dutycycle | the duty cycle to set |
void DriveESC::SetForwardCurrentLimit | ( | float | limit | ) |
Sets the acceleration current limit.
limit | the current limit in % |
void DriveESC::SetReverseCurrentLimit | ( | float | limit | ) |
Sets the reverse direction current limit.
limit | the current limit in % |