Loading...
Searching...
No Matches
AORRTC.h
1/*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2025, Queen's University
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the Willow Garage nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34
35/* Author: Tyler Wilson */
36
37#ifndef OMPL_GEOMETRIC_PLANNERS_RRT_AORRTC_
38#define OMPL_GEOMETRIC_PLANNERS_RRT_AORRTC_
39
40#include "ompl/datastructures/NearestNeighbors.h"
41#include "ompl/geometric/planners/PlannerIncludes.h"
42#include "ompl/base/OptimizationObjective.h"
43#include "ompl/geometric/PathSimplifier.h"
44
45#include "ompl/geometric/planners/rrt/AOXRRTConnect.h"
46
47namespace ompl
48{
49 namespace geometric
50 {
72
74 class AORRTC : public base::Planner
75 {
76 public:
78 AORRTC(const base::SpaceInformationPtr &si);
79
80 ~AORRTC() override;
81
82 void getPlannerData(base::PlannerData &data) const override;
83
85
86 void clear() override;
87
88 void setup() override;
89
90 void reset(bool solvedProblem);
91
92 void setProblemDefinition(const base::ProblemDefinitionPtr &pdef) override;
93
94 void setRange(double distance)
95 {
96 maxDistance_ = distance;
97 }
98
100 double getRange() const
101 {
102 return maxDistance_;
103 }
104
107 {
108 return psk_;
109 }
110
113 {
114 return psk_;
115 }
116
119 void simplifySolution(const base::PathPtr &p, const base::PlannerTerminationCondition &ptc);
120
123
124 protected:
127
128 std::shared_ptr<ompl::geometric::AOXRRTConnect> aox_planner;
129
131 void freeMemory();
132
134 double maxDistance_{0.};
135
136 double inflationFactor_{1.};
137
140
141 base::PathPtr bestPath_{nullptr};
142
143 ompl::base::Cost bestCost_{std::numeric_limits<double>::infinity()};
144
146 base::OptimizationObjectivePtr opt_;
147
148 double initCost_;
149 ompl::base::PlannerStatus solve_status;
150 };
151 } // namespace geometric
152} // namespace ompl
153
154#endif
Random number generation. An instance of this class cannot be used by multiple threads at once (membe...
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition Cost.h:48
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique,...
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
Base class for a planner.
Definition Planner.h:216
ompl::base::Cost bestCost() const
Retrieve the best exact-solution cost found.
Definition AORRTC.cpp:60
base::OptimizationObjectivePtr opt_
Objective we're optimizing.
Definition AORRTC.h:146
PathSimplifierPtr psk_
The instance of the path simplifier.
Definition AORRTC.h:139
void clear() override
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...
Definition AORRTC.cpp:53
const PathSimplifierPtr & getPathSimplifier() const
Get the path simplifier.
Definition AORRTC.h:106
AORRTC(const base::SpaceInformationPtr &si)
Constructor.
Definition AORRTC.cpp:42
PathSimplifierPtr & getPathSimplifier()
Get the path simplifier.
Definition AORRTC.h:112
void setup() override
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
Definition AORRTC.cpp:65
void freeMemory()
Free the memory allocated by this planner.
Definition AORRTC.cpp:100
RNG rng_
The random number generator.
Definition AORRTC.h:126
void getPlannerData(base::PlannerData &data) const override
Get information about the current run of the motion planner. Repeated calls to this function will upd...
Definition AORRTC.cpp:226
void simplifySolution(const base::PathPtr &p, const base::PlannerTerminationCondition &ptc)
Attempt to simplify the current solution path. Stop computation when ptc becomes true at the latest.
Definition AORRTC.cpp:105
base::PlannerStatus solve(const base::PlannerTerminationCondition &ptc) override
Function that can solve the motion planning problem. This function can be called multiple times on th...
Definition AORRTC.cpp:119
double getRange() const
Get the range the planner is using.
Definition AORRTC.h:100
double maxDistance_
The maximum length of a motion to be added to a tree.
Definition AORRTC.h:134
A shared pointer wrapper for ompl::geometric::PathSimplifier.
This namespace contains code that is specific to planning under geometric constraints.
Main namespace. Contains everything in this library.
A class to store the exit status of Planner::solve().