37#include "KoulesConfig.h"
38#include "KoulesStateSpace.h"
39#include "KoulesProjection.h"
43KoulesStateSpace::KoulesStateSpace(
unsigned int numKoules)
44 : RealVectorStateSpace(4 * numKoules + 5), mass_(numKoules + 1, kouleMass), radius_(numKoules + 1, kouleRadius)
47 radius_[0] = shipRadius;
48 setName(
"Koules" + std::to_string(numKoules) + getName());
57 bounds_.setLow(j, shipRadius);
58 bounds_.setHigh(j++, sideLength - shipRadius);
59 bounds_.setLow(j, shipRadius);
60 bounds_.setHigh(j++, sideLength - shipRadius);
62 bounds_.setLow(j, -10.);
63 bounds_.setHigh(j++, 10.);
64 bounds_.setLow(j, -10.);
65 bounds_.setHigh(j++, 10.);
67 bounds_.setLow(j, -boost::math::constants::pi<double>());
68 bounds_.setHigh(j++, boost::math::constants::pi<double>());
69 for (
unsigned int i = 0; i < numKoules; ++i)
72 bounds_.setLow(j, -2. * kouleRadius);
73 bounds_.setHigh(j++, sideLength + 2. * kouleRadius);
74 bounds_.setLow(j, -2. * kouleRadius);
75 bounds_.setHigh(j++, sideLength + 2. * kouleRadius);
77 bounds_.setLow(j, -10);
78 bounds_.setHigh(j++, 10.);
79 bounds_.setLow(j, -10.);
80 bounds_.setHigh(j++, 10.);
84void KoulesStateSpace::registerProjections()
86 registerDefaultProjection(std::make_shared<KoulesProjection>(
this, 3));
87 registerProjection(
"PDSTProjection", std::make_shared<KoulesProjection>(
this, (getDimension() - 1) / 2 + 1));
90bool KoulesStateSpace::isDead(
const ompl::base::State *state,
unsigned int i)
const
92 const auto *s =
static_cast<const StateType *
>(state);
93 return s->values[i != 0u ? 4 * i + 1 : 0] == -2. * kouleRadius;
Definition of an abstract state.
This namespace contains sampling based planning routines shared by both planning under geometric cons...