![]() |
RobWorkProject
24.12.4-
|
A simulator for execution of AssemblyTasks. More...
#include <AssemblySimulator.hpp>
Public Types | |
typedef rw::core::Ptr< AssemblySimulator > | Ptr |
smart pointer type of this class | |
Public Member Functions | |
AssemblySimulator (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, const std::string &engineID, rw::core::Ptr< rwsim::contacts::ContactDetector > contactDetector=NULL, rw::core::Ptr< rwsim::log::SimulatorLogScope > verbose=NULL) | |
Construct new simulator. More... | |
virtual | ~AssemblySimulator () |
Destructor. | |
double | getDt () const |
Get the size of the timestep used in simulation. More... | |
void | setDt (double dt=0.001) |
Set the size of the timestep to use in simulation. More... | |
void | start (rw::core::Ptr< rw::common::ThreadTask > task=NULL) |
Run the simulation. More... | |
void | stopFinishCurrent () |
Request stop when current tasks has finished. | |
void | stopCancelCurrent () |
Request immediate stop. Current tasks are cancelled. | |
bool | isRunning () |
Check if simulator is running. More... | |
void | setTasks (std::vector< rw::core::Ptr< rwlibs::assembly::AssemblyTask >> tasks) |
Set the tasks that should be executed in the simulator. More... | |
std::vector< rw::core::Ptr< rwlibs::assembly::AssemblyResult > > | getResults () |
Retrieve the results after simulation. More... | |
void | setStoreExecutionData (bool enable) |
Enable storing trajectory data in the AssemblyResult. More... | |
bool | storeExecutionData () |
Check if trajectory data is currently being stored. More... | |
double | getMaxSimTime () const |
Get the currently set limit for the simulation time per task. More... | |
void | setMaxSimTime (double maxTime) |
Set the limit for simulation time per task. More... | |
bool | getStartInApproach () const |
Test whether or not the simulation is set up to start in the approach pose. More... | |
void | setStartInApproach (bool val=false) |
Start simulation directly in the approach position as given by the strategy. More... | |
A simulator for execution of AssemblyTasks.
AssemblySimulator | ( | rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > | dwc, |
const std::string & | engineID, | ||
rw::core::Ptr< rwsim::contacts::ContactDetector > | contactDetector = NULL , |
||
rw::core::Ptr< rwsim::log::SimulatorLogScope > | verbose = NULL |
||
) |
Construct new simulator.
dwc | [in] the dynamic workcell. |
engineID | [in] the simulator to use for dynamic simulation (for instance "ODE"). |
contactDetector | [in] (optional) set a contact detector that should be used by the PhysicsEngine. |
verbose | [in] (optional) set a logging structure to log to. |
double getDt | ( | ) | const |
Get the size of the timestep used in simulation.
double getMaxSimTime | ( | ) | const |
Get the currently set limit for the simulation time per task.
std::vector<rw::core::Ptr<rwlibs::assembly::AssemblyResult> > getResults | ( | ) |
Retrieve the results after simulation.
bool getStartInApproach | ( | ) | const |
Test whether or not the simulation is set up to start in the approach pose.
bool isRunning | ( | ) |
Check if simulator is running.
void setDt | ( | double | dt = 0.001 | ) |
Set the size of the timestep to use in simulation.
dt | [in] the stepsize (default is 0.001 seconds). |
void setMaxSimTime | ( | double | maxTime | ) |
Set the limit for simulation time per task.
maxTime | [in] the maximum simulated time to spend on a single task. |
void setStartInApproach | ( | bool | val = false | ) |
Start simulation directly in the approach position as given by the strategy.
val | [in] true if simulation should start in approach pose (default is false). |
void setStoreExecutionData | ( | bool | enable | ) |
Enable storing trajectory data in the AssemblyResult.
enable | [in] true if trajectory data should be stored, false otherwise. |
void setTasks | ( | std::vector< rw::core::Ptr< rwlibs::assembly::AssemblyTask >> | tasks | ) |
Set the tasks that should be executed in the simulator.
tasks | [in] the tasks to execute. |
void start | ( | rw::core::Ptr< rw::common::ThreadTask > | task = NULL | ) |
Run the simulation.
task | (optional) if this simulator runs in a ThreadTask, pass a pointer to this task to let the simulator add work for parallel processing. |
bool storeExecutionData | ( | ) |
Check if trajectory data is currently being stored.