Go to the documentation of this file.
27 #include <mrpt/examples_config.h>
29 MRPT_EXAMPLES_BASE_DIRECTORY +
30 string(
"../share/mrpt/datasets/malaga-cs-fac-building.simplemap.gz"));
32 MRPT_EXAMPLES_BASE_DIRECTORY +
33 string(
"../share/mrpt/config_files/navigation-ptgs/"
34 "ptrrt_config_example1.ini"));
48 cout <<
"Loading map...";
54 cout <<
"Done! Number of sensory frames: " << simplemap.
size() << endl;
106 #if MRPT_HAS_WXWIDGETS
110 for (
size_t i = 0; i < 1; i++)
114 bool refine_solution =
false;
117 if (!refine_solution)
121 planner.
solve(planner_input, planner_result);
123 cout <<
"Found goal_distance: " << planner_result.
goal_distance << endl;
124 cout <<
"Found path_cost: " << planner_result.
path_cost << endl;
125 cout <<
"Acceptable goal nodes: "
128 #if MRPT_HAS_WXWIDGETS
134 PlannerRRT_SE2_TPS::TRenderPlannedPathOptions render_opts;
135 render_opts.highlight_path_to_node_id =
139 *scene, planner_input, planner_result, render_opts);
141 win.unlockAccess3DScene();
157 cout <<
"MRPT exception caught: " << e.what() << endl;
162 printf(
"Another exception!!");
void Randomize(const uint32_t seed)
Randomize the generators.
double minDistanceBetweenNewNodes
Minimum distance [meters] to nearest node to accept creating a new one (default=0....
mrpt::graphs::TNodeID best_goal_node_id
The ID of the best target node in the tree.
double minComputationTime
In seconds.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double goalBias
Probabily of picking the goal as random target (in [0,1], default=0.05)
RRTAlgorithmParams params
Parameters specific to this path solver algorithm.
double goal_distance
Distance from best found path to goal.
std::set< mrpt::graphs::TNodeID > acceptable_goal_node_ids
The set of target nodes within an acceptable distance to target (including best_goal_node_id and othe...
void initialize()
Must be called after setting all params (see loadConfig()) and before calling solve()
size_t save_3d_log_freq
Frequency (in iters) of saving tree state to debug log files viewable in SceneViewer3D (default=0,...
mrpt::gui::CDisplayWindow3D::Ptr win
void boundingBox(float &min_x, float &max_x, float &min_y, float &max_y, float &min_z, float &max_z) const
Computes the bounding box of all the points, or (0,0 ,0,0, 0,0) if there are no points.
size_t size() const
Returns the count of pairs (pose,sensory data)
double path_cost
Total cost of the best found path (cost ~~ Euclidean distance)
TP Space-based RRT path planning for SE(2) (planar) robots.
constexpr double DEG2RAD(const double x)
Degrees to radians
double maxComputationTime
In seconds.
std::shared_ptr< mrpt::opengl ::COpenGLScene > Ptr
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream,...
double minAngBetweenNewNodes
Minimum angle [rad] to nearest node to accept creating a new one (default=15 deg) (Any of minDistance...
double acceptedDistToTarget
Maximum distance from a pose to target to accept it as a valid solution (meters).
void loadFromSimpleMap(const mrpt::maps::CSimpleMap &Map)
!This is an overloaded member function, provided for convenience. It differs from the above function ...
string myCfgFileName(MRPT_EXAMPLES_BASE_DIRECTORY+string("../share/mrpt/config_files/navigation-ptgs/" "ptrrt_config_example1.ini"))
This class allows loading and storing values and vectors of different types from "....
This class stores a sequence of <Probabilistic Pose,SensoryFrame> pairs, thus a "metric map" can be t...
double acceptedAngToTarget
Maximum angle from a pose to target to accept it as a valid solution (rad).
TPoint2D_< double > TPoint2D
Lightweight 2D point.
void solve(const TPlannerInput &pi, TPlannerResult &result)
The main API entry point: tries to find a planned path from 'goal' to 'target'.
string mySimpleMap(MRPT_EXAMPLES_BASE_DIRECTORY+string("../share/mrpt/datasets/malaga-cs-fac-building.simplemap.gz"))
void loadConfig(const mrpt::config::CConfigFileBase &cfgSource, const std::string &sSectionName=std::string("PTG_CONFIG"))
Load all params from a config file source.
#define ASSERT_FILE_EXISTS_(FIL)
void renderMoveTree(mrpt::opengl::COpenGLScene &scene, const TPlannerInputTempl< node_pose_t, world_limits_t > &pi, const TPlannerResultTempl< tree_t > &result, const TRenderPlannedPathOptions &options)
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
double maxLength
(Very sensitive parameter!) Max length of each edge path (in meters, default=1.0)
RRTEndCriteria end_criteria
Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 | |