-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRIG.cpp
More file actions
36 lines (28 loc) · 882 Bytes
/
RIG.cpp
File metadata and controls
36 lines (28 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "RIG.h"
RIG::RIG(const ompl::base::SpaceInformationPtr &si) :
ompl::base::Planner(si, "RIG")
{
}
RIG::~RIG()
{
}
ompl::base::PlannerStatus RIG::solve(const ompl::base::PlannerTerminationCondition &ptc)
{
// Ensure that the planner is set up correctly (at least one input state and a
// goal are set).
checkValidity();
ompl::base::Goal *goal = pdef_->getGoal().get();
// Add all of the start states to the graph.
while (const ompl::base::State *st = pis_.nextStart()) {
Motion *motion = new Motion(si_);
si_->copyState(motion->state, st);
nn_->add(motion);
}
if (nn_->size() == 0) {
OMPL_ERROR("%s: There are no start states!", getName().c_str());
return ompl::base::PlannerStatus::INVALID_START;
}
while (ptc() == false) {
}
return ompl::base::PlannerStatus::APPROXIMATE_SOLUTION;
}