Bench-MR
A Motion Planning Benchmark for Wheeled Mobile Robots
Public Member Functions | Protected Attributes | List of all members
Environment Class Reference

#include <Environment.h>

Inheritance diagram for Environment:
Inheritance graph
[legend]
Collaboration diagram for Environment:
Collaboration graph
[legend]

Public Member Functions

 Environment ()
 
virtual ~Environment ()=default
 
void setStart (const Point &point)
 
const Pointstart () const
 
void setGoal (const Point &point)
 
const Pointgoal () const
 
virtual bool collides (double x, double y)
 
virtual bool collides (const Polygon &polygon)
 
bool collides (const Point &p)
 
bool collides (const ompl::geometric::PathGeometric &trajectory)
 
bool collides (const ob::State *state)
 
bool checkValidity (const ob::State *state)
 Used by planners to determine if the state is valid or not. More...
 
const ob::RealVectorBounds & bounds () const
 
double width () const
 
double height () const
 
virtual double distance (double x, double y)
 Compute distance from xy-coordinate to the closest obstacle if possible. More...
 
double distance (const ob::State *state)
 Compute distance of a state to the closest obstacle if possible. More...
 
double bilinearDistance (double x, double y, double cellSize=1)
 Bilinear filtering of distance. More...
 
double bilinearDistance (const Point &point, double cellSize=1)
 
double bilinearDistance (const ob::State *state, double cellSize=1)
 
bool distanceGradient (double x, double y, double &dx, double &dy, double p=0.1, double cellSize=1)
 Computes negative gradient of distance field at position x, y. More...
 
virtual std::string name () const
 
void estimateStartGoalOrientations ()
 Estimates potentially suitable theta values for the start and goal state by running a simple line search from start to goal. More...
 
bool thetasDefined () const
 
void setThetas (double start, double goal)
 
ompl::base::StatestartState () const
 
ompl::base::StategoalState () const
 
ompl::base::ScopedState< ob::SE2StateSpace > startScopedState () const
 
ompl::base::ScopedState< ob::SE2StateSpace > goalScopedState () const
 
ob::RealVectorBounds getBounds () const
 
double startTheta () const
 
double goalTheta () const
 
virtual void to_json (nlohmann::json &j)
 
virtual double unit () const
 Unit, e.g. More...
 
void resetCollisionTimer ()
 
double elapsedCollisionTime () const
 

Protected Attributes

Point _start
 
Point _goal
 
double _start_theta {0}
 
double _goal_theta {0}
 
bool _thetas_defined {false}
 
ob::RealVectorBounds _bounds {2}
 
Stopwatch _collision_timer
 

Constructor & Destructor Documentation

◆ Environment()

Environment::Environment ( )

◆ ~Environment()

virtual Environment::~Environment ( )
virtualdefault

Member Function Documentation

◆ bilinearDistance() [1/3]

double Environment::bilinearDistance ( const ob::State state,
double  cellSize = 1 
)
inline

◆ bilinearDistance() [2/3]

double Environment::bilinearDistance ( const Point point,
double  cellSize = 1 
)
inline

◆ bilinearDistance() [3/3]

double Environment::bilinearDistance ( double  x,
double  y,
double  cellSize = 1 
)

Bilinear filtering of distance.

◆ bounds()

const ob::RealVectorBounds & Environment::bounds ( ) const
inline

◆ checkValidity()

bool Environment::checkValidity ( const ob::State state)

Used by planners to determine if the state is valid or not.

◆ collides() [1/5]

bool Environment::collides ( const ob::State state)
inline

◆ collides() [2/5]

bool Environment::collides ( const ompl::geometric::PathGeometric &  trajectory)

◆ collides() [3/5]

bool Environment::collides ( const Point p)
inline

◆ collides() [4/5]

virtual bool Environment::collides ( const Polygon polygon)
inlinevirtual

Reimplemented in GridMaze, and PolygonMaze.

◆ collides() [5/5]

