Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
SelectDriveMode (MotorInterface *motor, NavigatorInterface *colli_target, Logger *logger, Configuration *config, colli_escape_mode_t escape_mode=colli_escape_mode_t::basic) | |
Constructor. More... | |
~SelectDriveMode () | |
Desctructor. More... | |
void | set_local_target (float x, float y) |
Set local target point before update! More... | |
void | set_local_trajec (float x, float y) |
Set local trajectory point before update! More... | |
void | update (bool escape=false) |
Has to be called before the proposed values are called. More... | |
float | get_proposed_trans_x () |
Returns the proposed translation. After an update. More... | |
float | get_proposed_trans_y () |
Returns the proposed translation. After an update. More... | |
float | get_proposed_rot () |
Returns the proposed rotation. After an update. More... | |
void | set_grid_information (LaserOccupancyGrid *occ_grid, int robo_x, int robo_y) |
search for the escape drive mode and hands over the given information to the escape drive mode This should just be called if potential-field-escape mode is used! More... | |
void | set_laser_data (std::vector< fawkes::polar_coord_2d_t > &laser_points) |
search for the escape drive mode and hands over the given information to the escape drive mode This should just be called if basic-escape mode is used! More... | |
This class selects the correct drive mode and calls the appopriate drive component
Definition at line 47 of file select_drive_mode.h.
fawkes::SelectDriveMode::SelectDriveMode | ( | MotorInterface * | motor, |
NavigatorInterface * | target, | ||
Logger * | logger, | ||
Configuration * | config, | ||
colli_escape_mode_t | escape_mode = colli_escape_mode_t::basic |
||
) |
Constructor.
motor | The motor interface |
target | The "colli target" NavigatorInterface |
logger | The fawkes logger |
config | The fawkes configuration |
escape_mode | The chosen escape mode |
Definition at line 65 of file select_drive_mode.cpp.
References fawkes::Configuration::get_string().
fawkes::SelectDriveMode::~SelectDriveMode | ( | ) |
Desctructor.
Definition at line 108 of file select_drive_mode.cpp.
References fawkes::Logger::log_error().
float fawkes::SelectDriveMode::get_proposed_rot | ( | ) |
Returns the proposed rotation. After an update.
Returns the proposed rotation which was previously calculated in update()
Definition at line 205 of file select_drive_mode.cpp.
References fawkes::NavigatorInterface::ESCAPE.
float fawkes::SelectDriveMode::get_proposed_trans_x | ( | ) |
Returns the proposed translation. After an update.
Returns the proposed x translation which was previously calculated in update()
Definition at line 187 of file select_drive_mode.cpp.
References fawkes::colli_trans_rot_t::y.
float fawkes::SelectDriveMode::get_proposed_trans_y | ( | ) |
Returns the proposed translation. After an update.
Returns the proposed y translation which was previously calculated in update()
Definition at line 196 of file select_drive_mode.cpp.
References fawkes::colli_trans_rot_t::rot.
void fawkes::SelectDriveMode::set_grid_information | ( | LaserOccupancyGrid * | occ_grid, |
int | robo_x, | ||
int | robo_y | ||
) |
search for the escape drive mode and hands over the given information to the escape drive mode This should just be called if potential-field-escape mode is used!
occ_grid | pointer to the occ_grid |
robo_x | robot position on the grid in x |
robo_y | robot position on the grid in y |
Definition at line 218 of file select_drive_mode.cpp.
void fawkes::SelectDriveMode::set_laser_data | ( | std::vector< fawkes::polar_coord_2d_t > & | laser_points | ) |
search for the escape drive mode and hands over the given information to the escape drive mode This should just be called if basic-escape mode is used!
laser_points | vector of laser points |
Definition at line 238 of file select_drive_mode.cpp.
void fawkes::SelectDriveMode::set_local_target | ( | float | x, |
float | y | ||
) |
Set local target point before update!
x | x-coordinate |
y | y-coordinate |
Definition at line 166 of file select_drive_mode.cpp.
References fawkes::cart_coord_2d_struct::x, and fawkes::cart_coord_2d_struct::y.
void fawkes::SelectDriveMode::set_local_trajec | ( | float | x, |
float | y | ||
) |
Set local trajectory point before update!
Set local target trajectory before update!
x | x-coordinate |
y | y-coordinate |
Definition at line 177 of file select_drive_mode.cpp.
References fawkes::colli_trans_rot_t::x.
void fawkes::SelectDriveMode::update | ( | bool | escape = false | ) |
Has to be called before the proposed values are called.
Pick the drive-mode that should be used and calculate the proposed translation and rotation for the current target (which is set by set_local_target() and set_local_trajec(), so make sure to call them beforehand).
update() has to be called before the proposed values are fetched.
escape | Set to true if we want to enter escape-mode |
Definition at line 264 of file select_drive_mode.cpp.
References fawkes::MotorInterface::des_omega(), fawkes::MotorInterface::des_vx(), fawkes::MotorInterface::des_vy(), fawkes::NavigatorInterface::ESCAPE, and fawkes::NavigatorInterface::MovingNotAllowed.