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!!");
double minComputationTime
In seconds.
double minDistanceBetweenNewNodes
Minimum distance [meters] to nearest node to accept creating a new one (default=0.10).
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...
mrpt::graphs::TNodeID best_goal_node_id
The ID of the best target node in the tree.
This class stores a sequence of <Probabilistic Pose,SensoryFrame> pairs, thus a "metric map" can be t...
double DEG2RAD(const double x)
Degrees to radians.
double maxLength
(Very sensitive parameter!) Max length of each edge path (in meters, default=1.0) ...
This class allows loading and storing values and vectors of different types from ".ini" files easily.
double minAngBetweenNewNodes
Minimum angle [rad] to nearest node to accept creating a new one (default=15 deg) (Any of minDistance...
size_t save_3d_log_freq
Frequency (in iters) of saving tree state to debug log files viewable in SceneViewer3D (default=0...
void initialize()
Must be called after setting all params (see loadConfig()) and before calling solve() ...
double acceptedAngToTarget
Maximum angle from a pose to target to accept it as a valid solution (rad).
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream, std::istream, std::ostream, std::stringstream
void Randomize(const uint32_t seed)
Randomize the generators.
double x
X,Y,Z coordinates.
double acceptedDistToTarget
Maximum distance from a pose to target to accept it as a valid solution (meters). ...
size_t size() const
Returns the count of pairs (pose,sensory data)
RRTEndCriteria end_criteria
mrpt::gui::CDisplayWindow3D::Ptr win
void loadConfig(const mrpt::config::CConfigFileBase &cfgSource, const std::string &sSectionName=std::string("PTG_CONFIG"))
Load all params from a config file source.
double path_cost
Total cost of the best found path (cost ~~ Euclidean distance)
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.
void solve(const TPlannerInput &pi, TPlannerResult &result)
The main API entry point: tries to find a planned path from 'goal' to 'target'.
double maxComputationTime
In seconds.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
RRTAlgorithmParams params
Parameters specific to this path solver algorithm.
double goal_distance
Distance from best found path to goal.
double goalBias
Probabily of picking the goal as random target (in [0,1], default=0.05)
string myCfgFileName(MRPT_EXAMPLES_BASE_DIRECTORY+string("../share/mrpt/config_files/navigation-ptgs/" "ptrrt_config_example1.ini"))
void renderMoveTree(mrpt::opengl::COpenGLScene &scene, const TPlannerInputTempl< node_pose_t, world_limits_t > &pi, const TPlannerResultTempl< tree_t > &result, const TRenderPlannedPathOptions &options)
#define ASSERT_FILE_EXISTS_(FIL)
void loadFromSimpleMap(const mrpt::maps::CSimpleMap &Map)
!
TP Space-based RRT path planning for SE(2) (planar) robots.
string mySimpleMap(MRPT_EXAMPLES_BASE_DIRECTORY+string("../share/mrpt/datasets/malaga-cs-fac-building.simplemap.gz"))
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.