9 #ifndef CAbstractPTGBasedReactive_H
10 #define CAbstractPTGBasedReactive_H
72 bool enableConsoleOutput =
true,
73 bool enableLogFile =
false);
91 const std::string §ion );
117 m_timelogger.enable(
true);
231 const std::vector<float> & in_TPObstacles,
Base class for reactive navigator systems based on TP-Space, with an arbitrary holonomic reactive met...
float colGridRes
CollisionGrid resolution.
bool m_enableKeepLogRecords
See enableKeepLogRecords.
bool m_enableConsoleOutput
Enables / disables the console debug output.
virtual void loggingGetWSObstaclesAndShape(CLogFileRecord &out_log)=0
Generates a pointcloud of obstacles, and the robot shape, to be saved in the logging record for the c...
float meanExecutionPeriod
Runtime estimation of execution period of the method.
CLogFileRecord lastLogRecord
The last log.
void getLastLogRecord(CLogFileRecord &o)
Provides a copy of the last log record with information about execution.
mrpt::utils::CTicTac executionTime
std::string ptg_cache_files_directory
(Default: ".")
float badNavAlarm_minDistTarget
For sending an alarm (error event) when it seems that we are not approaching toward the target in a w...
bool m_init_done
Whether loadConfigFile() has been called or not.
void performNavigationStep()
The main method for the navigator.
std::vector< CAbstractHolonomicReactiveMethod * > m_holonomicMethod
The holonomic navigation algorithm (one object per PTG, so internal states are maintained)
float robotMax_V_mps
Max. linear speed (m/s)
virtual void navigate(const TNavigationParams *params)
Start navigation:
bool m_closing_navigator
Signal that the destructor has been called, so no more calls are accepted from other threads.
void initialize()
Must be called for loading collision grids, or the first navigation command may last a long time to b...
mrpt::system::TTimeStamp badNavAlarm_lastMinDistTime
void deleteHolonomicObjects()
Delete m_holonomicMethod.
virtual size_t getPTG_count() const =0
Returns the number of different PTGs that have been setup.
CAbstractPTGBasedReactive(CReactiveInterfaceImplementation &react_iterf_impl, bool enableConsoleOutput=true, bool enableLogFile=false)
Constructor.
void preDestructor()
To be called during children destructors to assure thread-safe destruction, and free of shared object...
synch::CCriticalSection m_critZoneLastLog
void enableLogFile(bool enable)
Enables/disables saving log files.
mrpt::utils::CStream * m_logFile
The current log file stream, or NULL if not being used.
mrpt::utils::CTicTac timerForExecutionPeriod
float SPEEDFILTER_TAU
Time constant for the low-pass filter applied to the speed commands.
std::vector< float > weights
length: 6 [0,5]
virtual ~CAbstractPTGBasedReactive()
float refDistance
"D_{max}" in papers.
float robotMax_W_degps
Max. angular speed (deg/s)
virtual void STEP7_GenerateSpeedCommands(const THolonomicMovement &in_movement)
void setHolonomicMethod(THolonomicMethod method, const mrpt::utils::CConfigFileBase &cfgBase)
Selects which one from the set of available holonomic methods will be used into transformed TP-Space,...
virtual void STEP1_CollisionGridsBuilder()=0
virtual CParameterizedTrajectoryGenerator * getPTG(size_t i)=0
Gets the i'th PTG.
virtual bool STEP2_SenseObstacles()=0
Return false on any fatal error.
void enableTimeLog(bool enable=true)
Enables/disables the detailed time logger (default:disabled upon construction) When enabled,...
std::string robotName
Robot name.
std::vector< TInfoPerPTG > m_infoPerPTG
Temporary buffers for working with each PTG during a navigationStep()
void loadHolonomicMethodConfig(const mrpt::utils::CConfigFileBase &ini, const std::string §ion)
Just loads the holonomic method params from the given config source.
const mrpt::utils::CTimeLogger & getTimeLogger() const
Gives access to a const-ref to the internal time logger.
void doEmergencyStop(const char *msg)
Stops the robot and set navigation state to error.
void enableKeepLogRecords(bool enable=true)
Enables keeping an internal registry of navigation logs that can be queried with getLastLogRecord()
mrpt::utils::CTimeLogger m_timelogger
A complete time logger.
void STEP5_PTGEvaluator(THolonomicMovement &holonomicMovement, const std::vector< float > &in_TPObstacles, const mrpt::math::TPose2D &WS_Target, const mrpt::math::TPoint2D &TP_Target, CLogFileRecord::TInfoPerPTG &log)
Scores holonomicMovement.
float DIST_TO_TARGET_FOR_SENDING_EVENT
virtual void STEP3_WSpaceToTPSpace(const size_t ptg_idx, std::vector< float > &out_TPObstacles)=0
Builds TP-Obstacles from Workspace obstacles for the given PTG.
bool navigationEndEventSent
Will be false until the navigation end is sent, and it is reset with each new command.
bool m_collisionGridsMustBeUpdated
float badNavAlarm_AlarmTimeout
This is the base class for any reactive navigation system.
A class for storing, saving and loading a reactive navigation log record for the CReactiveNavigationS...
This is the base class for any user-defined PTG.
The pure virtual class that a user of CAbstractReactiveNavigationSystem-derived classes must implemen...
This class provides simple critical sections functionality.
This class allows loading and storing values and vectors of different types from a configuration text...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This class implements a high-performance stopwatch.
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X),...
THolonomicMethod
The implemented reactive navigation methods.
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
The structure used for storing a movement generated by a holonomic-method.
CParameterizedTrajectoryGenerator * PTG
The associated PTG.
double evaluation
An evaluation in the range [0,1] for the goodness of the movement.
bool valid_TP
For each PTG, whether the target falls into the PTG domain.
std::vector< float > TP_Obstacles
One distance per discretized alpha value, describing the "polar plot" of TP obstacles.
mrpt::math::TPoint2D TP_Target
The Target, in TP-Space (x,y)
The struct for configuring navigation requests to CAbstractPTGBasedReactive and derived classes.
virtual ~TNavigationParamsPTG()
virtual TNavigationParams * clone() const
virtual std::string getAsText() const
Gets navigation params as a human-readable format.
std::vector< size_t > restrict_PTG_indices
(Default=empty) Optionally, a list of PTG indices can be sent such that the navigator will restrict i...
The struct for configuring navigation requests.
The structure used to store all relevant information about each transformation into TP-Space.