#include <ref_generator.h>
Public Member Functions | |
void | generate (double x_desired, double dt, bool force_stop) |
Generates the actual reference. | |
double | getAccelerationReference () |
double | getPositionReference () |
double | getVelocityReference () |
RefGenerator (double current_x, double max_vel, double max_acc) | |
Constructor for the RefGenerator. | |
void | setCurrentPosition (double x) |
void | setCurrentVelocity (double vel) |
~RefGenerator () | |
Deconstructor for the RefGenerator. | |
Private Member Functions | |
int | signum (double a) |
Private Attributes | |
double | acc_ |
double | max_acc_ |
double | max_vel_ |
double | pos_ |
double | vel_ |
Static Private Attributes | |
static const double | EPSILON = 1e-5 |
Definition at line 53 of file ref_generator.h.
RefGenerator::RefGenerator | ( | double | current_x, |
double | max_vel, | ||
double | max_acc | ||
) |
Constructor for the RefGenerator.
pos_ is set to current_x vel_ to 0 acc_ to 0 max_vel_ to max_vel max_acc_ to mac_acc
Definition at line 54 of file ref_generator.cpp.
Deconstructor for the RefGenerator.
Definition at line 58 of file ref_generator.cpp.
void RefGenerator::generate | ( | double | x_desired, |
double | dt, | ||
bool | force_stop | ||
) |
Generates the actual reference.
Creates new values for pos_, vel_ and acc_ such that progress is made to the desired position, but no (velocity or acceleration) limit is exceeded.
x_desired | the desired position |
dt | the time passed since the last generate |
force_stop | whether to stop immediately or not |
Definition at line 90 of file ref_generator.cpp.
double RefGenerator::getAccelerationReference | ( | ) |
Definition at line 86 of file ref_generator.cpp.
double RefGenerator::getPositionReference | ( | ) |
Definition at line 78 of file ref_generator.cpp.
double RefGenerator::getVelocityReference | ( | ) |
Definition at line 82 of file ref_generator.cpp.
void RefGenerator::setCurrentPosition | ( | double | x | ) |
Sets pos_ to x
Definition at line 70 of file ref_generator.cpp.
void RefGenerator::setCurrentVelocity | ( | double | vel | ) |
Sets vel_ to vel
Definition at line 74 of file ref_generator.cpp.
int RefGenerator::signum | ( | double | a | ) | [private] |
Definition at line 61 of file ref_generator.cpp.
double controller::RefGenerator::acc_ [private] |
Definition at line 59 of file ref_generator.h.
const double controller::RefGenerator::EPSILON = 1e-5 [static, private] |
Definition at line 64 of file ref_generator.h.
double controller::RefGenerator::max_acc_ [private] |
Definition at line 62 of file ref_generator.h.
double controller::RefGenerator::max_vel_ [private] |
Definition at line 61 of file ref_generator.h.
double controller::RefGenerator::pos_ [private] |
Definition at line 57 of file ref_generator.h.
double controller::RefGenerator::vel_ [private] |
Definition at line 58 of file ref_generator.h.