selfdriving
NavEngine.h
Go to the documentation of this file.
1 /* -------------------------------------------------------------------------
2  * SelfDriving C++ library based on PTGs and mrpt-nav
3  * Copyright (C) 2019-2022 Jose Luis Blanco, University of Almeria
4  * See LICENSE for license information.
5  * ------------------------------------------------------------------------- */
6 
7 #pragma once
8 
11 #include <mpp/algos/TPS_Astar.h>
12 #include <mpp/data/PlannerInput.h>
13 #include <mpp/data/PlannerOutput.h>
15 #include <mpp/data/Waypoints.h>
19 #include <mrpt/core/WorkerThreadsPool.h>
20 #include <mrpt/io/CFileGZOutputStream.h>
21 #include <mrpt/poses/CPose2DInterpolator.h>
22 #include <mrpt/system/COutputLogger.h>
23 #include <mrpt/system/CTimeLogger.h>
24 #include <mrpt/typemeta/TEnumType.h>
25 
26 #include <functional>
27 #include <list>
28 
29 namespace mpp
30 {
31 using namespace mrpt;
32 
33 /** The different statuses for the navigation system. */
34 enum class NavStatus : uint8_t
35 {
36  IDLE = 0,
37  NAVIGATING,
38  SUSPENDED,
39  NAV_ERROR
40 };
41 
42 /** Explains the reason for the navigation error. */
43 enum class NavError : uint8_t
44 {
45  NONE = 0,
48  OTHER
49 };
51 {
52  NavErrorReason() = default;
53  NavError error_code = NavError::NONE;
54  std::string error_msg; //!< Human friendly description of the error
55 };
56 
57 /** The top-level interface for users to control the vehicle navigation.
58  *
59  * This class is based and extends `mrpt::nav::CAbstractNavigator` with the
60  * capability of following a list of waypoints. By default, waypoints are
61  * followed one by one, but, refer to \c Waypoint for a discussion on
62  * `allow_skip`.
63  *
64  * How to use:
65  * - \c initialize() must be called before running any actual navigation.
66  *
67  * - Callbacks must be provided for interfacing the real (or simulated)
68  * robot/vehicle and its sensors. They must be provided as std::function<>
69  * instances within \c config_. Note they may be actual functions, or lambdas.
70  *
71  * - \c navigation_step() must be called periodically in order to effectively
72  * run the navigation. This method will internally call the callbacks to gather
73  * sensor data and robot positioning data.
74  *
75  * This class implements the following state machine (see \c current_status()):
76  * \dot
77  * digraph NavStatus {
78  * IDLE; NAVIGATING; SUSPENDED; NAV_ERROR;
79  * IDLE -> NAVIGATING [ label="request_navigation()" ];
80  * NAVIGATING -> IDLE [ label="Final target reached" ];
81  * NAVIGATING -> IDLE [ label="cancel()" ];
82  * NAVIGATING -> NAV_ERROR [ label="Upon sensor errors, timeout,..." ];
83  * NAVIGATING -> SUSPENDED [ label="suspend()" ];
84  * SUSPENDED -> NAVIGATING [ label="resume()" ];
85  * NAV_ERROR -> IDLE [ label="reset_nav_error()" ];
86  * }
87  * \enddot
88  *
89  * All methods are thread-safe, in the sense that mutexes are internally used
90  * to ensure no undefined navigation state is possible if invoking an object of
91  * this class from more than one thread.
92  *
93  */
94 class NavEngine : public mrpt::system::COutputLogger
95 {
96  public:
97  /** ctor */
98  NavEngine() : mrpt::system::COutputLogger("NavEngine") {}
99 
100  /** dtor */
101  virtual ~NavEngine();
102 
103  /** \name Initialization and parameters
104  * @{ */
105 
107  {
108  Configuration() = default;
109 
110  /** @name Main configuration fields; must fill before initialize()
111  * @{ */
112  VehicleMotionInterface::Ptr vehicleMotionInterface;
113 
114  /** Having at least one of these is mandatory */
116 
118 
119  TargetApproachController::Ptr targetApproachController;
120  /** @} */
121 
122  /** @name Parameters
123  * @{ */
124 
125 #if 0
126  /** Default value=0, means use the "targetAllowedDistance" passed by the
127  * user in the navigation request. */
128  double dist_to_target_for_sending_event{0};
129 
130 
131  /** (Default value=0.6) When closer than this distance, check if the
132  * target is blocked to abort navigation with an error. */
133  double dist_check_target_is_blocked{0.6};
134 #endif
135 
136  /** (Default=4.0) Hoy many meters to add at each side
137  * (up,down,left,right) of the bbox enclosing the starting and goal
138  * pose for each individual call to the A* planner. */
139  double planner_bbox_margin = 4.0;
140 
141  double enqueuedActionsToleranceXY = 0.05;
142  double enqueuedActionsTolerancePhi = 2.0_deg;
143  double enqueuedActionsTimeoutMultiplier = 1.3;
144 
145  double lookAheadImmediateCollisionChecking = 1.0; // [s]
146 
147  double maxDistanceForTargetApproach = 1.5; // [m]
148  double maxRelativeHeadingForTargetApproach = 180.0_deg; // [rad]
149 
150  /** Navigation timeout (seconds) [Default=30 sec]
151  * See description of VehicleMotionInterface::on_path_seems_blocked()
152  */
153  double timeoutNotGettingCloserGoal = 30;
154 
155  bool generateNavLogFiles = false;
156 
157  /** Actual files will be
158  * `${navLogFilesPrefix}_${UNIQUE_ID}.reactivenavlog` */
159  std::string navLogFilesPrefix = "./selfdriving";
160 
161  void loadFrom(const mrpt::containers::yaml& c);
162  mrpt::containers::yaml saveTo() const;
163 
165 
169 
170  /** @} */
171 
172  /** \name Visualization callbacks and methods
173  * @{ */
174 
175  std::function<void(void)> on_viz_pre_modify;
176  std::shared_ptr<mrpt::opengl::CSetOfObjects> vizSceneToModify;
177  std::function<void(void)> on_viz_post_modify;
178 
179  /** @} */
180  };
181 
182  /** Must be called before any other navigation command, and after filling in
183  * all the required data into \c config_
184  */
185  virtual void initialize();
186 
188 
189  /** Read access to current absolute speed limits */
190  const mrpt::kinematics::CVehicleVelCmd::TVelCmdParams& absoluteSpeedLimits()
191  const
192  {
193  return absoluteSpeedLimits_;
194  }
195 
196  /** Changes the current speed limits */
197  void absoluteSpeedLimits(
198  const mrpt::kinematics::CVehicleVelCmd::TVelCmdParams& newLimits);
199 
200  /** @} */
201 
202  /** \name Waypoint navigation control API
203  * @{ */
204 
205  /** Waypoint navigation request. This immediately cancels any other previous
206  * on-going navigation.
207  */
208  virtual void request_navigation(const WaypointSequence& navRequest);
209 
210  /** This method must be called periodically in order to effectively run the
211  * navigation */
212  virtual void navigation_step();
213 
214  /** Cancel current navegation. */
215  virtual void cancel();
216 
217  /** Continues with suspended navigation. \sa suspend */
218  virtual void resume();
219 
220  /** Suspend current navegation. \sa resume */
221  virtual void suspend();
222 
223  /** Resets a `NAV_ERROR` state back to `IDLE` */
224  virtual void reset_nav_error();
225 
226  /** Returns the current navigator status. */
227  inline NavStatus current_status() const { return navigationStatus_; }
228 
229  /** In case of status=NAV_ERROR, this returns the reason for the error.
230  * Error status is reseted every time a new navigation starts with
231  * a call to navigate(), or when reset_nav_error() is called.
232  */
233  inline const NavErrorReason& error_reason() const
234  {
235  return navErrorReason_;
236  }
237 
238  /** Get a copy of the control structure which describes the progress status
239  * of the waypoint navigation. */
240  WaypointStatusSequence waypoint_nav_status() const;
241 
242  /** Gets a write-enabled reference to the list of waypoints, simultaneously
243  * acquiring the critical section mutex.
244  * Caller must call endWaypointsAccess() when done editing the waypoints.
245  */
247  {
248  navMtx_.lock();
249  return innerState_.waypointNavStatus;
250  }
251 
252  /** Must be called after beginWaypointsAccess() */
253  void end_waypoints_access() { navMtx_.unlock(); }
254 
255  /** Publicly available time profiling object. Default: disabled */
256  mrpt::system::CTimeLogger navProfiler_{true /*enabled*/, "NavEngine"};
257 
258  /** @}*/
259 
261  {
262  PathPlannerOutput() = default;
263 
265 
266  /// A copy of the employed costs.
267  std::vector<CostEvaluator::Ptr> costEvaluators;
268 
269  /// (See same name field in PathPlannerInput)
270  std::optional<TNodeID> startingFromCurrentPlanNode;
271  /// (See same name field in PathPlannerInput)
272  std::optional<mrpt::math::TPose2D> startingFromCurrentPlanNodePose;
273  };
274 
275  /** Use the callbacks above and render_tree() to update a visualization
276  * with a given plan output */
277  void send_planner_output_to_viz(const PathPlannerOutput& ppo);
278 
279  /** Update the GUI with a partial or final path only (no whole tree) */
280  void send_path_to_viz_and_navlog(
281  const MotionPrimitivesTreeSE2& tree,
282  const std::optional<TNodeID>& finalNode,
283  const PlannerInput& originalPlanInput,
284  const std::vector<CostEvaluator::Ptr>& costEvaluators);
285 
286  /** Update current path plan visualization details in the GUI, or in the
287  * opengl object buffered to be writen to navlog files.
288  */
289  void send_current_state_to_viz_and_navlog();
290 
291  protected:
292  /** Current and last internal state of navigator: */
293  NavStatus navigationStatus_ = NavStatus::IDLE;
294  NavStatus lastNavigationState_ = NavStatus::IDLE;
296 
297  mrpt::system::output_logger_callback_t loggerToNavlog_;
298 
299  bool initialized_ = false;
300 
301  /** mutex for all navigation methods */
302  std::recursive_mutex navMtx_;
303 
304  /** Current robot kinematic state; Updated in navigation_step() with a
305  * minimum period of MIN_TIME_BETWEEN_POSE_UPDATES.
306  */
309  double lastVehiclePosRobotTime_ = 0;
310 
311  /** Events generated during navigation_step(), enqueued to be called at the
312  * end of the method execution to avoid user code to change the navigator
313  * state. */
314  std::list<std::function<void(void)>> pendingEvents_;
315 
316  void dispatch_pending_nav_events();
317 
318  /** Call to the robot getCurrentPoseAndSpeeds() and updates members
319  * m_curPoseVel accordingly.
320  * If an error is returned by the user callback, first, it calls
321  * robot.stop() ,then throws an std::runtime_error exception. */
322  virtual void update_robot_kinematic_state();
323 
324  /** The actual action that happens inside navigation_step() for the
325  * case of state being NAVIGATING.
326  */
327  virtual void impl_navigation_step();
328 
329  /** Implements the way to waypoint is free function in children classes:
330  * `true` must be returned
331  * if, according to the information gathered at the last navigation step,
332  * there is a free path to
333  * the given point; `false` otherwise: if way is blocked or there is
334  * missing information, the point is out of range, etc. */
335  // virtual bool impl_waypoint_is_reachable(
336  // const mrpt::math::TPoint2D& wp_local_wrt_robot) const = 0;
337 
338  void internal_on_start_new_navigation();
339  void internal_start_navlog_file();
340  void internal_write_to_navlog_file();
341 
342  /// Created in internal_start_navlog_file()
343  std::optional<mrpt::io::CFileGZOutputStream> navlog_output_file_;
344  bool navlogOutputFirstEntry_ = true;
345 
346  // Path planning in a parallel thread:
347  mrpt::WorkerThreadsPool pathPlannerPool_{
348  1 /*Single thread*/, mrpt::WorkerThreadsPool::POLICY_DROP_OLD,
349  "path_planner"};
350 
352  {
353  PathPlannerInput() = default;
354 
356 
357  /** If this is path refining plan request, this is the ID of the node
358  * that acts as starting state, with the ID in the current activePlan.
359  */
360  std::optional<TNodeID> startingFromCurrentPlanNode;
361  /** Like above, but with the SE(2) pose of that node. Used to tell from
362  * ambiguous situations where the node ID actually remains the same,
363  * but after a path merging, so the node pose is different.
364  */
365  std::optional<mrpt::math::TPose2D> startingFromCurrentPlanNodePose;
366  };
367 
368  // Argument is a copy instead of a const-ref intentionally.
369  PathPlannerOutput path_planner_function(PathPlannerInput ppi);
370 
371  struct AlignStatus
372  {
373  bool is_aligning() const { return isAligning_; }
374  bool is_aligning_after_overshoot() const { return isAfterOvershoot_; }
375  mrpt::math::TPoint2D target_waypoint{.0, .0};
376  void reset() { *this = AlignStatus(); }
377  double timeSinceLast() const
378  {
379  if (timeLastAlignCmd_ == INVALID_TIMESTAMP)
380  return 1e6;
381  else
382  return mrpt::system::timeDifference(
383  timeLastAlignCmd_, mrpt::system::now());
384  }
386  {
387  isAligning_ = true;
388  timeLastAlignCmd_ = mrpt::system::now();
389  }
391  {
392  setAsAligningNow();
393  isAfterOvershoot_ = true;
394  }
395 
396  private:
397  mrpt::system::TTimeStamp timeLastAlignCmd_ = INVALID_TIMESTAMP;
398  bool isAligning_ = false;
399  bool isAfterOvershoot_ = false;
400  };
401 
402  /** Everything that should be cleared upon a new navigation command. */
404  {
405  CurrentNavInternalState() = default;
406 
407  void clear() { *this = CurrentNavInternalState(); }
408 
409  /** The latest waypoints navigation command and the up-to-date control
410  * status. */
412 
413  /** Latest robot poses, updated in navigation_Step() */
414  mrpt::poses::CPose2DInterpolator latestPoses, latestOdomPoses;
415 
416  std::future<PathPlannerOutput> pathPlannerFuture;
417 
418  /** The final waypoint of the currently under-optimization/already
419  * finished path planning.
420  */
421  std::optional<waypoint_idx_t> pathPlannerTargetWpIdx;
422 
423  /// From check_immediate_collision(). For Debug visualization.
424  std::optional<mrpt::math::TPose2D> collisionCheckingPosePrediction;
425 
426  /** Set by check_new_planner_output() */
428  std::vector<MotionPrimitivesTreeSE2::node_t> activePlanPath;
429  std::vector<MotionPrimitivesTreeSE2::edge_t> activePlanPathEdges;
430 
431  /** A copy of the active queued condition, for viz purposes only
432  * (coordinates here are in the odometry frame)
433  */
434  std::optional<EnqueuedCondition> activeEnqueuedConditionForViz;
435 
436  /** A copy of the last odometry when an enqueued action was triggered,
437  * for viz purposed only */
438  std::optional<VehicleOdometryState> lastEnqueuedTriggerOdometry;
439 
440  void active_plan_reset(bool alsoClearComputedPath = false)
441  {
442  activePlanEdgeIndex.reset();
443  activePlanEdgeSentIndex.reset();
444  activePlanEdgesSentOut.clear();
445  activePlanInitOdometry.reset();
446 
447  if (alsoClearComputedPath)
448  {
449  activePlanOutput = {};
450  activePlanPath.clear();
451  activePlanPathEdges.clear();
452  pathPlannerTargetWpIdx.reset();
453  lastDistanceToGoalTimestamp.reset();
454  lastDistanceToGoal.reset();
455  }
456  }
457 
458  /** 0-based index of which edge in activePlanPathEdges[] is currently
459  * being executed by the robot. Empty if the plan is new and no order
460  * has been sent out to the robot yet.
461  * The i-th edge is moving between nodes [i] and [i+1] in
462  * activePlanPath.
463  */
464  std::optional<size_t> activePlanEdgeIndex;
465 
466  /** Will be equal to activePlanEdgeIndex once the command has been sent
467  * out to the robot */
468  std::optional<size_t> activePlanEdgeSentIndex;
469 
470  std::set<size_t> activePlanEdgesSentOut;
471 
472  /** The robot pose in the *odom* frame when the first motion edge is
473  * executed from send_next_motion_cmd_or_nop() */
474  std::optional<mrpt::math::TPose2D> activePlanInitOdometry;
475 
476  /** @name Data to be cleared upon each iteration
477  * @{ */
478  /** Copy of sent-out cmd, for the log record */
479  mrpt::kinematics::CVehicleVelCmd::Ptr sentOutCmdInThisIteration;
480  mrpt::opengl::CSetOfObjects::Ptr planVizForNavLog;
481  mrpt::opengl::CSetOfObjects::Ptr stateVizForNavLog;
482  std::vector<std::string> navlogDebugMessages;
483 
484  std::optional<double> lastNavigationStepEndTime;
485  std::optional<double> timStartThisNavStep;
486 
488  {
489  sentOutCmdInThisIteration.reset();
490  planVizForNavLog.reset();
491  stateVizForNavLog.reset();
492  navlogDebugMessages.clear();
493  }
494 
495  /** Values used to check against
496  * Configuration::timeoutNotGettingCloserGoal
497  */
498  std::optional<double> lastDistanceToGoalTimestamp, lastDistanceToGoal;
499 
500  /** @} */
501 
502  /** For sending an alarm (error event) when it seems that we are not
503  * approaching toward the target in a while... */
504  double badNavAlarmMinDistTarget_ = std::numeric_limits<double>::max();
505  mrpt::Clock::time_point badNavAlarmLastMinDistTime_ =
506  mrpt::Clock::now();
507 
508  /** Will be false until the navigation end is sent. */
509  bool navigationEndEventSent = false;
510  };
511 
512  /** Navigation state variables, protected by navMtx_ */
514 
515  /** Speed limits: If not defined, the values from the first PTG will be
516  * copied here upon initialize() */
517  mrpt::kinematics::CVehicleVelCmd::TVelCmdParams absoluteSpeedLimits_;
518 
519  /** Checks whether the current motion leads us into an obstacle */
520  void check_immediate_collision();
521 
522  /** Checks whether we need to launch a new RRT* path planner */
523  void check_have_to_replan();
524 
525  /** Checks whether the A* planner finished, then send a new active
526  * trajectory to the path tracker */
527  void check_new_planner_output();
528 
529  /** Checks and send next motion command, or NOP, if we are on track */
530  void send_next_motion_cmd_or_nop();
531 
532  /** Finds the next waypt index up to which we should find a new RRT*
533  plan */
534  waypoint_idx_t find_next_waypoint_for_planner();
535 
536  /** Enqueues a task in pathPlannerPool_ running path_planner_function() and
537  * saving future results into pathPlannerFuture.
538  *
539  * If this is a path refining, startingFrom and startingFromNodeID must be
540  * supplied, with the latter being the nodeId of the the plan starting state
541  * in activePlanOutput, activePlanPath, activePlanPathEdges.
542  */
543  void enqueue_path_planner_towards(
544  const waypoint_idx_t target, const mpp::SE2_KinState& startingFrom,
545  const std::optional<TNodeID>& startingFromNodeID = std::nullopt);
546 
547  /** Special behavior: if we are about to reach a WP with a stop condition,
548  * handle it specially if there's an obvious free path towards it.
549  * \return true if the special motion has been generated (or it's under
550  * execution). false if the regular path plan should go on.
551  * \note Call from within send_next_motion_cmd_or_nop()
552  */
553  bool approach_target_controller();
554 
555  void merge_new_plan_if_better(const PathPlannerOutput& result);
556 
557  void internal_mark_current_wp_as_reached();
558 
559  /** Returns true if all waypoints has been reached successfully. */
560  bool check_all_waypoints_are_done();
561 
563  {
564  AboutToReachWpInfo() = default;
565 
566  bool aboutToReach = false;
567  double distanceToWaypoint = std::numeric_limits<double>::max();
568  };
569 
570  /**
571  * @brief Checks whether the robot is within `maxDistanceForTargetApproach`
572  * meters of the next non-skippable waypoint. This does not check for
573  * potential obstacles, just the physical nearness.
574  * @return See AboutToReachWpInfo.
575  */
576  AboutToReachWpInfo internal_check_about_to_reach_stop_wp();
577 
578 #if 0
579  bool checkHasReachedTarget(const double targetDist) const override;
580 
581  /** The waypoints-specific part of navigation_step() */
582  virtual void waypoints_navigation_step();
583 
584  bool waypoints_isAligning() const { return m_is_aligning; }
585 
586  /** Whether the last timestep was "is_aligning" in a waypoint with heading
587  */
588  bool m_was_aligning{false};
589  bool m_is_aligning{false};
590  mrpt::system::TTimeStamp m_last_alignment_cmd;
591 #endif
592 };
593 
594 } // namespace mpp
595 
596 MRPT_ENUM_TYPE_BEGIN(mpp::NavStatus)
601 MRPT_ENUM_TYPE_END()
Definition: TPS_Astar.h:25
std::optional< waypoint_idx_t > pathPlannerTargetWpIdx
Definition: NavEngine.h:421
Definition: VehicleOdometryState.h:18
Definition: CostEvaluatorCostMap.h:26
std::optional< double > lastNavigationStepEndTime
Definition: NavEngine.h:484
std::vector< std::string > navlogDebugMessages
Definition: NavEngine.h:482
Definition: NavEngine.h:50
std::optional< EnqueuedCondition > activeEnqueuedConditionForViz
Definition: NavEngine.h:434
mrpt::opengl::CSetOfObjects::Ptr planVizForNavLog
Definition: NavEngine.h:480
std::optional< size_t > activePlanEdgeIndex
Definition: NavEngine.h:464
std::function< void(void)> on_viz_pre_modify
Definition: NavEngine.h:175
void clear()
Definition: NavEngine.h:407
Definition: CostEvaluatorPreferredWaypoint.h:26
const NavErrorReason & error_reason() const
Definition: NavEngine.h:233
Definition: bestTrajectory.h:15
std::optional< mrpt::math::TPose2D > startingFromCurrentPlanNodePose
Definition: NavEngine.h:365
std::shared_ptr< mrpt::opengl::CSetOfObjects > vizSceneToModify
Definition: NavEngine.h:176
std::vector< CostEvaluator::Ptr > costEvaluators
A copy of the employed costs.
Definition: NavEngine.h:267
void clearPerIterationData()
Definition: NavEngine.h:487
NavErrorReason navErrorReason_
Definition: NavEngine.h:295
std::optional< mrpt::math::TPose2D > activePlanInitOdometry
Definition: NavEngine.h:474
TrajectoriesAndRobotShape ptgs
Definition: NavEngine.h:117
Definition: TrajectoriesAndRobotShape.h:25
Definition: NavEngine.h:106
Definition: SE2_KinState.h:65
Definition: Waypoints.h:199
std::string error_msg
Human friendly description of the error.
Definition: NavEngine.h:54
std::optional< mrpt::math::TPose2D > startingFromCurrentPlanNodePose
(See same name field in PathPlannerInput)
Definition: NavEngine.h:272
CostEvaluatorCostMap::Parameters globalCostParameters
Definition: NavEngine.h:166
Configuration config_
Definition: NavEngine.h:187
void active_plan_reset(bool alsoClearComputedPath=false)
Definition: NavEngine.h:440
void setAsAligningNowAfterOvershoot()
Definition: NavEngine.h:390
Definition: PlannerInput.h:18
void end_waypoints_access()
Definition: NavEngine.h:253
double timeSinceLast() const
Definition: NavEngine.h:377
mrpt::kinematics::CVehicleVelCmd::TVelCmdParams absoluteSpeedLimits_
Definition: NavEngine.h:517
std::optional< mrpt::math::TPose2D > collisionCheckingPosePrediction
From check_immediate_collision(). For Debug visualization.
Definition: NavEngine.h:424
bool is_aligning_after_overshoot() const
Definition: NavEngine.h:374
std::list< std::function< void(void)> > pendingEvents_
Definition: NavEngine.h:314
mpp::PlannerInput pi
Definition: NavEngine.h:355
Definition: NavEngine.h:260
std::vector< MotionPrimitivesTreeSE2::node_t > activePlanPath
Definition: NavEngine.h:428
VehicleLocalizationState lastVehicleLocalization_
Definition: NavEngine.h:307
const mrpt::kinematics::CVehicleVelCmd::TVelCmdParams & absoluteSpeedLimits() const
Definition: NavEngine.h:190
CurrentNavInternalState innerState_
Definition: NavEngine.h:513
WaypointStatusSequence waypointNavStatus
Definition: NavEngine.h:411
void setAsAligningNow()
Definition: NavEngine.h:385
Definition: NavEngine.h:371
std::set< size_t > activePlanEdgesSentOut
Definition: NavEngine.h:470
Definition: PlannerOutput.h:19
WaypointStatusSequence & beginWaypointsAccess()
Definition: NavEngine.h:246
ObstacleSource::Ptr localSensedObstacleSource
Definition: NavEngine.h:115
Definition: Waypoints.h:146
std::shared_ptr< ObstacleSource > Ptr
Definition: ObstacleSource.h:20
Definition: NavEngine.h:94
CostEvaluatorPreferredWaypoint::Parameters preferWaypointsParameters
Definition: NavEngine.h:168
std::optional< VehicleOdometryState > lastEnqueuedTriggerOdometry
Definition: NavEngine.h:438
NavStatus
Definition: NavEngine.h:34
std::optional< double > lastDistanceToGoalTimestamp
Definition: NavEngine.h:498
Definition: NavEngine.h:562
NavStatus current_status() const
Definition: NavEngine.h:227
mrpt::opengl::CSetOfObjects::Ptr stateVizForNavLog
Definition: NavEngine.h:481
std::optional< TNodeID > startingFromCurrentPlanNode
Definition: NavEngine.h:360
TargetApproachController::Ptr targetApproachController
Definition: NavEngine.h:119
VehicleOdometryState lastVehicleOdometry_
Definition: NavEngine.h:308
mrpt::poses::CPose2DInterpolator latestPoses
Definition: NavEngine.h:414
std::recursive_mutex navMtx_
Definition: NavEngine.h:302
mpp::PlannerOutput po
Definition: NavEngine.h:264
Definition: NavEngine.h:351
mrpt::system::output_logger_callback_t loggerToNavlog_
Definition: NavEngine.h:297
mrpt::kinematics::CVehicleVelCmd::Ptr sentOutCmdInThisIteration
Definition: NavEngine.h:479
bool is_aligning() const
Definition: NavEngine.h:373
void reset()
Definition: NavEngine.h:376
CostEvaluatorCostMap::Parameters localCostParameters
Definition: NavEngine.h:167
std::future< PathPlannerOutput > pathPlannerFuture
Definition: NavEngine.h:416
VehicleMotionInterface::Ptr vehicleMotionInterface
Definition: NavEngine.h:112
NavError
Definition: NavEngine.h:43
NavEngine()
Definition: NavEngine.h:98
Definition: NavEngine.h:403
std::optional< TNodeID > startingFromCurrentPlanNode
(See same name field in PathPlannerInput)
Definition: NavEngine.h:270
Definition: VehicleLocalizationState.h:20
std::function< void(void)> on_viz_post_modify
Definition: NavEngine.h:177
TPS_Astar_Parameters plannerParams
Definition: NavEngine.h:164
PathPlannerOutput activePlanOutput
Definition: NavEngine.h:427
std::optional< size_t > activePlanEdgeSentIndex
Definition: NavEngine.h:468
std::optional< double > timStartThisNavStep
Definition: NavEngine.h:485
std::vector< MotionPrimitivesTreeSE2::edge_t > activePlanPathEdges
Definition: NavEngine.h:429
std::size_t waypoint_idx_t
Definition: Waypoints.h:25
std::optional< mrpt::io::CFileGZOutputStream > navlog_output_file_
Created in internal_start_navlog_file()
Definition: NavEngine.h:343