Parasol Planning Library (PPL)
|
#include <Environment.h>
Public Types | |
Local Types | |
typedef std::unordered_map< std::string, std::vector< Terrain > > | TerrainMap |
Public Member Functions | |
Construction | |
Environment () | |
Environment (XMLNode &_node) | |
Environment (const Environment &_other) | |
Copy. More... | |
Environment (Environment &&_other) | |
Move. More... | |
virtual | ~Environment () |
Assignment | |
Environment & | operator= (const Environment &_other) |
Copy. More... | |
Environment & | operator= (Environment &&_other) |
Move. More... | |
I/O | |
const std::string & | GetEnvFileName () const noexcept |
Get the environment file name. More... | |
void | ReadXMLOptions (XMLNode &_node) |
Parse XML options from the Problem XML node. More... | |
void | ReadXML (XMLNode &_node) |
Parse XML environment file. More... | |
void | Read (std::string _filename) |
void | Print (std::ostream &_os) const |
void | Write (std::ostream &_os) |
Resolutions | |
void | ComputeResolution (const std::vector< std::unique_ptr< Robot >> &_robots) |
double | GetPositionRes () const noexcept |
Get the position resolution. More... | |
void | SetPositionRes (double _res) noexcept |
Set the position resolution. More... | |
double | GetOrientationRes () const noexcept |
Get the orientation resolution. More... | |
void | SetOrientationRes (double _res) noexcept |
Set the orientation resolution. More... | |
double | GetTimeRes () const noexcept |
Get the time resolution. More... | |
Boundary Functions | |
Boundary * | GetBoundary () const noexcept |
Get the single boundary of the environemnt. More... | |
void | SetBoundary (std::unique_ptr< Boundary > &&_b) noexcept |
Obstacle Functions | |
size_t | NumObstacles () const noexcept |
Get the number of MultiBodies. More... | |
MultiBody * | GetObstacle (size_t _index) const |
MultiBody * | GetRandomObstacle () const |
size_t | AddObstacle (const std::string &_dir, const std::string &_filename, const mathtool::Transformation &_t=mathtool::Transformation()) |
void | RemoveObstacle (const size_t _position) |
void | RemoveObstacle (MultiBody *const _obst) |
std::map< mathtool::Vector3d, std::vector< size_t > > | ComputeObstacleVertexMap () const |
bool | UsingBoundaryObstacle () const noexcept |
Check if the boundary is also modeled as an obstacle. More... | |
Terrain Functions | |
const TerrainMap & | GetTerrains () const noexcept |
Get environment terrains. More... | |
Protected Member Functions | |
Helpers | |
void | InitializeBoundary (std::string _type, const std::string _where) |
void | CreateBoundaryObstacle () |
Create an obstacle for the boundary. More... | |
Protected Attributes | |
File Info | |
std::string | m_filename |
Which file did this environment come from? More... | |
std::string | m_modelDataDir |
Directory where environment file is located. More... | |
Resolution Info | |
double | m_positionRes {-1.} |
Positional resolution of movement. More... | |
double | m_orientationRes {.05} |
Rotational resolution of movement. More... | |
double | m_timeRes {.05} |
Resolution for time. More... | |
Models | |
std::unique_ptr< Boundary > | m_boundary |
Workspace boundary. More... | |
std::vector< std::unique_ptr< MultiBody > > | m_obstacles |
Obstacle multibodies. More... | |
bool | m_boundaryObstacle {false} |
Use the boundary as an obstacle? More... | |
Terrains | |
TerrainMap | m_terrains |
Environment terrains. More... | |
Simulation Properties | |
mathtool::Transformation | m_initialCameraTransform |
Camera starts here. More... | |
Simulation Functions | |
std::unique_ptr< Boundary > | m_originalBoundary |
const mathtool::Transformation & | GetInitialCameraTransformation () const noexcept |
Get the initial transformation for the camera. More... | |
bool | IsolateTerrain (Cfg start, Cfg goal) |
IROS Hacks. More... | |
bool | SameTerrain (Cfg _start, Cfg _goal) |
void | RestoreBoundary () |
Restores original boundary. More... | |
void | SaveBoundary () |
Saves boundary as original boundary. More... | |
Physical Properties | |
double | m_frictionCoefficient {0} |
The uniform friction coefficient. More... | |
mathtool::Vector3d | m_gravity |
The gravity direction and magnitude. More... | |
double | GetFrictionCoefficient () const noexcept |
Get the friction coefficient. More... | |
const mathtool::Vector3d & | GetGravity () const noexcept |
Get the gravity 3-vector. More... | |
Workspace for the motion planning problem, including a boundary and zero or more obstacles.
typedef std::unordered_map<std::string, std::vector<Terrain> > Environment::TerrainMap |
|
default |
|
explicit |
Environment::Environment | ( | const Environment & | _other | ) |
Copy.
|
default |
Move.
|
virtualdefault |
size_t Environment::AddObstacle | ( | const std::string & | _dir, |
const std::string & | _filename, | ||
const mathtool::Transformation & | _t = mathtool::Transformation() |
||
) |
Add an obstacle to the environment.
_dir | Directory for geometry file |
_filename | Geometry filename |
_t | Transformation of object |
std::map< Vector3d, std::vector< size_t > > Environment::ComputeObstacleVertexMap | ( | ) | const |
Compute a mapping of the obstacle vertices.
void Environment::ComputeResolution | ( | const std::vector< std::unique_ptr< Robot >> & | _robots | ) |
Automatically compute position resolution when not specified.
_robots | Robots to consider when determining resolution |
|
protected |
Create an obstacle for the boundary.
|
noexcept |
Get the single boundary of the environemnt.
|
noexcept |
Get the environment file name.
|
noexcept |
Get the friction coefficient.
|
noexcept |
Get the gravity 3-vector.
|
noexcept |
Get the initial transformation for the camera.
MultiBody * Environment::GetObstacle | ( | size_t | _index | ) | const |
Get requested obstacle
_index | Requested multibody |
|
noexcept |
Get the orientation resolution.
|
noexcept |
Get the position resolution.
MultiBody * Environment::GetRandomObstacle | ( | ) | const |
Get random multiboy
|
noexcept |
Get environment terrains.
|
noexcept |
Get the time resolution.
|
protected |
Initialize a boundary object of the appropriate type.
_type | Type of boundary object (box, box2d, sphere, or sphere2d) |
_where | String for parse exception |
IROS Hacks.
Determine if two configurations are in the same boundary of a terrain and, if so, sets mutual terrain as new boundary
_start | First configuration |
_end | Second configuration |
|
noexcept |
Get the number of MultiBodies.
Environment & Environment::operator= | ( | const Environment & | _other | ) |
Copy.
|
default |
Move.
void Environment::Print | ( | std::ostream & | _os | ) | const |
Print environment resolutions and boundary information.
_os | The output stream to print to. |
void Environment::Read | ( | std::string | _filename | ) |
Parse an old-style environment file.
_filename | The name of the file to read. |
void Environment::ReadXML | ( | XMLNode & | _node | ) |
Parse XML environment file.
void Environment::ReadXMLOptions | ( | XMLNode & | _node | ) |
Parse XML options from the Problem XML node.
void Environment::RemoveObstacle | ( | const size_t | _position | ) |
Remove an obstacle from the environment.
_position | Index in m_obstacleBodies to be removed |
void Environment::RemoveObstacle | ( | MultiBody *const | _obst | ) |
Remove obstacle from environment
_obst | Obstacle to be removed |
void Environment::RestoreBoundary | ( | ) |
Restores original boundary.
Determine if two configurations are in the same terrain
_start | First configuration |
_end | Second configuration |
void Environment::SaveBoundary | ( | ) |
Saves boundary as original boundary.
|
noexcept |
Get the single boundary of the environemnt
_b | The new boundary |
|
noexcept |
Set the orientation resolution.
|
noexcept |
Set the position resolution.
|
noexcept |
Check if the boundary is also modeled as an obstacle.
void Environment::Write | ( | std::ostream & | _os | ) |
Output environment to .env file format.
_os | The output stream to write to. |
|
protected |
Workspace boundary.
|
protected |
Use the boundary as an obstacle?
|
protected |
Which file did this environment come from?
|
protected |
The uniform friction coefficient.
|
protected |
The gravity direction and magnitude.
|
protected |
Camera starts here.
|
protected |
Directory where environment file is located.
|
protected |
Obstacle multibodies.
|
protected |
Rotational resolution of movement.
std::unique_ptr<Boundary> Environment::m_originalBoundary |
|
protected |
Positional resolution of movement.
|
protected |
Environment terrains.
|
protected |
Resolution for time.