virtual bool Environment::collides ( double  x,
double  y 
)
inlinevirtual

Reimplemented in GridMaze, and PolygonMaze.

◆ distance() [1/2]

double Environment::distance ( const ob::State state)
inline

Compute distance of a state to the closest obstacle if possible.

This currently assumes a point robot and does not support a check for arbitrary polygons. (will only use x and y component of state)

Parameters
stateThe state to check.
Returns
The distance to the closest obstacle.

◆ distance() [2/2]

virtual double Environment::distance ( double  x,
double  y 
)
inlinevirtual

Compute distance from xy-coordinate to the closest obstacle if possible.

This currently assumes a point robot and does not support a check for arbitrary polygons.

Parameters
xX-coordinate of the point to check.
yY-Coordinate of the point to check.
Returns
The distance to the closest obstacle.

Reimplemented in GridMaze.

◆ distanceGradient()

bool Environment::distanceGradient ( double  x,
double  y,
double &  dx,
double &  dy,
double  p = 0.1,
double  cellSize = 1 
)

Computes negative gradient of distance field at position x, y.

Parameters
xPosition coordinate x.
yPosition coordinate y.
dxResulting gradient coordinate x.
dyResulting gradient coordinate y.
pSampling precision.
Returns
True, if x and y are within grid boundaries.

◆ elapsedCollisionTime()

double Environment::elapsedCollisionTime ( ) const
inline

◆ estimateStartGoalOrientations()

void Environment::estimateStartGoalOrientations ( )

Estimates potentially suitable theta values for the start and goal state by running a simple line search from start to goal.

This feature is useful for approaches that operate on the SE2 state space and cannot find good start / goal angles themselves (e.g. SBPL).

◆ getBounds()

ob::RealVectorBounds Environment::getBounds ( ) const
inline

◆ goal()

const Point & Environment::goal ( ) const
inline

◆ goalScopedState()

ompl::base::ScopedState< ob::SE2StateSpace > Environment::goalScopedState ( ) const

◆ goalState()

ompl::base::State * Environment::goalState ( ) const
inline

◆ goalTheta()

double Environment::goalTheta ( ) const
inline

◆ height()

double Environment::height ( ) const
inline

◆ name()

virtual std::string Environment::name ( ) const
inlinevirtual

Reimplemented in GridMaze, and PolygonMaze.

◆ resetCollisionTimer()

void Environment::resetCollisionTimer ( )
inline

◆ setGoal()

void Environment::setGoal ( const Point point)

◆ setStart()

void Environment::setStart ( const Point point)

◆ setThetas()

void Environment::setThetas ( double  start,
double  goal 
)

◆ start()

const Point & Environment::start ( ) const
inline

◆ startScopedState()

ompl::base::ScopedState< ob::SE2StateSpace > Environment::startScopedState ( ) const

◆ startState()

ompl::base::State * Environment::startState ( ) const
inline

◆ startTheta()

double Environment::startTheta ( ) const
inline

◆ thetasDefined()

bool Environment::thetasDefined ( ) const
inline

◆ to_json()

virtual void Environment::to_json ( nlohmann::json &  j)
inlinevirtual

Reimplemented in GridMaze, and PolygonMaze.

◆ unit()

virtual double Environment::unit ( ) const
inlinevirtual

Unit, e.g.

used by Theta* to determine neighboring states.

Reimplemented in PolygonMaze.

◆ width()

double Environment::width ( ) const
inline

Member Data Documentation

◆ _bounds

ob::RealVectorBounds Environment::_bounds {2}
protected

◆ _collision_timer

Stopwatch Environment::_collision_timer
protected

◆ _goal

Point Environment::_goal
protected

◆ _goal_theta

double Environment::_goal_theta {0}
protected

◆ _start

Point Environment::_start
protected

◆ _start_theta

double Environment::_start_theta {0}
protected

◆ _thetas_defined

bool Environment::_thetas_defined {false}
protected

The documentation for this class was generated from the following files: