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 +
34 "../share/mrpt/config_files/navigation-ptgs/"
35 "ptrrt_config_example1.ini"));
49 cout <<
"Loading map...";
55 cout <<
"Done! Number of sensory frames: " << simplemap.
size() << endl;
107 #if MRPT_HAS_WXWIDGETS
111 for (
size_t i = 0; i < 1; i++)
115 bool refine_solution =
false;
118 if (!refine_solution)
122 planner.
solve(planner_input, planner_result);
124 cout <<
"Found goal_distance: " << planner_result.
goal_distance << endl;
125 cout <<
"Found path_cost: " << planner_result.
path_cost << endl;
126 cout <<
"Acceptable goal nodes: "
129 #if MRPT_HAS_WXWIDGETS
135 PlannerRRT_SE2_TPS::TRenderPlannedPathOptions render_opts;
136 render_opts.highlight_path_to_node_id =
140 *scene, planner_input, planner_result, render_opts);
142 win.unlockAccess3DScene();
149 int main(
int argc,
char** argv)
158 cout <<
"MRPT exception caught: " << e.what() << endl;
163 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
double x
X,Y,Z coordinates.
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.
double maxComputationTime
In seconds.
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).
void solve(const TPlannerInput &pi, TPlannerResult &result)
The main API entry point: tries to find a planned path from 'goal' to 'target'.
std::shared_ptr< COpenGLScene > Ptr
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
double DEG2RAD(const double x)
Degrees to radians.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |