MRPT  2.0.4
PlannerSimple2D.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 #include <mrpt/math/TPoint2D.h>
13 #include <mrpt/poses/CPose2D.h>
14 
15 namespace mrpt::nav
16 {
17 /** \addtogroup nav_planners Path planning
18  * \ingroup mrpt_nav_grp
19  * @{ */
20 
21 /** Searches for collision-free path in 2D occupancy grids for holonomic
22  * circular robots.
23  * The implementation first enlargest obstacles with robot radius, then applies
24  * a
25  * wavefront algorithm to find the shortest free path between origin and target
26  * 2D points.
27  *
28  * Notice that this simple planner does not take into account robot kinematic
29  * constraints.
30  */
32 {
33  public:
34  PlannerSimple2D() = default;
35  virtual ~PlannerSimple2D() = default;
36 
37  /** The maximum occupancy probability to consider a cell as an obstacle,
38  * default=0.5 */
39  float occupancyThreshold{0.5f};
40 
41  /** The minimum distance between points in the returned found path
42  * (default=0.4); Notice
43  * that full grid resolution is used in path finding, this is only a way
44  * to reduce the
45  * amount of redundant information to be returned.
46  */
47  float minStepInReturnedPath{0.4f};
48 
49  /** The aproximate robot radius used in the planification. Default is 0.35m
50  */
51  float robotRadius{0.35f};
52 
53  /** This method compute the optimal path for a circular robot, in the given
54  * occupancy grid map, from the origin location to a target point.
55  * The options and additional parameters to this method can be set with
56  * member configuration variables.
57  *
58  * \param theMap [IN] The occupancy gridmap used to the planning.
59  * \param origin [IN] The starting pose of the robot, in coordinates of
60  * "map".
61  * \param target [IN] The desired target pose for the robot, in
62  * coordinates of "map".
63  * \param path [OUT] The found path, in global coordinates relative
64  * to "map".
65  * \param notFount [OUT] Will be true if no path has been found.
66  * \param maxSearchPathLength [IN] The maximum path length to search for,
67  * in meters (-1 = no limit)
68  *
69  * \sa robotRadius
70  *
71  * \note If either the origin or the target are out of the gridmap
72  * extensions, `notFound` will be returned as `true`.
73  *
74  * \exception std::exception On any error
75  */
76  void computePath(
77  const mrpt::maps::COccupancyGridMap2D& theMap,
78  const mrpt::poses::CPose2D& origin, const mrpt::poses::CPose2D& target,
79  std::deque<mrpt::math::TPoint2D>& path, bool& notFound,
80  float maxSearchPathLength = -1) const;
81 };
82 
83 /** @} */
84 } // namespace mrpt::nav
float robotRadius
The aproximate robot radius used in the planification.
virtual ~PlannerSimple2D()=default
Searches for collision-free path in 2D occupancy grids for holonomic circular robots.
float minStepInReturnedPath
The minimum distance between points in the returned found path (default=0.4); Notice that full grid r...
void computePath(const mrpt::maps::COccupancyGridMap2D &theMap, const mrpt::poses::CPose2D &origin, const mrpt::poses::CPose2D &target, std::deque< mrpt::math::TPoint2D > &path, bool &notFound, float maxSearchPathLength=-1) const
This method compute the optimal path for a circular robot, in the given occupancy grid map...
float occupancyThreshold
The maximum occupancy probability to consider a cell as an obstacle, default=0.5. ...
A class for storing an occupancy grid map.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:39



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