#include <model_brake.h>
Public Member Functions | |
ArtBrakeModel (float init_pos) | |
int | interpret (const char *string, char *status, int nbytes) |
~ArtBrakeModel () | |
Private Member Functions | |
double | getAccel (double direction) |
Get acceleration constant from direction of movement (-, 0, +). | |
void | move (double start, double finish) |
double | plan (double dx) |
void | update (void) |
void | update_sensors (float position) |
Private Attributes | |
double | a_ |
double | actuator_accel_ |
double | actuator_max_vel_ |
Animatics * | am_ |
float | brake_position_ |
int | digital_potentiometer_ |
int | digital_pressure_ |
int | encoder_goal_ |
double | last_update_time_ |
ros::NodeHandle | node_ |
ActuatorPlan | plan_ |
int | sim_encoder_ |
int | sim_status_ |
double | v_ |
double | x_ |
Definition at line 107 of file model_brake.h.
ArtBrakeModel::ArtBrakeModel | ( | float | init_pos | ) |
Constructor
Definition at line 30 of file model_brake.cc.
Definition at line 60 of file model_brake.cc.
double ArtBrakeModel::getAccel | ( | double | direction | ) | [inline, private] |
Get acceleration constant from direction of movement (-, 0, +).
Definition at line 146 of file model_brake.h.
int ArtBrakeModel::interpret | ( | const char * | string, |
char * | status, | ||
int | nbytes | ||
) |
Interpret actuator command and return response.
interpret brake command and return response
Only certain commands require interpretation. All others are just accepted, acknowledged, and ignored.
Definition at line 70 of file model_brake.cc.
void ArtBrakeModel::move | ( | double | start, |
double | finish | ||
) | [private] |
Move simulated actuator.
start | time for simulation |
finish | time. |
The Animatics Smart Motor provides a constant acceleration and deceleration up to a maximum velocity.
Definition at line 154 of file model_brake.cc.
double ArtBrakeModel::plan | ( | double | dx | ) | [private] |
Plan actuator relative move.
dx | = encoder ticks to move. |
This calculation assumes a triangular velocity profile with constant acceleration |a|, applied first in one direction, then in the other.
Erase any previous plan, then move the actuator in two steps:
(1) accelerate in direction requested; (2) decelerate to zero velocity
The real device supports a trapezoidal velocity profile with a maximum velocity (actuator_max_vel_). Since it takes a long time to reach actuator_max_vel_, this model ignores that detail, which does not seem to matter much in practice.
Definition at line 206 of file model_brake.cc.
void ArtBrakeModel::update | ( | void | ) | [private] |
update brake actuator model for start of cycle
Definition at line 243 of file model_brake.cc.
void ArtBrakeModel::update_sensors | ( | float | position | ) | [private] |
Definition at line 285 of file model_brake.cc.
double ArtBrakeModel::a_ [private] |
Definition at line 140 of file model_brake.h.
double ArtBrakeModel::actuator_accel_ [private] |
Definition at line 134 of file model_brake.h.
double ArtBrakeModel::actuator_max_vel_ [private] |
Definition at line 135 of file model_brake.h.
Animatics* ArtBrakeModel::am_ [private] |
Definition at line 124 of file model_brake.h.
float ArtBrakeModel::brake_position_ [private] |
Definition at line 126 of file model_brake.h.
int ArtBrakeModel::digital_potentiometer_ [private] |
Definition at line 131 of file model_brake.h.
int ArtBrakeModel::digital_pressure_ [private] |
Definition at line 130 of file model_brake.h.
int ArtBrakeModel::encoder_goal_ [private] |
Definition at line 129 of file model_brake.h.
double ArtBrakeModel::last_update_time_ [private] |
Definition at line 122 of file model_brake.h.
ros::NodeHandle ArtBrakeModel::node_ [private] |
Definition at line 120 of file model_brake.h.
ActuatorPlan ArtBrakeModel::plan_ [private] |
Definition at line 142 of file model_brake.h.
int ArtBrakeModel::sim_encoder_ [private] |
Definition at line 128 of file model_brake.h.
int ArtBrakeModel::sim_status_ [private] |
Definition at line 127 of file model_brake.h.
double ArtBrakeModel::v_ [private] |
Definition at line 139 of file model_brake.h.
double ArtBrakeModel::x_ [private] |
Definition at line 138 of file model_brake.h.