EE445M RTOS
Taken at the University of Texas Spring 2015
|
#include <drivepp.hpp>
Public Member Functions | |
drive () | |
drive (motor *left, motor *right, percent_t speed=0, Direction direction=FORWARD) | |
void | forward (percent_t speed) |
void | backward (percent_t speed) |
void | set (percent_t speed, Direction dir) |
void | stop (void) |
void | start (void) |
void | steer (uint32_t left_sens, uint32_t left_front_sens, uint32_t right_sens, uint32_t right_front_sens, uint32_t front_sens) |
void | reset_history () |
Private Attributes | |
motor * | left |
motor * | right |
int32_t | integral_oblique_error |
int32_t | integral_side_error |
int32_t | last_counter |
Static Private Attributes | |
static const int32_t | kp_oblique_num = 10 |
static const int32_t | kp_oblique_denom = 1 |
static const int32_t | kp_side_num = 5 |
static const int32_t | kp_side_denom = 2 |
static const int32_t | ki_oblique_num = 1 |
static const int32_t | ki_oblique_denom = 10000 |
static const int32_t | ki_side_num = 1 |
static const int32_t | ki_side_denom = 2000 |
Definition at line 19 of file drivepp.hpp.
drive::drive | ( | ) |
Definition at line 10 of file drivepp.cpp.
Definition at line 12 of file drivepp.cpp.
References integral_oblique_error, left, right, and set().
void drive::backward | ( | percent_t | speed | ) |
Move backward at some percent of full-speed.
Definition at line 38 of file drivepp.cpp.
References BACKWARD, left, right, and motor::set().
void drive::forward | ( | percent_t | speed | ) |
Move forward at some percent of full-speed.
Definition at line 32 of file drivepp.cpp.
References FORWARD, left, right, and motor::set().
void drive::reset_history | ( | ) |
Definition at line 122 of file drivepp.cpp.
References integral_oblique_error, and integral_side_error.
Referenced by switch_responder().
Set motor vectors
Definition at line 44 of file drivepp.cpp.
References left, right, and motor::set().
Referenced by drive().
void drive::start | ( | void | ) |
Re-enable all previoulsy stopped motors
Definition at line 26 of file drivepp.cpp.
References left, right, and motor::start().
Referenced by motor_control().
void drive::steer | ( | uint32_t | left_sens, |
uint32_t | left_front_sens, | ||
uint32_t | right_sens, | ||
uint32_t | right_front_sens, | ||
uint32_t | front_sens | ||
) |
Feed the autonomous driver sensor inputs.
Definition at line 50 of file drivepp.cpp.
References clamp(), FORWARD, integral_oblique_error, integral_side_error, kp_oblique_denom, kp_oblique_num, last_counter, left, motor::pwm_max_period, right, and motor::set().
Referenced by driver().
void drive::stop | ( | void | ) |
Stop all motors
Definition at line 20 of file drivepp.cpp.
References left, right, and motor::stop().
Referenced by motor_control(), and Timer0A_Handler().
|
private |
Definition at line 23 of file drivepp.hpp.
Referenced by drive(), reset_history(), and steer().
|
private |
Definition at line 24 of file drivepp.hpp.
Referenced by reset_history(), and steer().
|
staticprivate |
Definition at line 33 of file drivepp.hpp.
|
staticprivate |
Definition at line 32 of file drivepp.hpp.
|
staticprivate |
Definition at line 36 of file drivepp.hpp.
|
staticprivate |
Definition at line 35 of file drivepp.hpp.
|
staticprivate |
Definition at line 27 of file drivepp.hpp.
Referenced by steer().
|
staticprivate |
Definition at line 26 of file drivepp.hpp.
Referenced by steer().
|
staticprivate |
Definition at line 30 of file drivepp.hpp.
|
staticprivate |
Definition at line 29 of file drivepp.hpp.
|
private |
Definition at line 38 of file drivepp.hpp.
Referenced by steer().
|
private |
Definition at line 21 of file drivepp.hpp.
Referenced by backward(), drive(), forward(), set(), start(), steer(), and stop().
|
private |
Definition at line 22 of file drivepp.hpp.
Referenced by backward(), drive(), forward(), set(), start(), steer(), and stop().