#include <devthrottle.h>
Public Member Functions | |
int | Close (void) |
devthrottle (bool train) | |
float | get_position (void) |
int64_t | GetTime () |
int | Open (const char *device) |
bool | query_estop (void) |
int | query_pid (float *pwm, float *dstate, float *istate) |
int | query_rpms (float *data) |
int | query_status () |
int | throttle_absolute (float position) |
int | throttle_relative (float delta) |
~devthrottle () | |
Public Attributes | |
int | avr_kd |
int | avr_ki |
int | avr_kp |
int | avr_out_max |
int | avr_pos_epsilon |
double | avr_pos_max |
int | avr_pos_min |
double | avr_pos_range |
double | rpm_redline |
double | throttle_limit |
Private Member Functions | |
float | avr2pos (uint8_t avr_val) |
int | calibrate_idle (void) |
uint8_t | cmd_compute_csum (uint8_t *buffer, int len) |
int | configure_controller (void) |
void | decode_char (char c, int *resp_bytes, int *resp_digits) |
int | format_cmd (char *cmdstr) |
float | limit_travel (float position) |
uint8_t | pos2avr (float position) |
int | read_byte (int linelen) |
int | send_cmd (int ccode) |
int | send_cmd08 (int ccode, uint8_t data) |
int | send_cmd16 (int ccode, uint16_t data) |
int | send_cmd32 (int ccode, uint32_t data) |
int | send_goto (uint8_t pos) |
int | servo_cmd (void) |
int | validate_response (int resp_bytes, int linelen) |
Private Attributes | |
bool | already_configured |
struct avr_cmd | cmd |
uint8_t * | cmd_p |
float | cur_position |
float | last_req |
struct avr_cmd | resp |
uint8_t * | resp_p |
struct avr_cmd | stat |
bool | training |
Definition at line 26 of file devthrottle.h.
devthrottle::devthrottle | ( | bool | train | ) |
Definition at line 43 of file devthrottle.cc.
devthrottle::~devthrottle | ( | ) | [inline] |
Definition at line 49 of file devthrottle.h.
float devthrottle::avr2pos | ( | uint8_t | avr_val | ) | [inline, private] |
Definition at line 111 of file devthrottle.h.
int devthrottle::calibrate_idle | ( | void | ) | [private] |
Definition at line 244 of file devthrottle.cc.
int devthrottle::Close | ( | void | ) | [virtual] |
Reimplemented from Servo.
Definition at line 133 of file devthrottle.cc.
uint8_t devthrottle::cmd_compute_csum | ( | uint8_t * | buffer, |
int | len | ||
) | [private] |
Definition at line 308 of file devthrottle.cc.
int devthrottle::configure_controller | ( | void | ) | [private] |
Definition at line 323 of file devthrottle.cc.
void devthrottle::decode_char | ( | char | c, |
int * | resp_bytes, | ||
int * | resp_digits | ||
) | [inline, private] |
Definition at line 363 of file devthrottle.cc.
int devthrottle::format_cmd | ( | char * | cmdstr | ) | [inline, private] |
Definition at line 387 of file devthrottle.cc.
float devthrottle::get_position | ( | void | ) | [inline] |
Definition at line 57 of file devthrottle.h.
int64_t devthrottle::GetTime | ( | ) |
Definition at line 37 of file devthrottle.cc.
float devthrottle::limit_travel | ( | float | position | ) | [inline, private] |
Definition at line 100 of file devthrottle.h.
int devthrottle::Open | ( | const char * | device | ) | [virtual] |
Reimplemented from Servo.
Definition at line 97 of file devthrottle.cc.
uint8_t devthrottle::pos2avr | ( | float | position | ) | [inline, private] |
Definition at line 108 of file devthrottle.h.
bool devthrottle::query_estop | ( | void | ) |
Definition at line 139 of file devthrottle.cc.
int devthrottle::query_pid | ( | float * | pwm, |
float * | dstate, | ||
float * | istate | ||
) |
Definition at line 144 of file devthrottle.cc.
int devthrottle::query_rpms | ( | float * | data | ) |
Definition at line 164 of file devthrottle.cc.
int devthrottle::query_status | ( | ) |
Definition at line 180 of file devthrottle.cc.
int devthrottle::read_byte | ( | int | linelen | ) | [inline, private] |
Definition at line 426 of file devthrottle.cc.
int devthrottle::send_cmd | ( | int | ccode | ) | [private] |
Definition at line 489 of file devthrottle.cc.
int devthrottle::send_cmd08 | ( | int | ccode, |
uint8_t | data | ||
) | [private] |
Definition at line 495 of file devthrottle.cc.
int devthrottle::send_cmd16 | ( | int | ccode, |
uint16_t | data | ||
) | [private] |
Definition at line 502 of file devthrottle.cc.
int devthrottle::send_cmd32 | ( | int | ccode, |
uint32_t | data | ||
) | [private] |
Definition at line 509 of file devthrottle.cc.
int devthrottle::send_goto | ( | uint8_t | pos | ) | [inline, private] |
Definition at line 517 of file devthrottle.cc.
int devthrottle::servo_cmd | ( | void | ) | [private] |
Definition at line 529 of file devthrottle.cc.
int devthrottle::throttle_absolute | ( | float | position | ) |
Definition at line 218 of file devthrottle.cc.
int devthrottle::throttle_relative | ( | float | delta | ) |
Definition at line 227 of file devthrottle.cc.
int devthrottle::validate_response | ( | int | resp_bytes, |
int | linelen | ||
) | [inline, private] |
Definition at line 597 of file devthrottle.cc.
bool devthrottle::already_configured [private] |
Definition at line 72 of file devthrottle.h.
Definition at line 37 of file devthrottle.h.
Definition at line 36 of file devthrottle.h.
Definition at line 35 of file devthrottle.h.
Definition at line 38 of file devthrottle.h.
Definition at line 46 of file devthrottle.h.
double devthrottle::avr_pos_max |
Definition at line 43 of file devthrottle.h.
Definition at line 44 of file devthrottle.h.
double devthrottle::avr_pos_range |
Definition at line 45 of file devthrottle.h.
struct avr_cmd devthrottle::cmd [private] |
Definition at line 75 of file devthrottle.h.
uint8_t* devthrottle::cmd_p [private] |
Definition at line 79 of file devthrottle.h.
float devthrottle::cur_position [private] |
Definition at line 82 of file devthrottle.h.
float devthrottle::last_req [private] |
Definition at line 83 of file devthrottle.h.
struct avr_cmd devthrottle::resp [private] |
Definition at line 76 of file devthrottle.h.
uint8_t* devthrottle::resp_p [private] |
Definition at line 80 of file devthrottle.h.
double devthrottle::rpm_redline |
Definition at line 33 of file devthrottle.h.
struct avr_cmd devthrottle::stat [private] |
Definition at line 74 of file devthrottle.h.
double devthrottle::throttle_limit |
Definition at line 34 of file devthrottle.h.
bool devthrottle::training [private] |
Definition at line 71 of file devthrottle.h.