Fawkes API  Fawkes Development Version
fawkes::AbstractDriveMode Class Referenceabstract

This is the base class which calculates drive modes. More...

#include <>>

Inheritance diagram for fawkes::AbstractDriveMode:

Public Member Functions

 AbstractDriveMode (Logger *logger, Configuration *config)
 Constructor. More...
 
virtual ~AbstractDriveMode ()
 Desctructor. More...
 
void set_current_target (float x, float y, float ori)
 Sets the current target. More...
 
void set_current_robo_pos (float x, float y, float ori)
 Sets the current robo position. More...
 
void set_current_robo_speed (float x, float y, float rot)
 Sets the current robo speed. More...
 
void set_current_colli_mode (NavigatorInterface::OrientationMode orient, bool stop)
 Set the colli mode values for each drive mode. More...
 
void set_local_target (float x, float y)
 Set the local targetpoint found by the search. More...
 
void set_local_trajec (float x, float y)
 Set the local trajectory point found by the search. More...
 
NavigatorInterface::DriveMode get_drive_mode_name ()
 Returns the drive modes name. More...
 
virtual void update ()=0
 Calculate the proposed settings which are asked for afterwards. More...
 
float get_proposed_trans_x ()
 Returns the proposed x translation. More...
 
float get_proposed_trans_y ()
 Returns the proposed y translation. More...
 
float get_proposed_rot ()
 Returns the proposed rotatio. More...
 

Protected Member Functions

float lin_interpol (float x, float left, float right, float bot, float top)
 Perform linear interpolation. More...
 
float guarantee_trans_stop (float distance, float current_trans, float desired_trans)
 Get velocity that guarantees a stop for a given distance. More...
 

Protected Attributes

field_pos_t target_
 current target More...
 
field_pos_t robot_
 current robot pos More...
 
colli_trans_rot_t robot_vel_
 current robot velocity More...
 
float robot_speed_
 current robo translation velocity More...
 
cart_coord_2d_t local_target_
 local target More...
 
cart_coord_2d_t local_trajec_
 local trajectory More...
 
NavigatorInterface::OrientationMode orient_mode_
 orient mode of nav if More...
 
bool stop_at_target_
 flag if stopping on or after target More...
 
colli_trans_rot_t proposed_
 proposed translation and rotation for next timestep More...
 
NavigatorInterface::DriveMode drive_mode_
 the drive mode name More...
 
Loggerlogger_
 The fawkes logger. More...
 
Configurationconfig_
 The fawkes configuration. More...
 
float max_trans_
 The maximum translation speed. More...
 
float max_rot_
 The maximum rotation speed. More...
 

Detailed Description

This is the base class which calculates drive modes.

Drive modes are the proposed settings for the drive-realization out of the found search things.

Definition at line 44 of file abstract_drive_mode.h.

Constructor & Destructor Documentation

◆ AbstractDriveMode()

fawkes::AbstractDriveMode::AbstractDriveMode ( Logger logger,
Configuration config 
)
inline

◆ ~AbstractDriveMode()

fawkes::AbstractDriveMode::~AbstractDriveMode ( )
inlinevirtual

Desctructor.

Definition at line 164 of file abstract_drive_mode.h.

References fawkes::Logger::log_debug(), and logger_.

Member Function Documentation

◆ get_drive_mode_name()

NavigatorInterface::DriveMode fawkes::AbstractDriveMode::get_drive_mode_name ( )
inline

Returns the drive modes name.

Get the drive mode.

Has to be set in the constructor of your drive mode!

Returns
The drive mode

Definition at line 289 of file abstract_drive_mode.h.

References drive_mode_.

◆ get_proposed_rot()

float fawkes::AbstractDriveMode::get_proposed_rot ( )
inline

Returns the proposed rotatio.

Returns the proposed rotation which was calculated previously in 'update()' which has to be implemented!

Returns
The proposed rotation

Definition at line 196 of file abstract_drive_mode.h.

References proposed_, and fawkes::colli_trans_rot_t::rot.

Referenced by fawkes::BiwardDriveModule::update(), and fawkes::SelectDriveMode::update().

◆ get_proposed_trans_x()

float fawkes::AbstractDriveMode::get_proposed_trans_x ( )
inline

Returns the proposed x translation.

Returns the proposed x translation which was calculated previously in 'update()' which has to be implemented!

Returns
The proposed translation

Definition at line 176 of file abstract_drive_mode.h.

References proposed_, and fawkes::colli_trans_rot_t::x.

Referenced by fawkes::BiwardDriveModule::update(), and fawkes::SelectDriveMode::update().

◆ get_proposed_trans_y()

float fawkes::AbstractDriveMode::get_proposed_trans_y ( )
inline

Returns the proposed y translation.

Returns the proposed y translation which was calculated previously in 'update()' which has to be implemented!

Returns
The proposed translation

Definition at line 186 of file abstract_drive_mode.h.

References proposed_, and fawkes::colli_trans_rot_t::y.

Referenced by fawkes::SelectDriveMode::update().

◆ guarantee_trans_stop()

float fawkes::AbstractDriveMode::guarantee_trans_stop ( float  distance,
float  current_trans,
float  desired_trans 
)
inlineprotected

Get velocity that guarantees a stop for a given distance.

Parameters
distanceThe distance to stop at
current_transRobot's current translation velocity
desired_transRobot's currently desired translation velocity
Returns
Proposed translation velocity to stop at given distance

Definition at line 316 of file abstract_drive_mode.h.

Referenced by fawkes::ForwardOmniDriveModule::update(), fawkes::BackwardDriveModule::~BackwardDriveModule(), and fawkes::ForwardDriveModule::~ForwardDriveModule().

◆ lin_interpol()

float fawkes::AbstractDriveMode::lin_interpol ( float  x,
float  x1,
float  x2,
float  y1,
float  y2 
)
inlineprotected

Perform linear interpolation.

Performs linear interpolation.

Parameters
xx
x1x1
x2x2
y1y1
y2y2
Returns
interpolated value

Definition at line 303 of file abstract_drive_mode.h.

Referenced by fawkes::BackwardDriveModule::~BackwardDriveModule(), and fawkes::ForwardDriveModule::~ForwardDriveModule().

◆ set_current_colli_mode()

void fawkes::AbstractDriveMode::set_current_colli_mode ( NavigatorInterface::OrientationMode  orient,
bool  stop 
)
inline

Set the colli mode values for each drive mode.

Has to be set before update!

Parameters
orientOrient at target after target position reached?
stopStop at target position?

Definition at line 253 of file abstract_drive_mode.h.

References orient_mode_, and stop_at_target_.

Referenced by fawkes::BiwardDriveModule::update(), and fawkes::SelectDriveMode::update().

◆ set_current_robo_pos()

void fawkes::AbstractDriveMode::set_current_robo_pos ( float  x,
float  y,
float  ori 
)
inline

Sets the current robo position.

Has to be set before update!

Parameters
xThe robot x position
yThe robot y position
oriThe robot orientation

Definition at line 223 of file abstract_drive_mode.h.

References fawkes::field_pos_t::ori, robot_, fawkes::field_pos_t::x, and fawkes::field_pos_t::y.

Referenced by fawkes::BiwardDriveModule::update(), and fawkes::SelectDriveMode::update().

◆ set_current_robo_speed()

void fawkes::AbstractDriveMode::set_current_robo_speed ( float  x,
float  y,
float  rot 
)
inline

Sets the current robo speed.

Has to be set before update!

Parameters
xThe robot translation velocity in x-direction only
yThe robot translation velocity in y-direction only
rotThe robot rotation velocity

Definition at line 237 of file abstract_drive_mode.h.

References robot_speed_, robot_vel_, fawkes::colli_trans_rot_t::rot, fawkes::colli_trans_rot_t::x, and fawkes::colli_trans_rot_t::y.

Referenced by fawkes::BiwardDriveModule::update(), and fawkes::SelectDriveMode::update().

◆ set_current_target()

void fawkes::AbstractDriveMode::set_current_target ( float  x,
float  y,
float  ori 
)
inline

Sets the current target.

Has to be set before update!

Parameters
xThe target x position
yThe target y position
oriThe target orientation

Definition at line 209 of file abstract_drive_mode.h.

References fawkes::field_pos_t::ori, target_, fawkes::field_pos_t::x, and fawkes::field_pos_t::y.

Referenced by fawkes::BiwardDriveModule::update(), and fawkes::SelectDriveMode::update().

◆ set_local_target()

void fawkes::AbstractDriveMode::set_local_target ( float  x,
float  y 
)
inline

Set the local targetpoint found by the search.

Has to be set before update!

Parameters
xThe local target x position
yThe local target y position

Definition at line 266 of file abstract_drive_mode.h.

References local_target_, fawkes::cart_coord_2d_struct::x, and fawkes::cart_coord_2d_struct::y.

Referenced by fawkes::BiwardDriveModule::update(), and fawkes::SelectDriveMode::update().

◆ set_local_trajec()

void fawkes::AbstractDriveMode::set_local_trajec ( float  x,
float  y 
)
inline

Set the local trajectory point found by the search.

Has to be set before update!

Parameters
xThe local target x trajectory
yThe local target y trajectory

Definition at line 278 of file abstract_drive_mode.h.

References local_trajec_, fawkes::cart_coord_2d_struct::x, and fawkes::cart_coord_2d_struct::y.

Referenced by fawkes::BiwardDriveModule::update(), and fawkes::SelectDriveMode::update().

◆ update()

Member Data Documentation

◆ config_

◆ drive_mode_

◆ local_target_

◆ local_trajec_

cart_coord_2d_t fawkes::AbstractDriveMode::local_trajec_
protected

◆ logger_

◆ max_rot_

◆ max_trans_

◆ orient_mode_

NavigatorInterface::OrientationMode fawkes::AbstractDriveMode::orient_mode_
protected

orient mode of nav if

Definition at line 102 of file abstract_drive_mode.h.

Referenced by set_current_colli_mode(), and fawkes::BiwardDriveModule::update().

◆ proposed_

◆ robot_

field_pos_t fawkes::AbstractDriveMode::robot_
protected

◆ robot_speed_

float fawkes::AbstractDriveMode::robot_speed_
protected

current robo translation velocity

Definition at line 97 of file abstract_drive_mode.h.

Referenced by set_current_robo_speed(), fawkes::ForwardDriveModule::update(), and fawkes::BackwardDriveModule::update().

◆ robot_vel_

◆ stop_at_target_

◆ target_

field_pos_t fawkes::AbstractDriveMode::target_
protected

The documentation for this class was generated from the following file: