MRPT logo

mrpt::reactivenav::CReactiveNavigationSystem Class Reference

Implements a reactive navigation system based on TP-Space, with an arbitrary holonomic reactive method running on it, and any desired number of PTG for transforming the navigation space. More...

#include <mrpt/reactivenav/CReactiveNavigationSystem.h>

Inheritance diagram for mrpt::reactivenav::CReactiveNavigationSystem:

mrpt::reactivenav::CAbstractReactiveNavigationSystem

List of all members.

Classes

class  CDynamicWindow
 For taken the dynamics of the robot into account. More...
struct  THolonomicMovement
 The structure used for storing a movement generated by a holonomic-method . More...

Public Types

enum  TNavigatorBehavior {
  beNormalNavigation = 0, beHeadDirection, beDoorCrosing1, beDoorCrosing2,
  beDoorCrosing3
}
 See 'navigatorBehavior'. More...

Public Member Functions

 CReactiveNavigationSystem (TRobotMotionControl &rmc, TSensors &sensors, void(*emul_printf)(const char *s), TEventsLaunching &evnts, const mrpt::utils::CConfigFileBase &configIni, const mrpt::utils::CConfigFileBase &configRobotIni, bool enableConsoleOutput=true, bool enableLogFile=false)
 Constructor.
virtual ~CReactiveNavigationSystem ()
 Destructor.
void loadConfigFile (const mrpt::utils::CConfigFileBase &ini, const mrpt::utils::CConfigFileBase &robotIni)
 Reload the configuration from a file.
void initialize ()
 Must be called for loading collision grids, or the first navigation command may last a long time to be executed.
float evaluate (TNavigationParams *params)
 Evaluate navigation hardness:.
void navigate (TNavigationParams *params)
 Start navigation:.
void setParams (TNavigationParams *params)
 Change current navigation params:.
void setHolonomicMethod (THolonomicMethod method, const char *config_INIfile="./CONFIG_ReactiveNavigator.ini")
 Selects which one from the set of available holonomic methods will be used into transformed TP-Space, and sets its configuration from a configuration file.
void changeRobotShape (math::CPolygon &shape)
 Change the robot shape, which is taken into account for collision grid building.
void getLastLogRecord (CLogFileRecord &o)
 Provides a copy of the last log record with information about execution.

Private Member Functions

void performNavigationStep ()
 The main method for the navigator.
void enableLogFile (bool enable)
 Enables / disables the logging into a file.
void STEP1_CollisionGridsBuilder ()
bool STEP2_Sense (mrpt::slam::CSimplePointsMap &out_obstacles, mrpt::slam::COccupancyGridMap2D *out_obstaclesGridMap=NULL)
void STEP3_SpaceTransformer (poses::CPointsMap &in_obstacles, CParameterizedTrajectoryGenerator *in_PTG, vector_float &out_TPObstacles, unsigned int securityDistanceIndex)
void STEP4_HolonomicMethod (vector_float &in_Obstacles, poses::CPoint2D &in_Target, float in_maxRobotSpeed, THolonomicMovement &out_selectedMovement, CHolonomicLogFileRecordPtr &in_HLFR)
void STEP5_Evaluator (THolonomicMovement &in_holonomicMovement, vector_float &in_TPObstacles, poses::CPoint2D &WS_Target, poses::CPoint2D &TP_Target, bool wasSelectedInLast, CLogFileRecord::TInfoPerPTG &log, unsigned int securityDistanceIndex)
void STEP6_Selector (std::vector< THolonomicMovement > &in_holonomicMovements, THolonomicMovement &out_selectedHolonomicMovement, int &out_nSelectedPTG)
void STEP7_NonHolonomicMovement (THolonomicMovement &in_movement, float &out_v, float &out_w)
bool PointIsIntoPolygon (float x, float y, float v1x, float v1y, float v2x, float v2y, float v3x, float v3y, float v4x, float v4y)
void Error_ParadaDeEmergencia (const char *msg)

Private Attributes

TNavigatorBehavior navigatorBehavior
 This defines the 'behavior' of the navigator (see posible values in TNavigatorBehavior).
float m_beHeadDirection_rad
 The desired heading direction (in rads), for behaviors 'beHeadDirection' and 'beDoorCrosing2'.
CPoint2D m_beAuxTarget
 Auxiliary target position, for behaviors 'beDoorCrosing1' and 'beDoorCrosing3'.
CPoint2D m_bePassPoint1
 This is the desired "path" for passing a door (in GLOBAL coordinates!).
CPoint2D m_bePassPoint2
CLogFileRecord lastLogRecord
 The last log.
float last_cmd_v
 For the histeresis:.
float last_cmd_w
bool navigationEndEventSent
 Will be false until the navigation end is sent, and it is reset with each new command.
synch::CCriticalSection critZoneLastLog
 Critical zones:.
synch::CCriticalSection critZoneNavigating
vector_float securityDistances
 The number of security distances to test.
CAbstractHolonomicReactiveMethodholonomicMethod
 The current log file stream, or NULL if not being used.
utils::CStreamlogFile
 The current log file stream, or NULL if not being used.
bool enableConsoleOutput
 Enables / disables the console debug output.
CTicTac timerForExecutionPeriod
std::string robotName
float refDistance
float colGridRes_x
float colGridRes_y
float robotMax_V_mps
float robotMax_W_degps
float ROBOTMODEL_TAU
float ROBOTMODEL_DELAY
vector_float weights
float minObstaclesHeight
float maxObstaclesHeight
float DIST_TO_TARGET_FOR_SENDING_EVENT
float DOOR_CROSSING_SEARCH_TARGET_DISTANCEx2
float VORONOI_MINIMUM_CLEARANCE
float DISABLE_PERIOD_AFTER_FAIL
float VORONOI_PATH_DIST_FROM_DOORWAY
float DOORCROSSING_HEADING_ACCURACY_DEG
float DOORCROSSING_ROTATION_CTE_DEG
float DOOR_CROSSING_DIST_TO_AUX_TARGETS
float DOOR_CROOSING_BEH3_TIMEOUT
float DOOR_CROSSING_MAXIMUM_DOORWAY_SIZE
unsigned long nIteration
 The iterations count.
float meanExecutionPeriod
 Runtime estimation of execution period of the method.
float badNavAlarm_minDistTarget
 For sending an alarm (error event) when it seems that we are not approaching toward the target in a while.
mrpt::system::TTimeStamp badNavAlarm_lastMinDistTime
float badNavAlarm_AlarmTimeout
math::CPolygon robotShape
 The robot 2D shape model.
bool collisionGridsMustBeUpdated
std::vector
< CParameterizedTrajectoryGenerator * > 
PTGs
 The set of transformations to be used:.
bool CerrandoHilo


Detailed Description

Implements a reactive navigation system based on TP-Space, with an arbitrary holonomic reactive method running on it, and any desired number of PTG for transforming the navigation space.

Both, the holonomic method and the PTGs can be customized by the apropriate user derived classes. For running it, the method NavigateStep must be invoked periodically.

See also:
CAbstractReactiveNavigationSystem, CParameterizedTrajectoryGenerator, CAbstractHolonomicReactiveMethod

Definition at line 71 of file CReactiveNavigationSystem.h.


Member Enumeration Documentation

See 'navigatorBehavior'.

Enumerator:
beNormalNavigation  The robot tries to get to the given target point.
beHeadDirection  The robot rotates to head the direction "m_beHeadDirection_rad", then goes into normal behavior.
beDoorCrosing1  The robot tries to get to a given auxiliar target "m_beAuxTarget", then goes into behavior 'beDoorCrosing2'.
beDoorCrosing2  The robot rotates to head the direction "m_beHeadDirection_rad", then goes into behavior 'beDoorCrosing3'.
beDoorCrosing3  The robot rotates tries to get to a given auxiliar target "m_beAuxTarget", then goes into normal behavior.

Definition at line 139 of file CReactiveNavigationSystem.h.


Constructor & Destructor Documentation

mrpt::reactivenav::CReactiveNavigationSystem::CReactiveNavigationSystem ( TRobotMotionControl rmc,
TSensors sensors,
void(*)(const char *s)  emul_printf,
TEventsLaunching evnts,
const mrpt::utils::CConfigFileBase configIni,
const mrpt::utils::CConfigFileBase configRobotIni,
bool  enableConsoleOutput = true,
bool  enableLogFile = false 
)

Constructor.

Parameters:
configINIFile The file to load the configuration from. See loadConfigFile
robotConfigFile The file to load the robot specific configuration from.
rmc A set of wrappers that must be filled in.
sensors A set of wrappers that must be filled in.
dbg A set of wrappers that must be filled in.
evnts A set of wrappers that must be filled in.
enableConsoleOutput Set to false if console output is not desired.
enableLogFile Set to true to enable logging to file.

virtual mrpt::reactivenav::CReactiveNavigationSystem::~CReactiveNavigationSystem (  )  [virtual]

Destructor.


Member Function Documentation

void mrpt::reactivenav::CReactiveNavigationSystem::changeRobotShape ( math::CPolygon shape  ) 

Change the robot shape, which is taken into account for collision grid building.

void mrpt::reactivenav::CReactiveNavigationSystem::enableLogFile ( bool  enable  )  [private]

Enables / disables the logging into a file.

void mrpt::reactivenav::CReactiveNavigationSystem::Error_ParadaDeEmergencia ( const char *  msg  )  [private]

float mrpt::reactivenav::CReactiveNavigationSystem::evaluate ( TNavigationParams params  )  [virtual]

Evaluate navigation hardness:.

Implements mrpt::reactivenav::CAbstractReactiveNavigationSystem.

void mrpt::reactivenav::CReactiveNavigationSystem::getLastLogRecord ( CLogFileRecord o  ) 

Provides a copy of the last log record with information about execution.

On any unexpected error "*o" will be NULL.

Parameters:
o An object where the log will be stored into.

void mrpt::reactivenav::CReactiveNavigationSystem::initialize (  ) 

Must be called for loading collision grids, or the first navigation command may last a long time to be executed.

void mrpt::reactivenav::CReactiveNavigationSystem::loadConfigFile ( const mrpt::utils::CConfigFileBase ini,
const mrpt::utils::CConfigFileBase robotIni 
)

Reload the configuration from a file.

void mrpt::reactivenav::CReactiveNavigationSystem::navigate ( TNavigationParams params  )  [virtual]

void mrpt::reactivenav::CReactiveNavigationSystem::performNavigationStep (  )  [private, virtual]

The main method for the navigator.

Implements mrpt::reactivenav::CAbstractReactiveNavigationSystem.

bool mrpt::reactivenav::CReactiveNavigationSystem::PointIsIntoPolygon ( float  x,
float  y,
float  v1x,
float  v1y,
float  v2x,
float  v2y,
float  v3x,
float  v3y,
float  v4x,
float  v4y 
) [private]

void mrpt::reactivenav::CReactiveNavigationSystem::setHolonomicMethod ( THolonomicMethod  method,
const char *  config_INIfile = "./CONFIG_ReactiveNavigator.ini" 
)

Selects which one from the set of available holonomic methods will be used into transformed TP-Space, and sets its configuration from a configuration file.

void mrpt::reactivenav::CReactiveNavigationSystem::setParams ( TNavigationParams params  )  [virtual]

Change current navigation params:.

Implements mrpt::reactivenav::CAbstractReactiveNavigationSystem.

void mrpt::reactivenav::CReactiveNavigationSystem::STEP1_CollisionGridsBuilder (  )  [private]

bool mrpt::reactivenav::CReactiveNavigationSystem::STEP2_Sense ( mrpt::slam::CSimplePointsMap out_obstacles,
mrpt::slam::COccupancyGridMap2D out_obstaclesGridMap = NULL 
) [private]

void mrpt::reactivenav::CReactiveNavigationSystem::STEP3_SpaceTransformer ( poses::CPointsMap in_obstacles,
CParameterizedTrajectoryGenerator in_PTG,
vector_float out_TPObstacles,
unsigned int  securityDistanceIndex 
) [private]

void mrpt::reactivenav::CReactiveNavigationSystem::STEP4_HolonomicMethod ( vector_float in_Obstacles,
poses::CPoint2D in_Target,
float  in_maxRobotSpeed,
THolonomicMovement out_selectedMovement,
CHolonomicLogFileRecordPtr &  in_HLFR 
) [private]

void mrpt::reactivenav::CReactiveNavigationSystem::STEP5_Evaluator ( THolonomicMovement in_holonomicMovement,
vector_float in_TPObstacles,
poses::CPoint2D WS_Target,
poses::CPoint2D TP_Target,
bool  wasSelectedInLast,
CLogFileRecord::TInfoPerPTG log,
unsigned int  securityDistanceIndex 
) [private]

void mrpt::reactivenav::CReactiveNavigationSystem::STEP6_Selector ( std::vector< THolonomicMovement > &  in_holonomicMovements,
THolonomicMovement out_selectedHolonomicMovement,
int &  out_nSelectedPTG 
) [private]

void mrpt::reactivenav::CReactiveNavigationSystem::STEP7_NonHolonomicMovement ( THolonomicMovement in_movement,
float &  out_v,
float &  out_w 
) [private]


Member Data Documentation

Definition at line 278 of file CReactiveNavigationSystem.h.

Definition at line 277 of file CReactiveNavigationSystem.h.

For sending an alarm (error event) when it seems that we are not approaching toward the target in a while.

..

Definition at line 276 of file CReactiveNavigationSystem.h.

Definition at line 334 of file CReactiveNavigationSystem.h.

Definition at line 247 of file CReactiveNavigationSystem.h.

Definition at line 247 of file CReactiveNavigationSystem.h.

Definition at line 284 of file CReactiveNavigationSystem.h.

Critical zones:.

Definition at line 212 of file CReactiveNavigationSystem.h.

Definition at line 212 of file CReactiveNavigationSystem.h.

Definition at line 257 of file CReactiveNavigationSystem.h.

Definition at line 253 of file CReactiveNavigationSystem.h.

Definition at line 262 of file CReactiveNavigationSystem.h.

Definition at line 261 of file CReactiveNavigationSystem.h.

Definition at line 263 of file CReactiveNavigationSystem.h.

Definition at line 255 of file CReactiveNavigationSystem.h.

Definition at line 259 of file CReactiveNavigationSystem.h.

Definition at line 260 of file CReactiveNavigationSystem.h.

Enables / disables the console debug output.

Definition at line 240 of file CReactiveNavigationSystem.h.

The current log file stream, or NULL if not being used.

Definition at line 234 of file CReactiveNavigationSystem.h.

For the histeresis:.

Definition at line 204 of file CReactiveNavigationSystem.h.

Definition at line 204 of file CReactiveNavigationSystem.h.

The last log.

Definition at line 200 of file CReactiveNavigationSystem.h.

The current log file stream, or NULL if not being used.

Definition at line 237 of file CReactiveNavigationSystem.h.

Auxiliary target position, for behaviors 'beDoorCrosing1' and 'beDoorCrosing3'.

Definition at line 174 of file CReactiveNavigationSystem.h.

The desired heading direction (in rads), for behaviors 'beHeadDirection' and 'beDoorCrosing2'.

Definition at line 170 of file CReactiveNavigationSystem.h.

This is the desired "path" for passing a door (in GLOBAL coordinates!).

Definition at line 178 of file CReactiveNavigationSystem.h.

Definition at line 178 of file CReactiveNavigationSystem.h.

Definition at line 252 of file CReactiveNavigationSystem.h.

Runtime estimation of execution period of the method.

Definition at line 271 of file CReactiveNavigationSystem.h.

Definition at line 252 of file CReactiveNavigationSystem.h.

Will be false until the navigation end is sent, and it is reset with each new command.

Definition at line 208 of file CReactiveNavigationSystem.h.

This defines the 'behavior' of the navigator (see posible values in TNavigatorBehavior).

Definition at line 166 of file CReactiveNavigationSystem.h.

The iterations count.

Definition at line 267 of file CReactiveNavigationSystem.h.

The set of transformations to be used:.

Definition at line 288 of file CReactiveNavigationSystem.h.

Definition at line 246 of file CReactiveNavigationSystem.h.

Definition at line 248 of file CReactiveNavigationSystem.h.

Definition at line 249 of file CReactiveNavigationSystem.h.

Definition at line 250 of file CReactiveNavigationSystem.h.

Definition at line 250 of file CReactiveNavigationSystem.h.

Definition at line 245 of file CReactiveNavigationSystem.h.

The robot 2D shape model.

Definition at line 283 of file CReactiveNavigationSystem.h.

The number of security distances to test.

..

Definition at line 216 of file CReactiveNavigationSystem.h.

Definition at line 242 of file CReactiveNavigationSystem.h.

Definition at line 256 of file CReactiveNavigationSystem.h.

Definition at line 258 of file CReactiveNavigationSystem.h.

Definition at line 251 of file CReactiveNavigationSystem.h.




Page generated by Doxygen 1.5.9 for MRPT 0.6.5 SVN: at Sun Aug 2 11:41:17 CDT 2009