LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
DriveESC Class Reference

Container for multiple speed controllers for the drivetrain. Features dithered braking and current limiting. More...

#include <DriveESC.h>

Inheritance diagram for DriveESC:
Collaboration diagram for DriveESC:

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

- Protected Member Functions inherited from Loggable
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.
 

Detailed Description

Container for multiple speed controllers for the drivetrain. Features dithered braking and current limiting.

Constructor & Destructor Documentation

DriveESC::DriveESC ( LRTSpeedController esc,
LRTEncoder encoder,
std::string  name 
)

Constructs a new drivetrain ESC object with one motor.

Parameters
escthe LRTSpeedController
encoderthe encoder that measures the speed of this ESC
namethe name of this ESC
DriveESC::DriveESC ( LRTSpeedController esc1,
LRTSpeedController esc2,
LRTEncoder encoder,
std::string  name 
)

Constructs a new drivetrain ESC object with two motors.

Parameters
esc1the first LRTSpeedController
esc2the second LRTSpeedController
encoderthe encoder that measures the speed of this ESC
namethe name of this ESC

Member Function Documentation

void DriveESC::SetDutyCycle ( float  dutycycle)

Sets the duty cycle. Includes dithered braking to ensure a linear response.

Parameters
dutycyclethe duty cycle to set

Here is the call graph for this function:

Here is the caller graph for this function:

void DriveESC::SetForwardCurrentLimit ( float  limit)

Sets the acceleration current limit.

Parameters
limitthe current limit in %

Here is the caller graph for this function:

void DriveESC::SetReverseCurrentLimit ( float  limit)

Sets the reverse direction current limit.

Parameters
limitthe current limit in %

Here is the caller graph for this function:


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