RobWorkProject
Public Types | Public Member Functions | List of all members
AssemblySimulator Class Reference

A simulator for execution of AssemblyTasks. More...

#include <AssemblySimulator.hpp>

Public Types

typedef rw::common::Ptr< AssemblySimulatorPtr
 smart pointer type of this class
 

Public Member Functions

 AssemblySimulator (rw::common::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, const std::string &engineID, rw::common::Ptr< rwsim::contacts::ContactDetector > contactDetector=NULL, rw::common::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::common::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::common::Ptr< rwlibs::assembly::AssemblyTask > > tasks)
 Set the tasks that should be executed in the simulator. More...
 
std::vector< rw::common::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...
 

Detailed Description

A simulator for execution of AssemblyTasks.

Constructor & Destructor Documentation

◆ AssemblySimulator()

AssemblySimulator ( rw::common::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
const std::string &  engineID,
rw::common::Ptr< rwsim::contacts::ContactDetector contactDetector = NULL,
rw::common::Ptr< rwsim::log::SimulatorLogScope verbose = NULL 
)

Construct new simulator.

Parameters
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.

Member Function Documentation

◆ getDt()

double getDt ( ) const

Get the size of the timestep used in simulation.

Returns
the size of the timestep

◆ getMaxSimTime()

double getMaxSimTime ( ) const

Get the currently set limit for the simulation time per task.

Returns
the maximum simulated time to spend on a single task.

◆ getResults()

std::vector<rw::common::Ptr<rwlibs::assembly::AssemblyResult> > getResults ( )

Retrieve the results after simulation.

Returns
a vector of AssemblyResults.

◆ getStartInApproach()

bool getStartInApproach ( ) const

Test whether or not the simulation is set up to start in the approach pose.

Returns
true if simulation should start in approach pose.

◆ isRunning()

bool isRunning ( )

Check if simulator is running.

Returns
true if running.

◆ setDt()

void setDt ( double  dt = 0.001)

Set the size of the timestep to use in simulation.

Parameters
dt[in] the stepsize (default is 0.001 seconds).

◆ setMaxSimTime()

void setMaxSimTime ( double  maxTime)

Set the limit for simulation time per task.

Parameters
maxTime[in] the maximum simulated time to spend on a single task.

◆ setStartInApproach()

void setStartInApproach ( bool  val = false)

Start simulation directly in the approach position as given by the strategy.

Parameters
val[in] true if simulation should start in approach pose (default is false).

◆ setStoreExecutionData()

void setStoreExecutionData ( bool  enable)

Enable storing trajectory data in the AssemblyResult.

Parameters
enable[in] true if trajectory data should be stored, false otherwise.

◆ setTasks()

void setTasks ( std::vector< rw::common::Ptr< rwlibs::assembly::AssemblyTask > >  tasks)

Set the tasks that should be executed in the simulator.

Parameters
tasks[in] the tasks to execute.

◆ start()

void start ( rw::common::Ptr< rw::common::ThreadTask task = NULL)

Run the simulation.

Parameters
task(optional) if this simulator runs in a ThreadTask, pass a pointer to this task to let the simulator add work for parallel processing.

◆ storeExecutionData()

bool storeExecutionData ( )

Check if trajectory data is currently being stored.

Returns
true if trajectory data is stored, false otherwise.

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