MRPT
2.0.4
|
Base class for reactive navigator systems based on TP-Space, with an arbitrary holonomic reactive method running on it and any number of PTGs for transforming the navigation space.
Both, the holonomic method and the PTGs can be customized by the apropriate user derived classes.
How to use:
For working examples, refer to the source code of the apps:
Publications:
Available "variables" or "score names" for each motion candidate (these can be used in runtime-compiled expressions in the configuration files of motion deciders):
clearance
: Clearance (larger means larger distances to obstacles) for the path from "current pose" up to "end of trajectory".collision_free_distance
: Normalized [0,1] collision-free distance in selected path. For NOP candidates, the traveled distances is substracted.dist_eucl_final
: Euclidean distance (in the real-world WordSpace) between "end of trajectory" and target.eta
: Estimated Time of Arrival at "end of trajectory".holo_stage_eval
: Final evaluation of the selected direction from inside of the holonomic algorithm.hysteresis
: Measure of similarity with previous command [0,1]is_PTG_cont
: 1 (is "NOP" motion command), 0 otherwiseis_slowdown
: 1 if PTG returns true in CParameterizedTrajectoryGenerator::supportSpeedAtTarget() for this step.move_cur_d
: Normalized distance already traveled over the selected PTG. Normally 0, unless in a "NOP motion".move_k
: Motion candidate path 0-based index.num_paths
: Number of paths in the PTGoriginal_col_free_dist
: Only for "NOP motions", the collision-free distance when the motion command was originally issued.ptg_idx
: PTG index (0-based)ptg_priority
: Product of PTG getScorePriority() times PTG evalPathRelativePriority()ref_dist
: PTG ref distance [m]robpose_x
, robpose_y
, robpose_phi
: Robot pose ([m] and [rad]) at the "end of trajectory": at collision or at target distance.target_d_norm
: Normalized target distance. Can be >1 if distance is larger than ref_distance.target_dir
: Angle of target in TP-Space [rad]target_k
: Same as target_dir but in discrete path 0-based indices.WS_target_x
, WS_target_y
: Target coordinates in realworld [m]Definition at line 92 of file CAbstractPTGBasedReactive.h.
#include <mrpt/nav/reactive/CAbstractPTGBasedReactive.h>
Classes | |
struct | PTGTarget |
struct | TAbstractPTGNavigatorParams |
struct | TInfoPerPTG |
struct | TNavigationParamsPTG |
The struct for configuring navigation requests to CAbstractPTGBasedReactive and derived classes. More... | |
struct | TSentVelCmd |
Public Member Functions | |
CAbstractPTGBasedReactive (CRobot2NavInterface &react_iterf_impl, bool enableConsoleOutput=true, bool enableLogFile=false, const std::string &logFileDirectory=std::string("./reactivenav.logs")) | |
Constructor. More... | |
~CAbstractPTGBasedReactive () override | |
void | initialize () override |
Must be called for loading collision grids, or the first navigation command may last a long time to be executed. More... | |
void | setHolonomicMethod (const std::string &method, const mrpt::config::CConfigFileBase &cfgBase) |
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. More... | |
void | getLastLogRecord (CLogFileRecord &o) |
Provides a copy of the last log record with information about execution. More... | |
void | enableKeepLogRecords (bool enable=true) |
Enables keeping an internal registry of navigation logs that can be queried with getLastLogRecord() More... | |
void | enableLogFile (bool enable) |
Enables/disables saving log files. More... | |
void | setLogFileDirectory (const std::string &sDir) |
Changes the prefix for new log files. More... | |
std::string | getLogFileDirectory () const |
void | loadConfigFile (const mrpt::config::CConfigFileBase &c) override |
Loads all params from a file. More... | |
void | saveConfigFile (mrpt::config::CConfigFileBase &c) const override |
Saves all current options to a config file. More... | |
void | enableTimeLog (bool enable=true) |
Enables/disables the detailed time logger (default:disabled upon construction) When enabled, a report will be dumped to std::cout upon destruction. More... | |
const mrpt::system::CTimeLogger & | getTimeLogger () const |
Gives access to a const-ref to the internal time logger. More... | |
virtual size_t | getPTG_count () const =0 |
Returns the number of different PTGs that have been setup. More... | |
virtual CParameterizedTrajectoryGenerator * | getPTG (size_t i)=0 |
Gets the i'th PTG. More... | |
virtual const CParameterizedTrajectoryGenerator * | getPTG (size_t i) const =0 |
Gets the i'th PTG. More... | |
const mrpt::kinematics::CVehicleVelCmd::TVelCmdParams & | getCurrentRobotSpeedLimits () const |
Get the current, global (honored for all PTGs) robot speed limits. More... | |
mrpt::kinematics::CVehicleVelCmd::TVelCmdParams & | changeCurrentRobotSpeedLimits () |
Changes the current, global (honored for all PTGs) robot speed limits, via returning a reference to a structure that holds those limits. More... | |
void | setTargetApproachSlowDownDistance (const double dist) |
Changes this parameter in all inner holonomic navigator instances [m]. More... | |
double | getTargetApproachSlowDownDistance () const |
Returns this parameter for the first inner holonomic navigator instances [m] (should be the same in all of them?) More... | |
void | navigationStep () override |
This method must be called periodically in order to effectively run the navigation. More... | |
void | cancel () override |
Cancel current navegation. More... | |
bool | isRelativePointReachable (const mrpt::math::TPoint2D &wp_local_wrt_robot) const |
Returns true if, according to the information gathered at the last navigation step, there is a free path to the given point; false otherwise: if way is blocked or there is missing information, the point is out of range for the existing PTGs, etc. More... | |
const mrpt::system::CTimeLogger & | getDelaysTimeLogger () const |
Gives access to a const-ref to the internal time logger used to estimate delays. More... | |
Waypoint navigation control API | |
virtual void | navigateWaypoints (const TWaypointSequence &nav_request) |
Waypoint navigation request. More... | |
virtual void | getWaypointNavStatus (TWaypointStatusSequence &out_nav_status) const |
Get a copy of the control structure which describes the progress status of the waypoint navigation. More... | |
TWaypointStatusSequence | getWaypointNavStatus () const |
Get a copy of the control structure which describes the progress status of the waypoint navigation. More... | |
Static Public Member Functions | |
static std::array< mrpt::system::TConsoleColor, NUMBER_OF_VERBOSITY_LEVELS > & | logging_levels_to_colors () |
Map from VerbosityLevels to their corresponding mrpt::system::TConsoleColor. More... | |
static std::array< std::string, NUMBER_OF_VERBOSITY_LEVELS > & | logging_levels_to_names () |
Map from VerbosityLevels to their corresponding names. More... | |
Public Attributes | |
TAbstractPTGNavigatorParams | params_abstract_ptg_navigator |
TWaypointsNavigatorParams | params_waypoints_navigator |
TAbstractNavigatorParams | params_abstract_navigator |
mrpt::system::CTimeLogger | m_navProfiler |
Publicly available time profiling object. More... | |
Protected Member Functions | |
void | performNavigationStep () override |
The main method for the navigator. More... | |
virtual CAbstractHolonomicReactiveMethod * | getHoloMethod (int idx) |
bool | impl_waypoint_is_reachable (const mrpt::math::TPoint2D &wp_local_wrt_robot) const override |
Implements the way to waypoint is free function in children classes: true must be returned if, according to the information gathered at the last navigation step, there is a free path to the given point; false otherwise: if way is blocked or there is missing information, the point is out of range, etc. More... | |
virtual void | STEP1_InitPTGs ()=0 |
virtual bool | implementSenseObstacles (mrpt::system::TTimeStamp &obs_timestamp)=0 |
Return false on any fatal error. More... | |
bool | STEP2_SenseObstacles () |
virtual void | STEP3_WSpaceToTPSpace (const size_t ptg_idx, std::vector< double > &out_TPObstacles, mrpt::nav::ClearanceDiagram &out_clearance, const mrpt::math::TPose2D &rel_pose_PTG_origin_wrt_sense, const bool eval_clearance)=0 |
Builds TP-Obstacles from Workspace obstacles for the given PTG. More... | |
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 current timestep. More... | |
void | calc_move_candidate_scores (TCandidateMovementPTG &holonomicMovement, const std::vector< double > &in_TPObstacles, const mrpt::nav::ClearanceDiagram &in_clearance, const std::vector< mrpt::math::TPose2D > &WS_Targets, const std::vector< PTGTarget > &TP_Targets, CLogFileRecord::TInfoPerPTG &log, CLogFileRecord &newLogRec, const bool this_is_PTG_continuation, const mrpt::math::TPose2D &relPoseVelCmd_NOP, const unsigned int ptg_idx4weights, const mrpt::system::TTimeStamp tim_start_iteration, const mrpt::nav::CHolonomicLogFileRecord::Ptr &hlfr) |
Scores holonomicMovement. More... | |
virtual double | generate_vel_cmd (const TCandidateMovementPTG &in_movement, mrpt::kinematics::CVehicleVelCmd::Ptr &new_vel_cmd) |
Return the [0,1] velocity scale of raw PTG cmd_vel. More... | |
void | STEP8_GenerateLogRecord (CLogFileRecord &newLogRec, const std::vector< mrpt::math::TPose2D > &relTargets, int nSelectedPTG, const mrpt::kinematics::CVehicleVelCmd::Ptr &new_vel_cmd, int nPTGs, const bool best_is_NOP_cmdvel, const math::TPose2D &rel_cur_pose_wrt_last_vel_cmd_NOP, const math::TPose2D &rel_pose_PTG_origin_wrt_sense_NOP, const double executionTimeValue, const double tim_changeSpeed, const mrpt::system::TTimeStamp &tim_start_iteration) |
void | preDestructor () |
To be called during children destructors to assure thread-safe destruction, and free of shared objects. More... | |
void | onStartNewNavigation () override |
Called whenever a new navigation has been started. More... | |
void | build_movement_candidate (CParameterizedTrajectoryGenerator *ptg, const size_t indexPTG, const std::vector< mrpt::math::TPose2D > &relTargets, const mrpt::math::TPose2D &rel_pose_PTG_origin_wrt_sense, TInfoPerPTG &ipf, TCandidateMovementPTG &holonomicMovement, CLogFileRecord &newLogRec, const bool this_is_PTG_continuation, mrpt::nav::CAbstractHolonomicReactiveMethod &holoMethod, const mrpt::system::TTimeStamp tim_start_iteration, const TNavigationParams &navp=TNavigationParams(), const mrpt::math::TPose2D &relPoseVelCmd_NOP=mrpt::math::TPose2D(0, 0, 0)) |
void | onNavigateCommandReceived () override |
Called after each call to CAbstractNavigator::navigate() More... | |
bool | checkHasReachedTarget (const double targetDist) const override |
Default implementation: check if target_dist is below the accepted distance. More... | |
virtual void | waypoints_navigationStep () |
The waypoints-specific part of navigationStep() More... | |
bool | waypoints_isAligning () const |
void | dispatchPendingNavEvents () |
virtual void | updateCurrentPoseAndSpeeds () |
Call to the robot getCurrentPoseAndSpeeds() and updates members m_curPoseVel accordingly. More... | |
virtual void | performNavigationStepNavigating (bool call_virtual_nav_method=true) |
Factorization of the part inside navigationStep(), for the case of state being NAVIGATING. More... | |
virtual void | processNavigateCommand (const TNavigationParams *params) |
Does the job of navigate(), except the call to onNavigateCommandReceived() More... | |
virtual void | doEmergencyStop (const std::string &msg) |
Stops the robot and set navigation state to error. More... | |
virtual bool | changeSpeeds (const mrpt::kinematics::CVehicleVelCmd &vel_cmd) |
Default: forward call to m_robot.changeSpeed(). More... | |
virtual bool | changeSpeedsNOP () |
Default: forward call to m_robot.changeSpeedsNOP(). More... | |
virtual bool | stop (bool isEmergencyStop) |
Default: forward call to m_robot.stop(). More... | |
virtual bool | checkCollisionWithLatestObstacles (const mrpt::math::TPose2D &relative_robot_pose) const |
Checks whether the robot shape, when placed at the given pose (relative to the current pose), is colliding with any of the latest known obstacles. More... | |
Private Member Functions | |
void | deleteHolonomicObjects () |
Delete m_holonomicMethod. More... | |
Private Attributes | |
std::string | m_navlogfiles_dir |
Default: "./reactivenav.logs". More... | |
double | m_expr_var_k |
double | m_expr_var_k_target |
double | m_expr_var_num_paths |
std::unique_ptr< TNavigationParams > | m_copy_prev_navParams |
A copy of last-iteration navparams, used to detect changes. More... | |
Navigation control API | |
virtual void | navigate (const TNavigationParams *params) |
Navigation request to a single target location. More... | |
virtual void | resume () |
Continues with suspended navigation. More... | |
virtual void | suspend () |
Suspend current navegation. More... | |
virtual void | resetNavError () |
Resets a NAV_ERROR state back to IDLE More... | |
TState | getCurrentState () const |
Returns the current navigator state. More... | |
const TErrorReason & | getErrorReason () const |
In case of state=NAV_ERROR, this returns the reason for the error. More... | |
void | setFrameTF (const std::weak_ptr< mrpt::poses::FrameTransformer< 2 >> &frame_tf) |
Sets a user-provided frame transformer object; used only if providing targets in a frame ID different than the one in which robot odometry is given (both IDs default to "map" ). More... | |
std::weak_ptr< mrpt::poses::FrameTransformer< 2 > > | getFrameTF () const |
Get the current frame tf object (defaults to nullptr) More... | |
void | enableRethrowNavExceptions (const bool enable) |
By default, error exceptions on navigationStep() will dump an error message to the output logger interface. More... | |
bool | isRethrowNavExceptionsEnabled () const |
enum | TState { IDLE = 0, NAVIGATING, SUSPENDED, NAV_ERROR } |
The different states for the navigation system. More... | |
enum | TErrorCode { ERR_NONE = 0, ERR_EMERGENCY_STOP, ERR_CANNOT_REACH_TARGET, ERR_OTHER } |
Explains the reason for the navigation error. More... | |
Logging methods | |
bool | logging_enable_console_output {true} |
[Default=true] Set it to false in case you don't want the logged messages to be dumped to the output automatically. More... | |
bool | logging_enable_keep_record {false} |
[Default=false] Enables storing all messages into an internal list. More... | |
void | logStr (const VerbosityLevel level, std::string_view msg_str) const |
Main method to add the specified message string to the logger. More... | |
void | logFmt (const VerbosityLevel level, const char *fmt,...) const MRPT_printf_format_check(3 |
Alternative logging method, which mimics the printf behavior. More... | |
void void | logCond (const VerbosityLevel level, bool cond, const std::string &msg_str) const |
Log the given message only if the condition is satisfied. More... | |
void | setLoggerName (const std::string &name) |
Set the name of the COutputLogger instance. More... | |
std::string | getLoggerName () const |
Return the name of the COutputLogger instance. More... | |
void | setMinLoggingLevel (const VerbosityLevel level) |
Set the minimum logging level for which the incoming logs are going to be taken into account. More... | |
void | setVerbosityLevel (const VerbosityLevel level) |
alias of setMinLoggingLevel() More... | |
VerbosityLevel | getMinLoggingLevel () const |
bool | isLoggingLevelVisible (VerbosityLevel level) const |
void | getLogAsString (std::string &log_contents) const |
Fill the provided string with the contents of the logger's history in std::string representation. More... | |
std::string | getLogAsString () const |
Get the history of COutputLogger instance in a string representation. More... | |
void | writeLogToFile (const std::string *fname_in=nullptr) const |
Write the contents of the COutputLogger instance to an external file. More... | |
void | dumpLogToConsole () const |
Dump the current contents of the COutputLogger instance in the terminal window. More... | |
std::string | getLoggerLastMsg () const |
Return the last Tmsg instance registered in the logger history. More... | |
void | getLoggerLastMsg (std::string &msg_str) const |
Fill inputtted string with the contents of the last message in history. More... | |
void | loggerReset () |
Reset the contents of the logger instance. More... | |
void | logRegisterCallback (output_logger_callback_t userFunc) |
bool | logDeregisterCallback (output_logger_callback_t userFunc) |
|
inherited |
Explains the reason for the navigation error.
Enumerator | |
---|---|
ERR_NONE | |
ERR_EMERGENCY_STOP | |
ERR_CANNOT_REACH_TARGET | |
ERR_OTHER |
Definition at line 184 of file CAbstractNavigator.h.
|
inherited |
The different states for the navigation system.
Enumerator | |
---|---|
IDLE | |
NAVIGATING | |
SUSPENDED | |
NAV_ERROR |
Definition at line 172 of file CAbstractNavigator.h.
CAbstractPTGBasedReactive::CAbstractPTGBasedReactive | ( | CRobot2NavInterface & | react_iterf_impl, |
bool | enableConsoleOutput = true , |
||
bool | enableLogFile = false , |
||
const std::string & | logFileDirectory = std::string("./reactivenav.logs") |
||
) |
Constructor.
[in] | react_iterf_impl | An instance of an object that implement all the required interfaces to read from and control a robot. |
[in] | enableConsoleOutput | Can be set to false to reduce verbosity. |
[in] | enableLogFile | Set to true to enable creation of navigation log files, useful for inspection and debugging. |
Definition at line 60 of file CAbstractPTGBasedReactive.cpp.
References enableLogFile().
|
override |
Definition at line 96 of file CAbstractPTGBasedReactive.cpp.
References preDestructor().
|
protected |
Definition at line 1538 of file CAbstractPTGBasedReactive.cpp.
References mrpt::nav::CLogFileRecord::additional_debug_msgs, mrpt::nav::CParameterizedTrajectoryGenerator::alpha2index(), ASSERT_, calc_move_candidate_scores(), mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::clearance, mrpt::nav::CLogFileRecord::TInfoPerPTG::clearance, mrpt::nav::CAbstractPTGBasedReactive::TInfoPerPTG::clearance, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::colfreedist_move_k, mrpt::containers::copy_container_typecasting(), mrpt::nav::CLogFileRecord::TInfoPerPTG::desiredDirection, mrpt::nav::CAbstractHolonomicReactiveMethod::NavOutput::desiredDirection, mrpt::nav::CLogFileRecord::TInfoPerPTG::desiredSpeed, mrpt::nav::CAbstractHolonomicReactiveMethod::NavOutput::desiredSpeed, mrpt::nav::TCandidateMovementPTG::direction, mrpt::nav::CAbstractHolonomicReactiveMethod::enableApproachTargetSlowDown(), mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::evaluate_clearance, mrpt::format(), mrpt::nav::CParameterizedTrajectoryGenerator::getAlphaValuesCount(), mrpt::nav::CParameterizedTrajectoryGenerator::getDescription(), getPTG_count(), mrpt::nav::CParameterizedTrajectoryGenerator::getRefDistance(), mrpt::nav::CLogFileRecord::TInfoPerPTG::HLFR, mrpt::hypot_fast(), mrpt::nav::CParameterizedTrajectoryGenerator::index2alpha(), mrpt::nav::CLogFileRecord::infoPerPTG, mrpt::nav::CParameterizedTrajectoryGenerator::initClearanceDiagram(), mrpt::nav::CParameterizedTrajectoryGenerator::initTPObstacles(), mrpt::nav::CParameterizedTrajectoryGenerator::inverseMap_WS2TP(), mrpt::system::CTimeLogger::isEnabled(), mrpt::nav::CAbstractHolonomicReactiveMethod::NavOutput::logRecord, mrpt::nav::CAbstractNavigator::m_curPoseVel, m_enableKeepLogRecords, m_lastSentVelCmd, m_logFile, mrpt::nav::CAbstractNavigator::m_navProfiler, m_timelogger, mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::maxObstacleDist, mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::maxRobotSpeed, mrpt::nav::CParameterizedTrajectoryGenerator::maxTimeInVelCmdNOP(), mrpt::nav::CAbstractHolonomicReactiveMethod::navigate(), mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::obstacles, params_abstract_ptg_navigator, mrpt::nav::TCandidateMovementPTG::props, mrpt::nav::TCandidateMovementPTG::PTG, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_alpha_index, mrpt::nav::CLogFileRecord::TInfoPerPTG::PTG_desc, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_index, mrpt::system::CTimeLogger::registerUserMeasure(), mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::secure_distance_end, mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::secure_distance_start, mrpt::nav::TCandidateMovementPTG::speed, STEP3_WSpaceToTPSpace(), mrpt::nav::CParameterizedTrajectoryGenerator::supportVelCmdNOP(), mrpt::system::CTicTac::Tac(), mrpt::nav::CAbstractNavigator::TNavigationParams::target, mrpt::nav::CAbstractPTGBasedReactive::PTGTarget::target_alpha, mrpt::nav::CAbstractPTGBasedReactive::PTGTarget::target_dist, mrpt::nav::CAbstractPTGBasedReactive::PTGTarget::target_k, mrpt::nav::CAbstractNavigator::TargetInfo::targetDesiredRelSpeed, mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::targets, mrpt::nav::CAbstractPTGBasedReactive::TInfoPerPTG::targets, mrpt::system::CTicTac::Tic(), tictac, mrpt::nav::CLogFileRecord::TInfoPerPTG::timeForHolonomicMethod, mrpt::nav::CLogFileRecord::TInfoPerPTG::timeForTPObsTransformation, mrpt::nav::CLogFileRecord::TInfoPerPTG::TP_Obstacles, mrpt::nav::CAbstractPTGBasedReactive::TInfoPerPTG::TP_Obstacles, mrpt::nav::CAbstractPTGBasedReactive::PTGTarget::TP_Target, mrpt::nav::CLogFileRecord::TInfoPerPTG::TP_Targets, mrpt::nav::CParameterizedTrajectoryGenerator::updateClearancePost(), mrpt::nav::CAbstractPTGBasedReactive::PTGTarget::valid_TP, mrpt::nav::CAbstractNavigator::TRobotPoseVel::velLocal, mrpt::math::TTwist2D::vx, mrpt::math::TTwist2D::vy, mrpt::math::TPoint2D_data< T >::x, and mrpt::math::TPoint2D_data< T >::y.
Referenced by performNavigationStep().
|
protected |
Scores holonomicMovement.
Definition at line 1006 of file CAbstractPTGBasedReactive.cpp.
References mrpt::nav::CLogFileRecord::additional_debug_msgs, mrpt::nav::CParameterizedTrajectoryGenerator::alpha2index(), mrpt::math::angDistance(), ASSERT_, ASSERT_EQUAL_, mrpt::math::TPose2D::asString(), mrpt::nav::TCandidateMovementPTG::direction, mrpt::nav::CParameterizedTrajectoryGenerator::directionToMotionCommand(), mrpt::nav::CParameterizedTrajectoryGenerator::evalClearanceSingleObstacle(), mrpt::nav::CParameterizedTrajectoryGenerator::evalPathRelativePriority(), mrpt::format(), mrpt::nav::ClearanceDiagram::getClearance(), getHoloMethod(), mrpt::nav::CParameterizedTrajectoryGenerator::getPathDist(), mrpt::nav::CParameterizedTrajectoryGenerator::getPathPose(), mrpt::nav::CParameterizedTrajectoryGenerator::getPathStepDuration(), mrpt::nav::CParameterizedTrajectoryGenerator::getPathStepForDist(), mrpt::nav::CParameterizedTrajectoryGenerator::getRefDistance(), mrpt::nav::CParameterizedTrajectoryGenerator::getScorePriority(), mrpt::nav::CAbstractHolonomicReactiveMethod::getTargetApproachSlowDownDistance(), mrpt::hypot_fast(), mrpt::nav::CParameterizedTrajectoryGenerator::index2alpha(), mrpt::nav::CParameterizedTrajectoryGenerator::inverseMap_WS2TP(), mrpt::nav::CParameterizedTrajectoryGenerator::isBijectiveAt(), mrpt::keep_min(), mrpt::nav::CAbstractNavigator::m_curPoseVel, m_holonomicMethod, m_last_vel_cmd, m_lastSentVelCmd, mrpt::nav::CAbstractNavigator::m_navigationParams, mrpt::nav::CAbstractNavigator::m_navProfiler, mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::max_dist_for_timebased_path_prediction, MRPT_END, MRPT_START, mrpt::system::now(), mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::original_holo_eval, params_abstract_ptg_navigator, mrpt::math::TPose2D::phi, mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::poseVel, mrpt::nav::TCandidateMovementPTG::props, mrpt::nav::TCandidateMovementPTG::PTG, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_alpha_index, mrpt::nav::CAbstractNavigator::TRobotPoseVel::rawOdometry, mrpt::round(), mrpt::nav::TCandidateMovementPTG::speed, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::speed_scale, mrpt::nav::TCandidateMovementPTG::starting_robot_dir, mrpt::nav::TCandidateMovementPTG::starting_robot_dist, mrpt::nav::CParameterizedTrajectoryGenerator::supportSpeedAtTarget(), mrpt::nav::CParameterizedTrajectoryGenerator::supportVelCmdNOP(), mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::tim_send_cmd_vel, mrpt::system::timeDifference(), mrpt::nav::CLogFileRecord::TInfoPerPTG::TP_Robot, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::was_slowdown, mrpt::math::TPoint2D_data< T >::x, mrpt::math::TPose2D::x, mrpt::math::TPoint2D_data< T >::y, and mrpt::math::TPose2D::y.
Referenced by build_movement_candidate().
|
overridevirtualinherited |
Cancel current navegation.
Reimplemented from mrpt::nav::CAbstractNavigator.
Definition at line 102 of file CWaypointsNavigator.cpp.
References mrpt::nav::CAbstractNavigator::cancel(), mrpt::nav::CWaypointsNavigator::m_nav_waypoints_cs, and mrpt::nav::CWaypointsNavigator::m_waypoint_nav_status.
|
inline |
Changes the current, global (honored for all PTGs) robot speed limits, via returning a reference to a structure that holds those limits.
Definition at line 271 of file CAbstractPTGBasedReactive.h.
References params_abstract_ptg_navigator, and mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::robot_absolute_speed_limits.
|
protectedvirtualinherited |
Default: forward call to m_robot.changeSpeed().
Can be overriden.
Definition at line 421 of file CAbstractNavigator.cpp.
References mrpt::nav::CRobot2NavInterface::changeSpeeds(), and mrpt::nav::CAbstractNavigator::m_robot.
Referenced by mrpt::nav::CNavigatorManualSequence::navigationStep(), performNavigationStep(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protectedvirtualinherited |
Default: forward call to m_robot.changeSpeedsNOP().
Can be overriden.
Definition at line 427 of file CAbstractNavigator.cpp.
References mrpt::nav::CRobot2NavInterface::changeSpeedsNOP(), and mrpt::nav::CAbstractNavigator::m_robot.
Referenced by performNavigationStep().
|
protectedvirtualinherited |
Checks whether the robot shape, when placed at the given pose (relative to the current pose), is colliding with any of the latest known obstacles.
Default implementation: always returns false.
Reimplemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Definition at line 688 of file CAbstractNavigator.cpp.
Referenced by mrpt::nav::CAbstractNavigator::performNavigationStepNavigating().
|
overrideprotectedvirtualinherited |
Default implementation: check if target_dist is below the accepted distance.
If true is returned here, the end-of-navigation event will be sent out (only for non-intermediary targets).
Reimplemented from mrpt::nav::CAbstractNavigator.
Definition at line 537 of file CWaypointsNavigator.cpp.
References mrpt::system::dateTimeLocalToString(), mrpt::nav::TWaypointStatus::getAsText(), INVALID_TIMESTAMP, mrpt::nav::CAbstractNavigator::m_navigationParams, mrpt::nav::CWaypointsNavigator::m_waypoint_nav_status, MRPT_LOG_DEBUG_STREAM, and mrpt::nav::TWaypointStatus::reached.
|
private |
Delete m_holonomicMethod.
Definition at line 201 of file CAbstractPTGBasedReactive.cpp.
References m_holonomicMethod.
Referenced by preDestructor(), and setHolonomicMethod().
|
protectedinherited |
Definition at line 246 of file CAbstractNavigator.cpp.
References mrpt::nav::CAbstractNavigator::m_pending_events.
Referenced by mrpt::nav::CWaypointsNavigator::navigationStep(), and mrpt::nav::CAbstractNavigator::navigationStep().
|
protectedvirtualinherited |
Stops the robot and set navigation state to error.
Definition at line 257 of file CAbstractNavigator.cpp.
References mrpt::nav::CAbstractNavigator::ERR_EMERGENCY_STOP, mrpt::nav::CAbstractNavigator::ERR_NONE, mrpt::nav::CAbstractNavigator::TErrorReason::error_code, mrpt::nav::CAbstractNavigator::TErrorReason::error_msg, mrpt::nav::CAbstractNavigator::m_navErrorReason, mrpt::nav::CAbstractNavigator::m_navigationState, MRPT_LOG_ERROR, mrpt::nav::CAbstractNavigator::NAV_ERROR, and mrpt::nav::CAbstractNavigator::stop().
Referenced by performNavigationStep().
|
inherited |
Dump the current contents of the COutputLogger instance in the terminal window.
Definition at line 190 of file COutputLogger.cpp.
|
inline |
Enables keeping an internal registry of navigation logs that can be queried with getLastLogRecord()
Definition at line 158 of file CAbstractPTGBasedReactive.h.
References m_enableKeepLogRecords.
void CAbstractPTGBasedReactive::enableLogFile | ( | bool | enable | ) |
Enables/disables saving log files.
Definition at line 118 of file CAbstractPTGBasedReactive.cpp.
References mrpt::system::createDirectory(), mrpt::system::directoryExists(), mrpt::system::fileExists(), mrpt::format(), mrpt::lockHelper(), m_logFile, mrpt::nav::CAbstractNavigator::m_nav_cs, m_navlogfiles_dir, MRPT_LOG_DEBUG, MRPT_LOG_DEBUG_FMT, MRPT_LOG_ERROR_FMT, ok, mrpt::io::CFileGZOutputStream::open(), and THROW_EXCEPTION_FMT.
Referenced by CAbstractPTGBasedReactive().
|
inlineinherited |
By default, error exceptions on navigationStep() will dump an error message to the output logger interface.
If rethrow is enabled (default=false), the error message will be reported as well, but exceptions will be re-thrown.
Definition at line 228 of file CAbstractNavigator.h.
References mrpt::nav::CAbstractNavigator::m_rethrow_exceptions.
|
inline |
Enables/disables the detailed time logger (default:disabled upon construction) When enabled, a report will be dumped to std::cout upon destruction.
Definition at line 246 of file CAbstractPTGBasedReactive.h.
References mrpt::system::CTimeLogger::enable(), and m_timelogger.
|
protectedvirtual |
Return the [0,1] velocity scale of raw PTG cmd_vel.
Definition at line 1414 of file CAbstractPTGBasedReactive.cpp.
References mrpt::nav::CParameterizedTrajectoryGenerator::alpha2index(), mrpt::nav::TCandidateMovementPTG::direction, mrpt::nav::CParameterizedTrajectoryGenerator::directionToMotionCommand(), mrpt::math::LowPassFilter_IIR1::getLastOutput(), mrpt::nav::CParameterizedTrajectoryGenerator::getSupportedKinematicVelocityCommand(), m_last_vel_cmd, m_timelogger, meanExecutionPeriod, MRPT_LOG_ERROR_STREAM, params_abstract_ptg_navigator, mrpt::nav::TCandidateMovementPTG::PTG, mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::robot_absolute_speed_limits, mrpt::nav::TCandidateMovementPTG::speed, and mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::speedfilter_tau.
Referenced by performNavigationStep().
|
inline |
Get the current, global (honored for all PTGs) robot speed limits.
Definition at line 263 of file CAbstractPTGBasedReactive.h.
References params_abstract_ptg_navigator, and mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::robot_absolute_speed_limits.
|
inlineinherited |
Returns the current navigator state.
Definition at line 181 of file CAbstractNavigator.h.
References mrpt::nav::CAbstractNavigator::m_navigationState.
|
inlineinherited |
Gives access to a const-ref to the internal time logger used to estimate delays.
Definition at line 262 of file CAbstractNavigator.h.
References mrpt::nav::CAbstractNavigator::m_timlog_delays.
|
inlineinherited |
In case of state=NAV_ERROR, this returns the reason for the error.
Error state is reseted every time a new navigation starts with a call to navigate(), or when resetNavError() is called.
Definition at line 204 of file CAbstractNavigator.h.
References mrpt::nav::CAbstractNavigator::m_navErrorReason.
|
inlineinherited |
Get the current frame tf object (defaults to nullptr)
Definition at line 218 of file CAbstractNavigator.h.
References mrpt::nav::CAbstractNavigator::m_frame_tf.
|
protectedvirtual |
Definition at line 2011 of file CAbstractPTGBasedReactive.cpp.
References m_holonomicMethod.
Referenced by calc_move_candidate_scores(), and performNavigationStep().
void CAbstractPTGBasedReactive::getLastLogRecord | ( | CLogFileRecord & | o | ) |
Provides a copy of the last log record with information about execution.
o | An object where the log will be stored into. |
Definition at line 195 of file CAbstractPTGBasedReactive.cpp.
References lastLogRecord, mrpt::lockHelper(), and m_critZoneLastLog.
|
inherited |
Fill the provided string with the contents of the logger's history in std::string representation.
Definition at line 154 of file COutputLogger.cpp.
|
inherited |
Get the history of COutputLogger instance in a string representation.
Definition at line 159 of file COutputLogger.cpp.
Referenced by mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::getDescriptiveReport().
|
inline |
Definition at line 171 of file CAbstractPTGBasedReactive.h.
References m_navlogfiles_dir.
|
inherited |
Return the last Tmsg instance registered in the logger history.
Definition at line 195 of file COutputLogger.cpp.
References mrpt::system::COutputLogger::TMsg::getAsString().
|
inherited |
Fill inputtted string with the contents of the last message in history.
Definition at line 201 of file COutputLogger.cpp.
|
inherited |
Return the name of the COutputLogger instance.
Definition at line 143 of file COutputLogger.cpp.
|
inlineinherited |
Definition at line 201 of file system/COutputLogger.h.
References mrpt::system::COutputLogger::m_min_verbosity_level.
Referenced by mrpt::apps::RawlogGrabberApp::dump_verbose_info(), mrpt::maps::CRandomFieldGridMap2D::isEnabledVerbose(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::apps::CGridMapAlignerApp::run(), mrpt::apps::RBPF_SLAM_App_Base::run(), and mrpt::apps::ICP_SLAM_App_Base::run().
|
pure virtual |
Gets the i'th PTG.
Implemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Referenced by impl_waypoint_is_reachable(), performNavigationStep(), and setHolonomicMethod().
|
pure virtual |
Gets the i'th PTG.
Implemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
|
pure virtual |
Returns the number of different PTGs that have been setup.
Implemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Referenced by build_movement_candidate(), impl_waypoint_is_reachable(), performNavigationStep(), and setHolonomicMethod().
double CAbstractPTGBasedReactive::getTargetApproachSlowDownDistance | ( | ) | const |
Returns this parameter for the first inner holonomic navigator instances [m] (should be the same in all of them?)
Definition at line 2005 of file CAbstractPTGBasedReactive.cpp.
References ASSERT_, and m_holonomicMethod.
|
inline |
Gives access to a const-ref to the internal time logger.
Definition at line 249 of file CAbstractPTGBasedReactive.h.
References m_timelogger.
|
virtualinherited |
Get a copy of the control structure which describes the progress status of the waypoint navigation.
Definition at line 94 of file CWaypointsNavigator.cpp.
References mrpt::nav::CWaypointsNavigator::m_waypoint_nav_status.
|
inlineinherited |
Get a copy of the control structure which describes the progress status of the waypoint navigation.
Definition at line 93 of file CWaypointsNavigator.h.
Referenced by mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
overrideprotectedvirtual |
Implements the way to waypoint is free function in children classes: true
must be returned if, according to the information gathered at the last navigation step, there is a free path to the given point; false
otherwise: if way is blocked or there is missing information, the point is out of range, etc.
Implements mrpt::nav::CWaypointsNavigator.
Definition at line 1464 of file CAbstractPTGBasedReactive.cpp.
References ASSERT_, mrpt::nav::CParameterizedTrajectoryGenerator::getPathCount(), getPTG(), getPTG_count(), INVALID_TIMESTAMP, mrpt::nav::CParameterizedTrajectoryGenerator::inverseMap_WS2TP(), m_infoPerPTG, m_infoPerPTG_timestamp, MRPT_END, MRPT_START, mrpt::system::now(), mrpt::system::timeDifference(), mrpt::math::TPoint2D_data< T >::x, and mrpt::math::TPoint2D_data< T >::y.
|
protectedpure virtual |
Return false on any fatal error.
Implemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Referenced by STEP2_SenseObstacles().
|
overridevirtual |
Must be called for loading collision grids, or the first navigation command may last a long time to be executed.
Internally, it just calls STEP1_CollisionGridsBuilder().
Implements mrpt::nav::CAbstractNavigator.
Definition at line 102 of file CAbstractPTGBasedReactive.cpp.
References ASSERT_, INVALID_TIMESTAMP, mrpt::lockHelper(), m_infoPerPTG_timestamp, m_multiobjopt, mrpt::nav::CAbstractNavigator::m_nav_cs, and STEP1_InitPTGs().
|
inlineinherited |
Definition at line 202 of file system/COutputLogger.h.
References mrpt::system::COutputLogger::m_min_verbosity_level.
Referenced by mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), and mrpt::system::COutputLoggerStreamWrapper::~COutputLoggerStreamWrapper().
|
inherited |
Returns true
if, according to the information gathered at the last navigation step, there is a free path to the given point; false
otherwise: if way is blocked or there is missing information, the point is out of range for the existing PTGs, etc.
Definition at line 476 of file CWaypointsNavigator.cpp.
References mrpt::nav::CWaypointsNavigator::impl_waypoint_is_reachable().
|
inlineinherited |
Definition at line 232 of file CAbstractNavigator.h.
References mrpt::nav::CAbstractNavigator::m_rethrow_exceptions.
|
overridevirtual |
Loads all params from a file.
To be called before initialize(). Each derived class MUST load its own parameters, and then call ITS PARENT'S overriden method to ensure all params are loaded.
Reimplemented from mrpt::nav::CAbstractNavigator.
Reimplemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Definition at line 1891 of file CAbstractPTGBasedReactive.cpp.
References ASSERT_, mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::enable_obstacle_filtering, mrpt::nav::CMultiObjectiveMotionOptimizerBase::Factory(), mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::holonomic_method, mrpt::nav::CWaypointsNavigator::loadConfigFile(), mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::loadFromConfigFile(), m_holonomicMethod, m_init_done, m_multiobjopt, m_PTGsMustBeReInitialized, m_WS_filter, mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::motion_decider_method, MRPT_END, MRPT_START, params_abstract_ptg_navigator, setHolonomicMethod(), and THROW_EXCEPTION_FMT.
Referenced by mrpt::nav::CReactiveNavigationSystem::loadConfigFile(), and mrpt::nav::CReactiveNavigationSystem3D::loadConfigFile().
|
inherited |
Log the given message only if the condition is satisfied.
Definition at line 131 of file COutputLogger.cpp.
|
inherited |
Definition at line 291 of file COutputLogger.cpp.
References getAddress(), and mrpt::system::COutputLogger::m_listCallbacks.
|
inherited |
Alternative logging method, which mimics the printf behavior.
Handy for not having to first use mrpt::format to pass a std::string message to logStr
Definition at line 91 of file COutputLogger.cpp.
Referenced by mrpt::hmtslam::CHMTSLAM::areaAbstraction(), mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::CICPCriteriaNRD(), mrpt::hmtslam::CTopLCDetector_GridMatching::computeTopologicalObservationModel(), CGraphSlamHandler< GRAPH_T >::execute(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), CGraphSlamHandler< GRAPH_T >::initOutputDir(), CGraphSlamHandler< GRAPH_T >::initVisualization(), mrpt::nav::CNavigatorManualSequence::navigationStep(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), CGraphSlamHandler< GRAPH_T >::saveResults(), CGraphSlamHandler< GRAPH_T >::setResultsDirName(), mrpt::nav::CReactiveNavigationSystem::STEP1_InitPTGs(), mrpt::hmtslam::CHMTSLAM::thread_3D_viewer(), mrpt::hmtslam::CHMTSLAM::thread_LSLAM(), mrpt::hmtslam::CHMTSLAM::thread_TBI(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
inherited |
Reset the contents of the logger instance.
Called upon construction.
Definition at line 206 of file COutputLogger.cpp.
References mrpt::system::LVL_INFO.
|
staticinherited |
Map from VerbosityLevels to their corresponding mrpt::system::TConsoleColor.
Handy for coloring the input based on the verbosity of the message
Definition at line 47 of file COutputLogger.cpp.
References logging_levels_to_colors.
Referenced by mrpt::system::COutputLogger::TMsg::dumpToConsole().
|
staticinherited |
Map from VerbosityLevels to their corresponding names.
Handy for printing the current message VerbosityLevel along with the actual content
Definition at line 60 of file COutputLogger.cpp.
References logging_levels_to_names.
Referenced by mrpt::system::COutputLogger::TMsg::getAsString().
|
protectedpure virtual |
Generates a pointcloud of obstacles, and the robot shape, to be saved in the logging record for the current timestep.
Implemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Referenced by STEP8_GenerateLogRecord().
|
inherited |
Definition at line 278 of file COutputLogger.cpp.
References mrpt::system::COutputLogger::m_listCallbacks.
|
inherited |
Main method to add the specified message string to the logger.
Definition at line 72 of file COutputLogger.cpp.
References mrpt::system::COutputLogger::TMsg::body, mrpt::system::COutputLogger::TMsg::dumpToConsole(), mrpt::system::COutputLogger::TMsg::level, mrpt::system::COutputLogger::TMsg::name, and mrpt::system::COutputLogger::TMsg::timestamp.
Referenced by mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_implementation_pfAuxiliaryPFStandardAndOptimal(), mrpt::nav::CReactiveNavigationSystem::STEP1_InitPTGs(), mrpt::system::COutputLoggerStreamWrapper::~COutputLoggerStreamWrapper(), and mrpt::system::CTimeLoggerSaveAtDtor::~CTimeLoggerSaveAtDtor().
|
virtualinherited |
Navigation request to a single target location.
It starts a new navigation.
[in] | params | Pointer to structure with navigation info (its contents will be copied, so the original can be freely destroyed upon return if it was dynamically allocated.) |
Reimplemented in mrpt::nav::CNavigatorManualSequence.
Definition at line 319 of file CAbstractNavigator.cpp.
References MRPT_END, MRPT_START, mrpt::nav::CAbstractNavigator::onNavigateCommandReceived(), and mrpt::nav::CAbstractNavigator::processNavigateCommand().
|
virtualinherited |
Waypoint navigation request.
This immediately cancels any other previous on-going navigation.
Definition at line 66 of file CWaypointsNavigator.cpp.
References ASSERT_, ASSERTMSG_, mrpt::nav::CWaypointsNavigator::m_nav_waypoints_cs, mrpt::nav::CWaypointsNavigator::m_waypoint_nav_status, MRPT_END, MRPT_START, mrpt::system::now(), mrpt::nav::CWaypointsNavigator::onNavigateCommandReceived(), mrpt::nav::TWaypointStatusSequence::timestamp_nav_started, mrpt::nav::TWaypointStatusSequence::waypoint_index_current_goal, mrpt::nav::TWaypointSequence::waypoints, and mrpt::nav::TWaypointStatusSequence::waypoints.
|
overridevirtualinherited |
This method must be called periodically in order to effectively run the navigation.
Reimplemented from mrpt::nav::CAbstractNavigator.
Definition at line 443 of file CWaypointsNavigator.cpp.
References mrpt::nav::CAbstractNavigator::dispatchPendingNavEvents(), mrpt::nav::CWaypointsNavigator::m_is_aligning, mrpt::nav::CAbstractNavigator::m_navigationState, mrpt::nav::CAbstractNavigator::m_navProfiler, MRPT_END, MRPT_START, mrpt::nav::CAbstractNavigator::navigationStep(), mrpt::nav::CAbstractNavigator::SUSPENDED, and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
overrideprotectedvirtualinherited |
Called after each call to CAbstractNavigator::navigate()
Reimplemented from mrpt::nav::CAbstractNavigator.
Definition at line 54 of file CWaypointsNavigator.cpp.
References INVALID_TIMESTAMP, mrpt::nav::CWaypointsNavigator::m_nav_waypoints_cs, mrpt::nav::CWaypointsNavigator::m_was_aligning, mrpt::nav::CWaypointsNavigator::m_waypoint_nav_status, mrpt::nav::CAbstractNavigator::onNavigateCommandReceived(), mrpt::nav::TWaypointStatusSequence::timestamp_nav_started, and mrpt::nav::TWaypointStatusSequence::waypoint_index_current_goal.
Referenced by mrpt::nav::CWaypointsNavigator::navigateWaypoints().
|
overrideprotectedvirtual |
Called whenever a new navigation has been started.
Can be used to reset state variables, etc.
Implements mrpt::nav::CAbstractNavigator.
Definition at line 1510 of file CAbstractPTGBasedReactive.cpp.
References mrpt::nav::CAbstractNavigator::m_last_curPoseVelUpdate_robot_time, m_lastSentVelCmd, mrpt::nav::CWaypointsNavigator::onStartNewNavigation(), and mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::reset().
|
overrideprotectedvirtual |
The main method for the navigator.
The main method: executes one time-iteration of the reactive navigation algorithm.
Allow PTGs to be responsive to target location, dynamics, etc.
Implements mrpt::nav::CAbstractNavigator.
Definition at line 233 of file CAbstractPTGBasedReactive.cpp.
References mrpt::nav::CLogFileRecord::additional_debug_msgs, mrpt::nav::CParameterizedTrajectoryGenerator::alpha2index(), mrpt::serialization::archiveFrom(), ASSERT_, ASSERT_EQUAL_, mrpt::math::TPose2D::asString(), mrpt::poses::CPose2D::asTPose(), build_movement_candidate(), mrpt::nav::CAbstractNavigator::changeSpeeds(), mrpt::nav::CAbstractNavigator::changeSpeedsNOP(), mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::colfreedist_move_k, mrpt::nav::CParameterizedTrajectoryGenerator::TNavDynamicState::curVelLocal, mrpt::nav::TCandidateMovementPTG::direction, mrpt::nav::CAbstractNavigator::doEmergencyStop(), executionTime, mrpt::math::LowPassFilter_IIR1::filter(), mrpt::nav::CMultiObjectiveMotionOptimizerBase::TResultInfo::final_evaluation, mrpt::format(), generate_vel_cmd(), mrpt::nav::CRobot2NavInterface::getEmergencyStopCmd(), getHoloMethod(), mrpt::math::LowPassFilter_IIR1::getLastOutput(), mrpt::system::CTimeLogger::getLastTime(), getPTG(), getPTG_count(), mrpt::nav::CLogFileRecord::infoPerPTG, mrpt::poses::CPoseInterpolatorBase< DIM >::interpolate(), mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::isValid(), mrpt::nav::CMultiObjectiveMotionOptimizerBase::TResultInfo::log_entries, m_closing_navigator, m_copy_prev_navParams, mrpt::nav::CAbstractNavigator::m_curPoseVel, m_enableConsoleOutput, m_enableKeepLogRecords, mrpt::nav::CAbstractNavigator::m_frame_tf, m_holonomicMethod, m_infoPerPTG, m_infoPerPTG_timestamp, m_init_done, m_lastSentVelCmd, mrpt::nav::CAbstractNavigator::m_latestOdomPoses, mrpt::nav::CAbstractNavigator::m_latestPoses, m_logFile, m_multiobjopt, mrpt::nav::CAbstractNavigator::m_navigationParams, mrpt::nav::CAbstractNavigator::m_navProfiler, mrpt::nav::CAbstractNavigator::m_pending_events, m_prev_logfile, mrpt::nav::CAbstractNavigator::m_robot, m_timelogger, mrpt::nav::CAbstractNavigator::m_timlog_delays, m_WS_Obstacles_timestamp, mrpt::nav::CParameterizedTrajectoryGenerator::maxTimeInVelCmdNOP(), meanExecutionPeriod, meanExecutionTime, meanTotalExecutionTime, MRPT_LOG_DEBUG, MRPT_LOG_DEBUG_FMT, MRPT_LOG_WARN_FMT, mrpt::nav::CLogFileRecord::navDynState, mrpt::system::now(), mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::original_holo_eval, params_abstract_ptg_navigator, mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose, mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose_frame_id, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::poseVel, mrpt::nav::TCandidateMovementPTG::props, mrpt::nav::TCandidateMovementPTG::PTG, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_alpha_index, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_dynState, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_index, mrpt::nav::CAbstractNavigator::TRobotPoseVel::rawOdometry, mrpt::nav::CLogFileRecord::relPoseSense, mrpt::nav::CLogFileRecord::relPoseVelCmd, mrpt::nav::CParameterizedTrajectoryGenerator::TNavDynamicState::relTarget, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::reset(), mrpt::io::CMemoryStream::Seek(), mrpt::nav::CRobot2NavInterface::sendApparentCollisionEvent(), mrpt::nav::TCandidateMovementPTG::speed, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::speed_scale, STEP1_InitPTGs(), STEP2_SenseObstacles(), STEP8_GenerateLogRecord(), mrpt::nav::CAbstractNavigator::stop(), mrpt::nav::CParameterizedTrajectoryGenerator::supportSpeedAtTarget(), mrpt::nav::CParameterizedTrajectoryGenerator::supportVelCmdNOP(), mrpt::system::CTicTac::Tac(), mrpt::nav::CParameterizedTrajectoryGenerator::TNavDynamicState::targetRelSpeed, THROW_EXCEPTION, THROW_EXCEPTION_FMT, mrpt::system::CTicTac::Tic(), tim_changeSpeed_avr, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::tim_send_cmd_vel, mrpt::system::timeDifference(), timerForExecutionPeriod, mrpt::nav::CAbstractNavigator::TRobotPoseVel::timestamp, mrpt::system::timestampAdd(), mrpt::nav::CLogFileRecord::timestamps, timoff_curPoseAndSpeed_avr, timoff_obstacles_avr, timoff_sendVelCmd_avr, totalExecutionTime, mrpt::nav::CParameterizedTrajectoryGenerator::updateNavDynamicState(), mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::use_delays_model, mrpt::nav::CLogFileRecord::values, mrpt::nav::CAbstractNavigator::TRobotPoseVel::velLocal, and mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::was_slowdown.
|
protectedvirtualinherited |
Factorization of the part inside navigationStep(), for the case of state being NAVIGATING.
Performs house-hold tasks like raising events in case of starting/ending navigation, timeout reaching destination, etc. call_virtual_nav_method
can be set to false to avoid calling the virtual method performNavigationStep()
Definition at line 499 of file CAbstractNavigator.cpp.
References ASSERT_, mrpt::nav::CAbstractNavigator::checkCollisionWithLatestObstacles(), mrpt::nav::CAbstractNavigator::checkHasReachedTarget(), mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::dist_check_target_is_blocked, mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::dist_to_target_for_sending_event, mrpt::math::TSegment2D::distance(), mrpt::poses::CPoseInterpolatorBase< DIM >::empty(), mrpt::nav::CAbstractNavigator::ERR_CANNOT_REACH_TARGET, mrpt::nav::CAbstractNavigator::ERR_NONE, mrpt::nav::CAbstractNavigator::ERR_OTHER, mrpt::nav::CAbstractNavigator::TErrorReason::error_code, mrpt::nav::CAbstractNavigator::TErrorReason::error_msg, mrpt::format(), mrpt::system::getCurrentTime(), mrpt::nav::CAbstractNavigator::TAbstractNavigatorParams::hysteresis_check_target_is_blocked, mrpt::nav::CAbstractNavigator::IDLE, mrpt::nav::CAbstractNavigator::internal_onStartNewNavigation(), mrpt::system::COutputLogger::logFmt(), mrpt::system::LVL_WARN, mrpt::nav::CAbstractNavigator::m_badNavAlarm_lastMinDistTime, mrpt::nav::CAbstractNavigator::m_badNavAlarm_minDistTarget, mrpt::nav::CAbstractNavigator::m_counter_check_target_is_blocked, mrpt::nav::CAbstractNavigator::m_curPoseVel, mrpt::nav::CAbstractNavigator::m_lastNavigationState, mrpt::nav::CAbstractNavigator::m_latestPoses, mrpt::nav::CAbstractNavigator::m_navErrorReason, mrpt::nav::CAbstractNavigator::m_navigationEndEventSent, mrpt::nav::CAbstractNavigator::m_navigationParams, mrpt::nav::CAbstractNavigator::m_navigationState, mrpt::nav::CAbstractNavigator::m_pending_events, mrpt::nav::CAbstractNavigator::m_rethrow_exceptions, mrpt::nav::CAbstractNavigator::m_robot, MRPT_LOG_DEBUG, MRPT_LOG_ERROR, MRPT_LOG_ERROR_FMT, MRPT_LOG_INFO, MRPT_LOG_THROTTLE_WARN, MRPT_LOG_WARN, mrpt::nav::CAbstractNavigator::NAV_ERROR, mrpt::nav::CAbstractNavigator::NAVIGATING, mrpt::nav::CAbstractNavigator::params_abstract_navigator, mrpt::nav::CAbstractNavigator::performNavigationStep(), mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose, mrpt::poses::CPoseInterpolatorBase< DIM >::rbegin(), mrpt::nav::CRobot2NavInterface::sendNavigationEndEvent(), mrpt::nav::CRobot2NavInterface::sendNavigationStartEvent(), mrpt::nav::CRobot2NavInterface::sendWaySeemsBlockedEvent(), mrpt::poses::CPoseInterpolatorBase< DIM >::size(), mrpt::nav::CAbstractNavigator::stop(), mrpt::system::timeDifference(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
Referenced by mrpt::nav::CAbstractNavigator::navigationStep(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protected |
To be called during children destructors to assure thread-safe destruction, and free of shared objects.
Definition at line 70 of file CAbstractPTGBasedReactive.cpp.
References deleteHolonomicObjects(), m_closing_navigator, m_logFile, mrpt::nav::CAbstractNavigator::m_nav_cs, and mrpt::nav::CAbstractNavigator::stop().
Referenced by ~CAbstractPTGBasedReactive(), mrpt::nav::CReactiveNavigationSystem::~CReactiveNavigationSystem(), and mrpt::nav::CReactiveNavigationSystem3D::~CReactiveNavigationSystem3D().
|
protectedvirtualinherited |
Does the job of navigate(), except the call to onNavigateCommandReceived()
Definition at line 285 of file CAbstractNavigator.cpp.
References ASSERT_, mrpt::system::getCurrentTime(), mrpt::lockHelper(), mrpt::nav::CAbstractNavigator::m_badNavAlarm_lastMinDistTime, mrpt::nav::CAbstractNavigator::m_badNavAlarm_minDistTarget, mrpt::nav::CAbstractNavigator::m_curPoseVel, mrpt::nav::CAbstractNavigator::m_nav_cs, mrpt::nav::CAbstractNavigator::m_navErrorReason, mrpt::nav::CAbstractNavigator::m_navigationParams, mrpt::nav::CAbstractNavigator::m_navigationState, MRPT_END, MRPT_START, mrpt::nav::CAbstractNavigator::NAVIGATING, params, mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose, and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
Referenced by mrpt::nav::CAbstractNavigator::navigate(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
virtualinherited |
Resets a NAV_ERROR
state back to IDLE
Definition at line 133 of file CAbstractNavigator.cpp.
References mrpt::nav::CAbstractNavigator::IDLE, mrpt::lockHelper(), mrpt::nav::CAbstractNavigator::m_nav_cs, mrpt::nav::CAbstractNavigator::m_navErrorReason, mrpt::nav::CAbstractNavigator::m_navigationState, MRPT_LOG_DEBUG, and mrpt::nav::CAbstractNavigator::NAV_ERROR.
|
virtualinherited |
Continues with suspended navigation.
Definition at line 110 of file CAbstractNavigator.cpp.
References mrpt::lockHelper(), mrpt::nav::CAbstractNavigator::m_nav_cs, mrpt::nav::CAbstractNavigator::m_navigationState, MRPT_LOG_DEBUG, mrpt::nav::CAbstractNavigator::NAVIGATING, and mrpt::nav::CAbstractNavigator::SUSPENDED.
|
overridevirtual |
Saves all current options to a config file.
Each derived class MUST save its own parameters, and then call ITS PARENT'S overriden method to ensure all params are saved.
Reimplemented from mrpt::nav::CAbstractNavigator.
Reimplemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Definition at line 1936 of file CAbstractPTGBasedReactive.cpp.
References CLASS_ID, mrpt::rtti::getAllRegisteredClassesChildrenOf(), m_holonomicMethod, m_multiobjopt, mrpt::maps::CPointCloudFilterByDistance::options, params_abstract_ptg_navigator, mrpt::nav::CMultiObjectiveMotionOptimizerBase::saveConfigFile(), mrpt::nav::CAbstractHolonomicReactiveMethod::saveConfigFile(), mrpt::nav::CWaypointsNavigator::saveConfigFile(), mrpt::maps::CPointCloudFilterByDistance::TOptions::saveToConfigFile(), and mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::saveToConfigFile().
Referenced by mrpt::nav::CReactiveNavigationSystem::saveConfigFile().
|
inherited |
Sets a user-provided frame transformer object; used only if providing targets in a frame ID different than the one in which robot odometry is given (both IDs default to "map"
).
Definition at line 145 of file CAbstractNavigator.cpp.
References mrpt::nav::CAbstractNavigator::m_frame_tf.
void CAbstractPTGBasedReactive::setHolonomicMethod | ( | const std::string & | method, |
const mrpt::config::CConfigFileBase & | cfgBase | ||
) |
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.
Available methods: class names of those derived from CAbstractHolonomicReactiveMethod
Definition at line 206 of file CAbstractPTGBasedReactive.cpp.
References ASSERT_, deleteHolonomicObjects(), mrpt::nav::CAbstractHolonomicReactiveMethod::Factory(), getPTG(), getPTG_count(), mrpt::lockHelper(), m_holonomicMethod, mrpt::nav::CAbstractNavigator::m_nav_cs, and THROW_EXCEPTION_FMT.
Referenced by loadConfigFile().
|
inline |
Changes the prefix for new log files.
Definition at line 167 of file CAbstractPTGBasedReactive.h.
References m_navlogfiles_dir.
|
inherited |
Set the name of the COutputLogger instance.
Definition at line 138 of file COutputLogger.cpp.
Referenced by mrpt::slam::CMetricMapBuilderICP::CMetricMapBuilderICP(), mrpt::slam::CMetricMapBuilderRBPF::CMetricMapBuilderRBPF(), mrpt::slam::CMonteCarloLocalization2D::CMonteCarloLocalization2D(), mrpt::slam::CMonteCarloLocalization3D::CMonteCarloLocalization3D(), mrpt::apps::ICP_SLAM_App_Base::ICP_SLAM_App_Base(), mrpt::apps::ICP_SLAM_App_Live::ICP_SLAM_App_Live(), mrpt::apps::ICP_SLAM_App_Rawlog::ICP_SLAM_App_Rawlog(), mrpt::graphslam::CWindowManager::initCWindowManager(), mrpt::apps::MonteCarloLocalization_Base::MonteCarloLocalization_Base(), mrpt::apps::RBPF_SLAM_App_Base::RBPF_SLAM_App_Base(), and mrpt::apps::RBPF_SLAM_App_Rawlog::RBPF_SLAM_App_Rawlog().
|
inherited |
Set the minimum logging level for which the incoming logs are going to be taken into account.
String messages with specified VerbosityLevel smaller than the min, will not be outputted to the screen and neither will a record of them be stored in by the COutputLogger instance
Definition at line 144 of file COutputLogger.cpp.
Referenced by mrpt::maps::CRandomFieldGridMap2D::enableVerbose(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), generic_kf_slam_test(), generic_pf_test(), generic_rbpf_slam_test(), mrpt::apps::RawlogGrabberApp::initialize(), mrpt::hwdrivers::CHokuyoURG::initialize(), mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::loadParams(), mrpt::apps::CGridMapAlignerApp::run(), mrpt::apps::RBPF_SLAM_App_Base::run(), and mrpt::apps::ICP_SLAM_App_Base::run().
void CAbstractPTGBasedReactive::setTargetApproachSlowDownDistance | ( | const double | dist | ) |
Changes this parameter in all inner holonomic navigator instances [m].
Definition at line 1996 of file CAbstractPTGBasedReactive.cpp.
References m_holonomicMethod.
|
inherited |
alias of setMinLoggingLevel()
Definition at line 149 of file COutputLogger.cpp.
Referenced by mrpt::nav::CAbstractNavigator::CAbstractNavigator(), mrpt::slam::CMetricMapBuilderRBPF::CMetricMapBuilderRBPF(), mrpt::comms::CServerTCPSocket::CServerTCPSocket(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::math::ransac_detect_2D_lines(), and mrpt::apps::ICP_SLAM_App_Base::run().
|
protectedpure virtual |
Implemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Referenced by initialize(), and performNavigationStep().
|
protected |
Definition at line 1504 of file CAbstractPTGBasedReactive.cpp.
References implementSenseObstacles(), and m_WS_Obstacles_timestamp.
Referenced by performNavigationStep().
|
protectedpure virtual |
Builds TP-Obstacles from Workspace obstacles for the given PTG.
"out_TPObstacles" is already initialized to the proper length and maximum collision-free distance for each "k" trajectory index. Distances are in "pseudo-meters". They will be normalized automatically to [0,1] upon return.
Implemented in mrpt::nav::CReactiveNavigationSystem3D, and mrpt::nav::CReactiveNavigationSystem.
Referenced by build_movement_candidate().
|
protected |
Definition at line 938 of file CAbstractPTGBasedReactive.cpp.
References mrpt::serialization::archiveFrom(), mrpt::nav::CLogFileRecord::cmd_vel, mrpt::nav::CLogFileRecord::cur_vel, mrpt::nav::CLogFileRecord::cur_vel_local, mrpt::system::CTimeLogger::enter(), mrpt::math::LowPassFilter_IIR1::getLastOutput(), mrpt::system::CTimeLogger::getLastTime(), lastLogRecord, mrpt::system::CTimeLogger::leave(), mrpt::lockHelper(), loggingGetWSObstaclesAndShape(), m_critZoneLastLog, mrpt::nav::CAbstractNavigator::m_curPoseVel, m_lastSentVelCmd, m_logFile, mrpt::nav::CAbstractNavigator::m_navProfiler, m_timelogger, mrpt::nav::CAbstractNavigator::m_timlog_delays, meanExecutionPeriod, meanExecutionTime, mrpt::nav::CLogFileRecord::nPTGs, mrpt::nav::CLogFileRecord::nSelectedPTG, mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_alpha_index, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_dynState, mrpt::nav::CAbstractPTGBasedReactive::TSentVelCmd::ptg_index, mrpt::nav::CLogFileRecord::ptg_index_NOP, mrpt::nav::CLogFileRecord::ptg_last_k_NOP, mrpt::nav::CLogFileRecord::ptg_last_navDynState, mrpt::nav::CAbstractNavigator::TRobotPoseVel::rawOdometry, mrpt::nav::CLogFileRecord::rel_cur_pose_wrt_last_vel_cmd_NOP, mrpt::nav::CLogFileRecord::rel_pose_PTG_origin_wrt_sense_NOP, mrpt::nav::CLogFileRecord::robotPoseLocalization, mrpt::nav::CLogFileRecord::robotPoseOdometry, tim_changeSpeed_avr, mrpt::nav::CAbstractNavigator::TRobotPoseVel::timestamp, mrpt::nav::CLogFileRecord::timestamps, mrpt::nav::CLogFileRecord::values, mrpt::nav::CAbstractNavigator::TRobotPoseVel::velGlobal, mrpt::nav::CAbstractNavigator::TRobotPoseVel::velLocal, and mrpt::nav::CLogFileRecord::WS_targets_relative.
Referenced by performNavigationStep().
|
protectedvirtualinherited |
Default: forward call to m_robot.stop().
Can be overriden.
Definition at line 429 of file CAbstractNavigator.cpp.
References mrpt::nav::CAbstractNavigator::m_robot, and mrpt::nav::CRobot2NavInterface::stop().
Referenced by mrpt::nav::CAbstractNavigator::cancel(), mrpt::nav::CAbstractNavigator::doEmergencyStop(), mrpt::nav::CNavigatorManualSequence::navigationStep(), mrpt::nav::CAbstractNavigator::navigationStep(), performNavigationStep(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), preDestructor(), mrpt::nav::CAbstractNavigator::suspend(), mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
virtualinherited |
Suspend current navegation.
Definition at line 119 of file CAbstractNavigator.cpp.
References mrpt::lockHelper(), mrpt::nav::CAbstractNavigator::m_nav_cs, mrpt::nav::CAbstractNavigator::m_navigationState, MRPT_LOG_DEBUG, mrpt::nav::CAbstractNavigator::NAVIGATING, mrpt::nav::CAbstractNavigator::stop(), and mrpt::nav::CAbstractNavigator::SUSPENDED.
|
protectedvirtualinherited |
Call to the robot getCurrentPoseAndSpeeds() and updates members m_curPoseVel accordingly.
If an error is returned by the user callback, first, it calls robot.stop() ,then throws an std::runtime_error exception.
Definition at line 328 of file CAbstractNavigator.cpp.
References mrpt::poses::CPoseInterpolatorBase< DIM >::begin(), mrpt::poses::CPoseInterpolatorBase< DIM >::clear(), mrpt::poses::CPoseInterpolatorBase< DIM >::erase(), mrpt::nav::CAbstractNavigator::ERR_EMERGENCY_STOP, mrpt::nav::CAbstractNavigator::TErrorReason::error_code, mrpt::nav::CAbstractNavigator::TErrorReason::error_msg, mrpt::nav::CRobot2NavInterface::getCurrentPoseAndSpeeds(), mrpt::nav::CRobot2NavInterface::getNavigationTime(), mrpt::poses::CPoseInterpolatorBase< DIM >::insert(), mrpt::nav::CAbstractNavigator::m_curPoseVel, mrpt::nav::CAbstractNavigator::m_last_curPoseVelUpdate_pose_frame_id, mrpt::nav::CAbstractNavigator::m_last_curPoseVelUpdate_robot_time, mrpt::nav::CAbstractNavigator::m_latestOdomPoses, mrpt::nav::CAbstractNavigator::m_latestPoses, mrpt::nav::CAbstractNavigator::m_navErrorReason, mrpt::nav::CAbstractNavigator::m_navigationState, mrpt::nav::CAbstractNavigator::m_navProfiler, mrpt::nav::CAbstractNavigator::m_robot, MRPT_LOG_ERROR, MRPT_LOG_THROTTLE_DEBUG_FMT, mrpt::nav::CAbstractNavigator::NAV_ERROR, mrpt::math::TPose2D::phi, mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose, mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose_frame_id, PREVIOUS_POSES_MAX_AGE, mrpt::nav::CAbstractNavigator::TRobotPoseVel::rawOdometry, mrpt::poses::CPoseInterpolatorBase< DIM >::rbegin(), mrpt::math::TTwist2D::rotate(), mrpt::poses::CPoseInterpolatorBase< DIM >::size(), mrpt::nav::CAbstractNavigator::stop(), mrpt::system::timeDifference(), mrpt::nav::CAbstractNavigator::TRobotPoseVel::timestamp, mrpt::nav::CAbstractNavigator::TRobotPoseVel::velGlobal, and mrpt::nav::CAbstractNavigator::TRobotPoseVel::velLocal.
Referenced by mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), mrpt::nav::CAbstractNavigator::processNavigateCommand(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
inlineprotectedinherited |
Definition at line 163 of file CWaypointsNavigator.h.
References mrpt::nav::CWaypointsNavigator::m_is_aligning.
|
protectedvirtualinherited |
The waypoints-specific part of navigationStep()
Definition at line 112 of file CWaypointsNavigator.cpp.
References mrpt::nav::TWaypoint::allowed_distance, mrpt::math::angDistance(), ASSERT_, mrpt::nav::CAbstractNavigator::changeSpeeds(), mrpt::math::TSegment2D::distance(), mrpt::nav::TWaypointStatusSequence::final_goal_reached, mrpt::nav::CRobot2NavInterface::getAlignCmd(), mrpt::nav::CWaypointsNavigator::getWaypointNavStatus(), mrpt::nav::CWaypointsNavigator::impl_waypoint_is_reachable(), mrpt::nav::TWaypoint::INVALID_NUM, mrpt::poses::CPose2D::inverseComposePoint(), mrpt::nav::TWaypointStatusSequence::last_robot_pose, mrpt::nav::CAbstractNavigator::m_curPoseVel, mrpt::nav::CWaypointsNavigator::m_is_aligning, mrpt::nav::CWaypointsNavigator::m_last_alignment_cmd, mrpt::nav::CWaypointsNavigator::m_nav_waypoints_cs, mrpt::nav::CAbstractNavigator::m_pending_events, mrpt::nav::CAbstractNavigator::m_robot, mrpt::nav::CAbstractNavigator::m_timlog_delays, mrpt::nav::CWaypointsNavigator::m_was_aligning, mrpt::nav::CWaypointsNavigator::m_waypoint_nav_status, mrpt::nav::CWaypointsNavigator::TWaypointsNavigatorParams::max_distance_to_allow_skip_waypoint, mrpt::nav::CWaypointsNavigator::TWaypointsNavigatorParams::min_timesteps_confirm_skip_waypoints, MRPT_END, MRPT_LOG_DEBUG_STREAM, MRPT_LOG_INFO_FMT, MRPT_LOG_THROTTLE_INFO_FMT, MRPT_START, mrpt::nav::CWaypointsNavigator::TNavigationParamsWaypoints::multiple_targets, mrpt::nav::CWaypointsNavigator::TWaypointsNavigatorParams::multitarget_look_ahead, mrpt::math::TPoint2D_< T >::norm(), mrpt::system::now(), mrpt::nav::CWaypointsNavigator::params_waypoints_navigator, mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), mrpt::math::TPose2D::phi, mrpt::math::TSegment2D::point1, mrpt::math::TSegment2D::point2, mrpt::nav::CAbstractNavigator::TRobotPoseVel::pose, mrpt::nav::CAbstractNavigator::processNavigateCommand(), mrpt::RAD2DEG(), mrpt::nav::CRobot2NavInterface::sendNewWaypointTargetEvent(), mrpt::nav::CRobot2NavInterface::sendWaypointReachedEvent(), mrpt::nav::TWaypoint::speed_ratio, mrpt::square(), mrpt::nav::CAbstractNavigator::stop(), mrpt::nav::TWaypoint::target, mrpt::nav::CAbstractNavigator::TNavigationParams::target, mrpt::nav::CAbstractNavigator::TargetInfo::target_coords, mrpt::nav::TWaypoint::target_frame_id, mrpt::nav::CAbstractNavigator::TargetInfo::target_frame_id, mrpt::nav::TWaypoint::target_heading, mrpt::nav::CAbstractNavigator::TargetInfo::targetAllowedDistance, mrpt::nav::CAbstractNavigator::TargetInfo::targetDesiredRelSpeed, mrpt::nav::CAbstractNavigator::TargetInfo::targetIsIntermediaryWaypoint, mrpt::nav::CAbstractNavigator::TargetInfo::targetIsRelative, mrpt::system::timeDifference(), mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds(), mrpt::nav::TWaypointStatusSequence::waypoint_index_current_goal, mrpt::nav::TWaypointStatusSequence::waypoints, mrpt::math::TPoint2D_data< T >::x, mrpt::math::TPose2D::x, mrpt::math::TPoint2D_data< T >::y, and mrpt::math::TPose2D::y.
Referenced by mrpt::nav::CWaypointsNavigator::navigationStep().
|
inherited |
Write the contents of the COutputLogger instance to an external file.
Upon call to this method, COutputLogger dumps the contents of all the logged commands so far to the specified external file. By default the filename is set to ${LOGGERNAME}.log except if the fname parameter is provided
Definition at line 165 of file COutputLogger.cpp.
References ASSERTMSG_, and mrpt::format().
|
protected |
Definition at line 317 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
|
protected |
The last log.
Definition at line 298 of file CAbstractPTGBasedReactive.h.
Referenced by getLastLogRecord(), and STEP8_GenerateLogRecord().
|
inherited |
[Default=true] Set it to false in case you don't want the logged messages to be dumped to the output automatically.
Definition at line 240 of file system/COutputLogger.h.
|
inherited |
[Default=false] Enables storing all messages into an internal list.
Definition at line 243 of file system/COutputLogger.h.
|
protectedinherited |
Definition at line 388 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), and mrpt::nav::CAbstractNavigator::processNavigateCommand().
|
protectedinherited |
For sending an alarm (error event) when it seems that we are not approaching toward the target in a while...
Definition at line 387 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), and mrpt::nav::CAbstractNavigator::processNavigateCommand().
|
protected |
Signal that the destructor has been called, so no more calls are accepted from other threads.
Definition at line 404 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep(), and preDestructor().
|
private |
A copy of last-iteration navparams, used to detect changes.
Definition at line 473 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
|
protected |
Critical zones.
Definition at line 303 of file CAbstractPTGBasedReactive.h.
Referenced by getLastLogRecord(), and STEP8_GenerateLogRecord().
|
protectedinherited |
Current robot pose (updated in CAbstractNavigator::navigationStep() )
Definition at line 375 of file CAbstractNavigator.h.
Referenced by build_movement_candidate(), calc_move_candidate_scores(), mrpt::nav::CReactiveNavigationSystem::implementSenseObstacles(), performNavigationStep(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), mrpt::nav::CAbstractNavigator::processNavigateCommand(), STEP8_GenerateLogRecord(), mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protected |
Enables / disables the console debug output.
Definition at line 306 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep(), mrpt::nav::CReactiveNavigationSystem::STEP1_InitPTGs(), and mrpt::nav::CReactiveNavigationSystem3D::STEP1_InitPTGs().
|
protected |
See enableKeepLogRecords.
Definition at line 296 of file CAbstractPTGBasedReactive.h.
Referenced by build_movement_candidate(), enableKeepLogRecords(), and performNavigationStep().
|
private |
Definition at line 471 of file CAbstractPTGBasedReactive.h.
|
private |
Definition at line 471 of file CAbstractPTGBasedReactive.h.
|
private |
Definition at line 471 of file CAbstractPTGBasedReactive.h.
|
protectedinherited |
Optional, user-provided frame transformer.
Definition at line 356 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::getFrameTF(), performNavigationStep(), and mrpt::nav::CAbstractNavigator::setFrameTF().
|
protected |
The holonomic navigation algorithm (one object per PTG, so internal states are maintained)
Definition at line 291 of file CAbstractPTGBasedReactive.h.
Referenced by calc_move_candidate_scores(), deleteHolonomicObjects(), getHoloMethod(), getTargetApproachSlowDownDistance(), loadConfigFile(), performNavigationStep(), saveConfigFile(), setHolonomicMethod(), and setTargetApproachSlowDownDistance().
|
protected |
Temporary buffers for working with each PTG during a navigationStep()
Definition at line 423 of file CAbstractPTGBasedReactive.h.
Referenced by impl_waypoint_is_reachable(), and performNavigationStep().
|
protected |
Definition at line 424 of file CAbstractPTGBasedReactive.h.
Referenced by impl_waypoint_is_reachable(), initialize(), and performNavigationStep().
|
protected |
Whether loadConfigFile() has been called or not.
Definition at line 308 of file CAbstractPTGBasedReactive.h.
Referenced by loadConfigFile(), and performNavigationStep().
|
protectedinherited |
Definition at line 167 of file CWaypointsNavigator.h.
Referenced by mrpt::nav::CWaypointsNavigator::navigationStep(), mrpt::nav::CWaypointsNavigator::waypoints_isAligning(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protectedinherited |
Definition at line 168 of file CWaypointsNavigator.h.
Referenced by mrpt::nav::CWaypointsNavigator::CWaypointsNavigator(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protectedinherited |
Definition at line 377 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
protectedinherited |
Definition at line 376 of file CAbstractNavigator.h.
Referenced by onStartNewNavigation(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
protected |
Last velocity commands.
Definition at line 300 of file CAbstractPTGBasedReactive.h.
Referenced by calc_move_candidate_scores(), and generate_vel_cmd().
|
protected |
Definition at line 462 of file CAbstractPTGBasedReactive.h.
Referenced by build_movement_candidate(), calc_move_candidate_scores(), onStartNewNavigation(), performNavigationStep(), and STEP8_GenerateLogRecord().
|
protectedinherited |
Definition at line 379 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::CAbstractNavigator(), mrpt::nav::CAbstractNavigator::internal_onStartNewNavigation(), performNavigationStep(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
protectedinherited |
Latest robot poses (updated in CAbstractNavigator::navigationStep() )
Definition at line 379 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::CAbstractNavigator(), mrpt::nav::CAbstractNavigator::internal_onStartNewNavigation(), performNavigationStep(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
protected |
Definition at line 292 of file CAbstractPTGBasedReactive.h.
Referenced by build_movement_candidate(), enableLogFile(), performNavigationStep(), preDestructor(), and STEP8_GenerateLogRecord().
|
protectedinherited |
Provided messages with VerbosityLevel smaller than this value shall be ignored.
Definition at line 253 of file system/COutputLogger.h.
Referenced by mrpt::system::COutputLogger::getMinLoggingLevel(), and mrpt::system::COutputLogger::isLoggingLevelVisible().
|
protected |
Definition at line 410 of file CAbstractPTGBasedReactive.h.
Referenced by initialize(), loadConfigFile(), performNavigationStep(), and saveConfigFile().
|
protectedinherited |
mutex for all navigation methods
Definition at line 359 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::cancel(), enableLogFile(), initialize(), mrpt::nav::CAbstractNavigator::navigationStep(), mrpt::nav::CAbstractNavigator::onNavigateCommandReceived(), preDestructor(), mrpt::nav::CAbstractNavigator::processNavigateCommand(), mrpt::nav::CAbstractNavigator::resetNavError(), mrpt::nav::CAbstractNavigator::resume(), setHolonomicMethod(), and mrpt::nav::CAbstractNavigator::suspend().
|
protectedinherited |
|
protectedinherited |
Current navigation parameters.
Definition at line 350 of file CAbstractNavigator.h.
Referenced by calc_move_candidate_scores(), mrpt::nav::CWaypointsNavigator::checkHasReachedTarget(), mrpt::nav::CAbstractNavigator::onNavigateCommandReceived(), performNavigationStep(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), and mrpt::nav::CAbstractNavigator::processNavigateCommand().
Current internal state of navigator:
Definition at line 348 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::cancel(), mrpt::nav::CAbstractNavigator::doEmergencyStop(), mrpt::nav::CAbstractNavigator::getCurrentState(), mrpt::nav::CWaypointsNavigator::navigationStep(), mrpt::nav::CAbstractNavigator::navigationStep(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), mrpt::nav::CAbstractNavigator::processNavigateCommand(), mrpt::nav::CAbstractNavigator::resetNavError(), mrpt::nav::CAbstractNavigator::resume(), mrpt::nav::CAbstractNavigator::suspend(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
private |
Default: "./reactivenav.logs".
Definition at line 469 of file CAbstractPTGBasedReactive.h.
Referenced by enableLogFile(), getLogFileDirectory(), and setLogFileDirectory().
|
inherited |
Publicly available time profiling object.
Default: disabled
Definition at line 268 of file CAbstractNavigator.h.
Referenced by build_movement_candidate(), calc_move_candidate_scores(), mrpt::nav::CAbstractNavigator::loadConfigFile(), mrpt::nav::CWaypointsNavigator::navigationStep(), mrpt::nav::CAbstractNavigator::navigationStep(), performNavigationStep(), mrpt::nav::CReactiveNavigationSystem::STEP3_WSpaceToTPSpace(), STEP8_GenerateLogRecord(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
protectedinherited |
Events generated during navigationStep(), enqueued to be called at the end of the method execution to avoid user code to change the navigator state.
Definition at line 289 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::dispatchPendingNavEvents(), mrpt::nav::CAbstractNavigator::navigationStep(), performNavigationStep(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protected |
The current log file stream, or nullptr if not being used.
Definition at line 294 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
|
protected |
Definition at line 313 of file CAbstractPTGBasedReactive.h.
Referenced by mrpt::nav::CReactiveNavigationSystem::changeRobotCircularShapeRadius(), mrpt::nav::CReactiveNavigationSystem::changeRobotShape(), mrpt::nav::CReactiveNavigationSystem3D::changeRobotShape(), mrpt::nav::CReactiveNavigationSystem3D::loadConfigFile(), loadConfigFile(), mrpt::nav::CReactiveNavigationSystem::STEP1_InitPTGs(), and mrpt::nav::CReactiveNavigationSystem3D::STEP1_InitPTGs().
|
protectedinherited |
The navigator-robot interface.
Definition at line 353 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::changeSpeeds(), mrpt::nav::CAbstractNavigator::changeSpeedsNOP(), mrpt::nav::CReactiveNavigationSystem::implementSenseObstacles(), mrpt::nav::CReactiveNavigationSystem3D::implementSenseObstacles(), mrpt::nav::CNavigatorManualSequence::initialize(), mrpt::nav::CAbstractNavigator::internal_onStartNewNavigation(), mrpt::nav::CNavigatorManualSequence::navigationStep(), mrpt::nav::CAbstractNavigator::navigationStep(), performNavigationStep(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), mrpt::nav::CAbstractNavigator::stop(), mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protected |
A complete time logger.
Definition at line 312 of file CAbstractPTGBasedReactive.h.
Referenced by build_movement_candidate(), enableTimeLog(), generate_vel_cmd(), getTimeLogger(), mrpt::nav::CReactiveNavigationSystem::implementSenseObstacles(), mrpt::nav::CReactiveNavigationSystem3D::implementSenseObstacles(), performNavigationStep(), mrpt::nav::CReactiveNavigationSystem::STEP1_InitPTGs(), mrpt::nav::CReactiveNavigationSystem3D::STEP1_InitPTGs(), and STEP8_GenerateLogRecord().
|
protectedinherited |
Time logger to collect delay-related stats.
Definition at line 382 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::getDelaysTimeLogger(), mrpt::nav::CReactiveNavigationSystem::implementSenseObstacles(), mrpt::nav::CReactiveNavigationSystem3D::implementSenseObstacles(), performNavigationStep(), STEP8_GenerateLogRecord(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protectedinherited |
Whether the last timestep was "is_aligning" in a waypoint with heading.
Definition at line 166 of file CWaypointsNavigator.h.
Referenced by mrpt::nav::CWaypointsNavigator::onNavigateCommandReceived(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protectedinherited |
The latest waypoints navigation command and the up-to-date control status.
Definition at line 143 of file CWaypointsNavigator.h.
Referenced by mrpt::nav::CWaypointsNavigator::cancel(), mrpt::nav::CWaypointsNavigator::checkHasReachedTarget(), mrpt::nav::CWaypointsNavigator::getWaypointNavStatus(), mrpt::nav::CWaypointsNavigator::navigateWaypoints(), mrpt::nav::CWaypointsNavigator::onNavigateCommandReceived(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protected |
Default: none.
Definition at line 408 of file CAbstractPTGBasedReactive.h.
Referenced by mrpt::nav::CReactiveNavigationSystem::implementSenseObstacles(), and loadConfigFile().
|
protected |
Definition at line 406 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep(), and STEP2_SenseObstacles().
|
protected |
Runtime estimation of execution period of the method.
Definition at line 321 of file CAbstractPTGBasedReactive.h.
Referenced by generate_vel_cmd(), performNavigationStep(), and STEP8_GenerateLogRecord().
|
protected |
Definition at line 318 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep(), and STEP8_GenerateLogRecord().
|
protected |
Definition at line 319 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
|
inherited |
Definition at line 258 of file CAbstractNavigator.h.
Referenced by mrpt::nav::CAbstractNavigator::loadConfigFile(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), and mrpt::nav::CAbstractNavigator::saveConfigFile().
TAbstractPTGNavigatorParams mrpt::nav::CAbstractPTGBasedReactive::params_abstract_ptg_navigator |
Definition at line 234 of file CAbstractPTGBasedReactive.h.
Referenced by build_movement_candidate(), calc_move_candidate_scores(), changeCurrentRobotSpeedLimits(), generate_vel_cmd(), getCurrentRobotSpeedLimits(), mrpt::nav::CReactiveNavigationSystem3D::implementSenseObstacles(), loadConfigFile(), performNavigationStep(), saveConfigFile(), mrpt::nav::CReactiveNavigationSystem::STEP1_InitPTGs(), mrpt::nav::CReactiveNavigationSystem3D::STEP1_InitPTGs(), and mrpt::nav::CReactiveNavigationSystem::STEP3_WSpaceToTPSpace().
|
inherited |
Definition at line 133 of file CWaypointsNavigator.h.
Referenced by mrpt::nav::CWaypointsNavigator::loadConfigFile(), mrpt::nav::CWaypointsNavigator::saveConfigFile(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
|
protected |
Definition at line 317 of file CAbstractPTGBasedReactive.h.
Referenced by build_movement_candidate().
|
protected |
Definition at line 322 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep(), and STEP8_GenerateLogRecord().
|
protected |
Definition at line 309 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
|
protected |
Definition at line 323 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
|
protected |
Definition at line 323 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
|
protected |
Definition at line 324 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
|
protected |
Definition at line 317 of file CAbstractPTGBasedReactive.h.
Referenced by performNavigationStep().
Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020 |