Fawkes API
Fawkes Development Version
|
This class selects the correct drive mode and calls the appopriate drive component. More...
#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 42 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 64 of file select_drive_mode.cpp.
References fawkes::Configuration::get_string(), and fawkes::Logger::log_debug().
fawkes::SelectDriveMode::~SelectDriveMode | ( | ) |
Desctructor.
Definition at line 105 of file select_drive_mode.cpp.
References fawkes::Logger::log_debug(), and 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 203 of file select_drive_mode.cpp.
References fawkes::colli_trans_rot_t::rot.
Referenced by ColliThread::loop().
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 185 of file select_drive_mode.cpp.
References fawkes::colli_trans_rot_t::x.
Referenced by ColliThread::loop().
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 194 of file select_drive_mode.cpp.
References fawkes::colli_trans_rot_t::y.
Referenced by ColliThread::loop().
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 216 of file select_drive_mode.cpp.
References fawkes::NavigatorInterface::ESCAPE, and fawkes::Logger::log_error().
Referenced by ColliThread::loop().
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 235 of file select_drive_mode.cpp.
References fawkes::NavigatorInterface::ESCAPE, and fawkes::Logger::log_error().
Referenced by ColliThread::loop().
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 164 of file select_drive_mode.cpp.
References fawkes::cart_coord_2d_struct::x, and fawkes::cart_coord_2d_struct::y.
Referenced by ColliThread::loop().
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 175 of file select_drive_mode.cpp.
References fawkes::cart_coord_2d_struct::x, and fawkes::cart_coord_2d_struct::y.
Referenced by ColliThread::loop().
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 261 of file select_drive_mode.cpp.
References fawkes::MotorInterface::des_omega(), fawkes::MotorInterface::des_vx(), fawkes::NavigatorInterface::dest_ori(), fawkes::NavigatorInterface::dest_x(), fawkes::NavigatorInterface::dest_y(), fawkes::NavigatorInterface::drive_mode(), fawkes::NavigatorInterface::ESCAPE, fawkes::AbstractDriveMode::get_proposed_rot(), fawkes::AbstractDriveMode::get_proposed_trans_x(), fawkes::AbstractDriveMode::get_proposed_trans_y(), fawkes::NavigatorInterface::is_stop_at_target(), fawkes::Logger::log_error(), fawkes::NavigatorInterface::max_rotation(), fawkes::NavigatorInterface::max_velocity(), fawkes::NavigatorInterface::MovingNotAllowed, fawkes::normalize_mirror_rad(), fawkes::MotorInterface::odometry_orientation(), fawkes::MotorInterface::odometry_position_x(), fawkes::MotorInterface::odometry_position_y(), fawkes::MotorInterface::omega(), fawkes::NavigatorInterface::orientation_mode(), fawkes::colli_trans_rot_t::rot, fawkes::AbstractDriveMode::set_current_colli_mode(), fawkes::AbstractDriveMode::set_current_robo_pos(), fawkes::AbstractDriveMode::set_current_robo_speed(), fawkes::AbstractDriveMode::set_current_target(), fawkes::AbstractDriveMode::set_local_target(), fawkes::AbstractDriveMode::set_local_trajec(), fawkes::AbstractDriveMode::update(), fawkes::MotorInterface::vx(), fawkes::MotorInterface::vy(), fawkes::cart_coord_2d_struct::x, fawkes::colli_trans_rot_t::x, fawkes::cart_coord_2d_struct::y, and fawkes::colli_trans_rot_t::y.
Referenced by ColliThread::loop().