Fawkes API  Fawkes Development Version
fawkes::AbstractDriveMode Class Referenceabstract

#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

Constructor.

Parameters
loggerThe fawkes logger
configThe fawkes configuration

Definition at line 131 of file abstract_drive_mode.h.

◆ ~AbstractDriveMode()

fawkes::AbstractDriveMode::~AbstractDriveMode ( )
inlinevirtual

Desctructor.

Definition at line 156 of file abstract_drive_mode.h.

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 278 of file abstract_drive_mode.h.

◆ 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 187 of file abstract_drive_mode.h.

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

◆ 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 167 of file abstract_drive_mode.h.

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

◆ 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 177 of file abstract_drive_mode.h.

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

◆ 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 304 of file abstract_drive_mode.h.

◆ 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 292 of file abstract_drive_mode.h.

References fawkes::distance().

◆ 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 243 of file abstract_drive_mode.h.

◆ 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 213 of file abstract_drive_mode.h.

◆ 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 227 of file abstract_drive_mode.h.

◆ 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 199 of file abstract_drive_mode.h.

◆ 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 255 of file abstract_drive_mode.h.

◆ 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 267 of file abstract_drive_mode.h.

◆ update()

virtual void fawkes::AbstractDriveMode::update ( )
pure virtual

Member Data Documentation

◆ config_

Configuration* fawkes::AbstractDriveMode::config_
protected

The fawkes configuration.

Definition at line 107 of file abstract_drive_mode.h.

◆ drive_mode_

NavigatorInterface::DriveMode fawkes::AbstractDriveMode::drive_mode_
protected

the drive mode name

Definition at line 104 of file abstract_drive_mode.h.

◆ local_target_

cart_coord_2d_t fawkes::AbstractDriveMode::local_target_
protected

local target

Definition at line 96 of file abstract_drive_mode.h.

◆ local_trajec_

cart_coord_2d_t fawkes::AbstractDriveMode::local_trajec_
protected

local trajectory

Definition at line 97 of file abstract_drive_mode.h.

◆ logger_

Logger* fawkes::AbstractDriveMode::logger_
protected

◆ max_rot_

float fawkes::AbstractDriveMode::max_rot_
protected

The maximum rotation speed.

Definition at line 110 of file abstract_drive_mode.h.

◆ max_trans_

float fawkes::AbstractDriveMode::max_trans_
protected

The maximum translation speed.

Definition at line 109 of file abstract_drive_mode.h.

◆ orient_mode_

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

orient mode of nav if

Definition at line 99 of file abstract_drive_mode.h.

◆ proposed_

colli_trans_rot_t fawkes::AbstractDriveMode::proposed_
protected

proposed translation and rotation for next timestep

Definition at line 102 of file abstract_drive_mode.h.

Referenced by get_proposed_trans_x(), get_proposed_trans_y(), fawkes::BiwardDriveModule::~BiwardDriveModule(), and fawkes::EscapeDriveModule::~EscapeDriveModule().

◆ robot_

field_pos_t fawkes::AbstractDriveMode::robot_
protected

current robot pos

Definition at line 91 of file abstract_drive_mode.h.

◆ robot_speed_

float fawkes::AbstractDriveMode::robot_speed_
protected

current robo translation velocity

Definition at line 94 of file abstract_drive_mode.h.

◆ robot_vel_

colli_trans_rot_t fawkes::AbstractDriveMode::robot_vel_
protected

current robot velocity

Definition at line 93 of file abstract_drive_mode.h.

◆ stop_at_target_

bool fawkes::AbstractDriveMode::stop_at_target_
protected

flag if stopping on or after target

Definition at line 100 of file abstract_drive_mode.h.

◆ target_

field_pos_t fawkes::AbstractDriveMode::target_
protected

current target

Definition at line 90 of file abstract_drive_mode.h.

Referenced by get_proposed_rot().


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