PPL API Reference |
|
---|
Public Member Functions | |
Simulation Interface | |
void | Initialize () |
Set up the simulation. | |
void | Uninitialize () |
Tear down the simulation. | |
void | SimulationStep () |
Advance the simulation one timestep. | |
void | EditStep () |
Update the drawable transforms to match those in the MPProblem. | |
Rendering Interface | |
virtual void | render () override |
virtual void | start () override |
virtual void | reset () override |
void | SetBacklog (const size_t _max) |
Additional Visualization | |
size_t | AddPath (const std::vector< Cfg > &_path, const glutils::color &_c) |
void | RemovePath (const size_t _id) |
size_t | AddRoadmap (RoadmapGraph< Cfg, DefaultWeight< Cfg > > *_graph, const glutils::color &_c) |
void | RemoveRoadmap (const size_t _id) |
size_t | AddBoundary (const Boundary *const _boundary, const glutils::color &_c, const bool _wired=true) |
void | RemoveBoundary (const size_t _id) |
void | TransformBoundary (const size_t _id, const glutils::transform &_t) |
size_t | AddWorkspaceSkeleton (WorkspaceSkeleton *const _skeleton, const glutils::color &_c) |
Editing | |
void | RebuildMultiBody (DrawableMultiBody *const _m) |
Static Public Member Functions | |
Accessors | |
static Simulation * | Get () noexcept |
Get the singleton. | |
static size_t | NearestNumSteps (const double _dt) noexcept |
static size_t | GetTimestamp () noexcept |
Construction | |
static void | Create (MPProblem *_problem, const bool _edit=false) |
virtual | ~Simulation () |
Performance Measurement | |
static StatClass * | GetStatClass () noexcept |
Get the simulator's stat class for time profiling. | |
void | PrintStatFile (const std::string &_basename="") |
Simulate an MPProblem using the bullet physics engine. Rendering is performed by the base_visualization parent class.
|
static |
Create the singleton.
_problem | The MPProblem to simulate. |
_edit | Start in edit mode instead of the physical simulator? |
|
staticnoexcept |
Get the nearest number of timesteps needed to represent a continuous time interval.
_dt | The time interval. |
|
staticnoexcept |
Get the current timestamp.
void Simulation::SetBacklog | ( | const size_t | _max | ) |
Set the maximum number of frames that the simulator can pre-compute.
_max | The maximum number of backlogged frames to compute. |
size_t Simulation::AddPath | ( | const std::vector< Cfg > & | _path, |
const glutils::color & | _c | ||
) |
Add a path graphic to the scene as a sequence of connected line segments.
_path | The path to render. |
_c | The line color. |
void Simulation::RemovePath | ( | const size_t | _id | ) |
Remove a path graphic from the scene.
_id | The path ID. |
size_t Simulation::AddRoadmap | ( | RoadmapGraph< Cfg, DefaultWeight< Cfg > > * | _graph, |
const glutils::color & | _c | ||
) |
Add a roadmap graphic to the scene.
_graph | the graph to rendered |
_c | The line color. |
void Simulation::RemoveRoadmap | ( | const size_t | _id | ) |
Remove a roadmap graphic from the scene.
_id | The path ID. |
size_t Simulation::AddBoundary | ( | const Boundary *const | _boundary, |
const glutils::color & | _c, | ||
const bool | _wired = true |
||
) |
Add a boundary graphic to the scene.
_boundary | The boundary to be rendered |
_c | The rendering color. |
_wired | Render in wireframe if true, solid if false. |
void Simulation::RemoveBoundary | ( | const size_t | _id | ) |
Remove a boundary graphic from the scene.
_id | The boundary ID. |
void Simulation::TransformBoundary | ( | const size_t | _id, |
const glutils::transform & | _t | ||
) |
Update a boundary graphic.
_id | The boundary ID. |
_t | The transformation to apply. |
size_t Simulation::AddWorkspaceSkeleton | ( | WorkspaceSkeleton *const | _skeleton, |
const glutils::color & | _c | ||
) |
Add a workspace skeleton rendering to to the scene.
_skeleton | The workspace skeleton. |
_c | The rendering color. |
void Simulation::RebuildMultiBody | ( | DrawableMultiBody *const | _m | ) |
Rebuild the physics engine's model for a given multibody.
_m | The drawable multibody to rebuild. @WARNING The simulation will lock while you do this! |
void Simulation::PrintStatFile | ( | const std::string & | _basename = "" | ) |
Print the simulator's stats to an output file.
_basename | The base name for the output file, or empty to use the MPProblem base name. |