Bench-MR
A Motion Planning Benchmark for Wheeled Mobile Robots
|
Helper for common operations during planning and evaluation. More...
#include <PlannerUtils.hpp>
Public Member Functions | |
PlannerUtils ()=delete | |
Static Public Member Functions | |
template<typename N > | |
static double | slope (const N &x1, const N &y1, const N &x2, const N &y2) |
Compute the angular slope between two points. More... | |
static double | slope (const Point &a, const Point &b) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
static double | slope (const ompl::base::State *a, const ompl::base::State *b) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
static bool | equals (const ompl::base::State *a, const ompl::base::State *b) |
Check whether two states are equal (up to some tolerance). More... | |
static std::vector< Point > | toSteeredPoints (const ob::State *a, const ob::State *b) |
static bool | collides (const std::vector< Point > &path) |
Check whether points on a path collide with the environment. More... | |
static bool | collides (const ompl::geometric::PathGeometric &path) |
Collision check that respects the collision model. More... | |
static bool | collides (const ompl::base::State *a, const ompl::base::State *b) |
Collision check of segment between two states. More... | |
static bool | collides (const ompl::base::State *a, const ompl::base::State *b, og::PathGeometric &path) |
Collision check that respects the collision model. More... | |
static bool | collides (const std::vector< Point > &path, std::vector< Point > &collisions) |
Check whether points on a path collide with the environment. More... | |
static bool | collides (const ompl::base::State *a, const ompl::base::State *b, std::vector< Point > &collisions) |
Collision check of segment between two states. More... | |
static ompl::geometric::PathGeometric | interpolated (ompl::geometric::PathGeometric path) |
Interpolate path based on its associated state space. More... | |
static ompl::control::PathControl | interpolated (ompl::control::PathControl path) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
static void | updateAngles (ompl::geometric::PathGeometric &path, bool AverageAngles=true, bool preventCollisions=true) |
static void | gradientDescent (ompl::geometric::PathGeometric &path, unsigned int rounds, double eta, double discount=1.) |
static void | gradientDescent (std::vector< Point > &path, unsigned int rounds, double eta, double discount=1.) |
static std::vector< Point > | linearInterpolate (const Point &a, const Point &b, double dt=0.1) |
Linearly interpolate between two points. More... | |
static std::vector< Point > | linearInterpolate (ompl::base::State *a, ompl::base::State *b, double dt=0.1) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This does not take into account yaw and returns a list of xy points. More... | |
static ompl::base::State * | closestPoint (Point x, const std::vector< Point > &points) |
Find closest collision-free point in an ordered set of points. More... | |
static double | totalLength (const std::vector< Point > &path) |
Compute total length of a path. More... | |
static std::vector< Point > | equidistantSampling (const std::vector< Point > &path, size_t targetSize) |
Compute equidistance samples along path. More... | |
template<typename N > | |
static std::string | num2str (const N &v, unsigned int precision=3) |
Convert a number to a string with the given precision. More... | |
static double | normalizeAngle (double angle) |
Normalize angle in radians to the interval \((-\pi, \pi]\). More... | |
Helper for common operations during planning and evaluation.
Contains static functions for collision checking, and other path evaluations.
|
delete |
|
inlinestatic |
Find closest collision-free point in an ordered set of points.
The closest point will be converted to a state, whose yaw is computed based on neighboring points.
x | The reference point. |
points | The collection of points to check. |
x
.
|
inlinestatic |
Collision check of segment between two states.
The collision model is set in PlannerSettings::GlobalSettings::EnvironmentSettings::CollisionSettings::collision_model. The environment is set through PlannerSettings::GlobalSettings::environment. The steering function used to compute the path between the two state is defined by PlannerSettings::GlobalSettings::OmplSettings::state_space.
a | The first state of the path segment to check. |
b | The last state of the path segment to check. |
|
inlinestatic |
Collision check that respects the collision model.
The path is interpolated prior to collision checking.
The collision model is set in PlannerSettings::GlobalSettings::EnvironmentSettings::CollisionSettings::collision_model. The environment is set through PlannerSettings::GlobalSettings::environment. Interpolation is based on the state space of the path.
a | Deprecated. |
b | Deprecated. |
The | OMPL path to check. |
|
inlinestatic |
Collision check of segment between two states.
The collision model is set in PlannerSettings::GlobalSettings::EnvironmentSettings::CollisionSettings::collision_model. The environment is set through PlannerSettings::GlobalSettings::environment. The steering function used to compute the path between the two state is defined by PlannerSettings::GlobalSettings::OmplSettings::state_space.
a | The first state of the path segment to check. |
b | The last state of the path segment to check. |
collisions | Points that collide with the environment. |
|
inlinestatic |
Collision check that respects the collision model.
No additional interpolation along the path is performed prior to collision checking.
The collision model is set in PlannerSettings::GlobalSettings::EnvironmentSettings::CollisionSettings::collision_model. The environment is set through PlannerSettings::GlobalSettings::environment.
The | OMPL path to check. |
|
inlinestatic |
Check whether points on a path collide with the environment.
This function does not consider the collision model, since points only contain x and y coordinates. The environment is set through PlannerSettings::GlobalSettings::environment.
path | The points on the path. |
|
inlinestatic |
Check whether points on a path collide with the environment.
This function does not consider the collision model, since points only contain x and y coordinates. The environment is set through PlannerSettings::GlobalSettings::environment.
path | The points on the path. |
collisions | Points that collide with the environment. |
|
inlinestatic |
Check whether two states are equal (up to some tolerance).
Check compares x, y, and yaw difference. All have to be within tolerance for states to be considered equal. Tolerance is set in PlannerSettings::GlobalSettings::OmplSettings::state_equality_tolerance.
a | The first state. |
b | The second state. |
|
inlinestatic |
Compute equidistance samples along path.
path | The input path. |
targetSize | The number of equdistant samples on the output path. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The | control path to interpolate. |
|
inlinestatic |
Interpolate path based on its associated state space.
The | geometric path to interpolate. |
|
inlinestatic |
Linearly interpolate between two points.
a | The first point. |
b | The last point. |
dt | The step to take (where \(t\) parametrizes the line, i.e., \(t\in[0,1]\)). |
a
to b
, including both of these points.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This does not take into account yaw and returns a list of xy points.
a | The first state. |
b | The last state. |
dt | The step to take (where \(t\) parametrizes the line, i.e., \(t\in[0,1]\)). |
a
to b
, including both of these points.
|
inlinestatic |
Normalize angle in radians to the interval \((-\pi, \pi]\).
angle | The angle to normalize. |
|
inlinestatic |
Convert a number to a string with the given precision.
v | The number to convert to a string. |
precision | The precision used when converting the number to a string. |
|
inlinestatic |
Compute the angular slope between two points.
The slope will be zero, for example, for a line from \((0,0)\) to \((1,0)\). The slope will be \(\frac{\pi}{2}\), for example, for a line from \((0,0)\) to \((0,1)\).
x1 | X-coordinate of first point. |
y1 | Y-coordinate of first point. |
x2 | X-coorindate of second point. |
y2 | Y-coordinate of second point. |
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
a | The state containing the first point. |
b | The state containing the second point. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
a | The first point. |
b | The second point. |
|
inlinestatic |
|
inlinestatic |
Compute total length of a path.
The length between two points is calculated as Euclidean distance. The total length is computed as the sum of pairwise distances.
path | The ordered points along the path. |
|
inlinestatic |