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