SimulatedWorld Class Referenceabstract

The SimulatedWorld class encapsulates the whole physics simulation and the corresponding data. More...

#include <ArmarXSimulation/components/Simulator/SimulatedWorld.h>

+ Inheritance diagram for SimulatedWorld:

Classes

struct  GraspingInfo
 

Public Types

using MutexPtrType = typename argType< setMutexFunc >::type
 
using MutexType = MutexPtrType::element_type
 
using ScopedRecursiveLock = std::scoped_lock< MutexType >
 
using ScopedRecursiveLockPtr = std::shared_ptr< ScopedRecursiveLock >
 
using setMutexFunc = decltype(&SimDynamics::DynamicsEngine::setMutex)
 

Public Member Functions

virtual void activateObject (const std::string &objectName)
 
virtual void actuateRobotJoints (const std::string &robotName, const std::map< std::string, float > &angles, const std::map< std::string, float > &velocities)=0
 
virtual void actuateRobotJointsPos (const std::string &robotName, const std::map< std::string, float > &angles)=0
 
virtual void actuateRobotJointsTorque (const std::string &robotName, const std::map< std::string, float > &torques)=0
 
virtual void actuateRobotJointsVel (const std::string &robotName, const std::map< std::string, float > &velocities)=0
 
virtual VirtualRobot::RobotPtr adaptRobotToWorld (VirtualRobot::RobotPtr)
 
virtual bool addObstacle (const std::string &filename, const Eigen::Matrix4f &pose=Eigen::Matrix4f::Identity(), VirtualRobot::SceneObject::Physics::SimulationType simType=VirtualRobot::SceneObject::Physics::eUnknown, const std::string &localFilename="")
 Load and add an Obstacle (VirtualRobot xml file). More...
 
virtual bool addObstacle (VirtualRobot::SceneObjectPtr o, VirtualRobot::SceneObject::Physics::SimulationType simType=VirtualRobot::SceneObject::Physics::eUnknown, const std::string &filename="", const std::string &objectClassName="", ObjectVisuPrimitivePtr primitiveData={}, const std::string &project="")
 
virtual bool addRobot (std::string &robotInstanceName, const std::string &filename, Eigen::Matrix4f pose=Eigen::Matrix4f::Identity(), const std::string &filenameLocal="", double pid_p=10.0, double pid_i=0, double pid_d=0, bool staticRobot=false, float scaling=1.0f, bool colModel=false, const std::map< std::string, float > &initConfig={}, bool selfCollisions=false)
 Load and add a robot. More...
 
virtual bool addRobot (VirtualRobot::RobotPtr robot, double pid_p, double pid_i, double pid_d, const std::string &filename, bool staticRobot=false, float scaling=1.0f, bool colModel=false, bool selfCollisions=false)
 
virtual bool addScene (const std::string &filename, VirtualRobot::SceneObject::Physics::SimulationType simType=VirtualRobot::SceneObject::Physics::eUnknown)
 Load and add an Scene (VirtualRobot xml file). More...
 
virtual bool addScene (VirtualRobot::ScenePtr scene, VirtualRobot::SceneObject::Physics::SimulationType simType=VirtualRobot::SceneObject::Physics::eUnknown)
 
virtual void applyForceObject (const std::string &objectName, const Eigen::Vector3f &force)=0
 
virtual void applyForceRobotNode (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &force)=0
 
virtual void applyTorqueObject (const std::string &objectName, const Eigen::Vector3f &torque)=0
 
virtual void applyTorqueRobotNode (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &torque)=0
 
virtual std::vector< SimDynamics::DynamicsEngine::DynamicsContactInfo > copyContacts ()=0
 
virtual SimulatedWorldData copyReportData ()
 
virtual SceneVisuData copySceneVisuData ()
 copySceneVisuData Creates a copy of the visualization data More...
 
virtual void enableLogging (const std::string &robotName, const std::string &logFile)
 
virtual int getContactCount ()
 
virtual double getCurrentSimTime ()
 
virtual armarx::DistanceInfo getDistance (const std::string &robotName, const std::string &robotNodeName, const std::string &worldObjectName)=0
 
virtual int getFixedTimeStepMS ()=0
 
virtual int getObjectCount ()
 
virtual Eigen::Matrix4f getObjectPose (const std::string &objectName)=0
 
virtual std::vector< VirtualRobot::SceneObjectPtr > getObjects ()=0
 
virtual std::vector< std::string > getObstacleNames ()=0
 
virtual SimulatedWorldDatagetReportData ()
 
virtual VirtualRobot::RobotPtr getRobot (const std::string &robotName)=0
 
virtual Eigen::Vector3f getRobotAngularVelocity (const std::string &robotName, const std::string &nodeName)=0
 
virtual ForceTorqueDataSeq getRobotForceTorqueSensors (const std::string &robotName)=0
 
virtual float getRobotJointAngle (const std::string &robotName, const std::string &nodeName)=0
 
virtual int getRobotJointAngleCount ()
 
virtual std::map< std::string, floatgetRobotJointAngles (const std::string &robotName)=0
 
virtual float getRobotJointLimitHi (const std::string &robotName, const std::string &nodeName)=0
 
virtual float getRobotJointLimitLo (const std::string &robotName, const std::string &nodeName)=0
 
virtual std::map< std::string, floatgetRobotJointTorques (const std::string &robotName)=0
 
virtual std::map< std::string, floatgetRobotJointVelocities (const std::string &robotName)=0
 
virtual float getRobotJointVelocity (const std::string &robotName, const std::string &nodeName)=0
 
virtual Eigen::Vector3f getRobotLinearVelocity (const std::string &robotName, const std::string &nodeName)=0
 
virtual float getRobotMass (const std::string &robotName)=0
 
virtual float getRobotMaxTorque (const std::string &robotName, const std::string &nodeName)=0
 
virtual std::vector< std::string > getRobotNames ()=0
 
virtual armarx::DistanceInfo getRobotNodeDistance (const std::string &robotName, const std::string &robotNodeName1, const std::string &robotNodeName2)=0
 
virtual Eigen::Matrix4f getRobotNodePose (const std::string &robotName, const std::string &robotNodeName)=0
 
virtual Eigen::Matrix4f getRobotPose (const std::string &robotName)=0
 
virtual std::map< std::string, VirtualRobot::RobotPtrgetRobots ()=0
 
virtual ScopedRecursiveLockPtr getScopedEngineLock (const std::string &callStr)
 
virtual ScopedRecursiveLockPtr getScopedSyncLock (const std::string &callStr)
 
virtual float getSimTime ()
 
virtual float getSimulationStepDuration ()
 getSimulationStepDuration More...
 
virtual float getSimulationStepTimeMeasured ()
 getSimulationStepTimeMeasured More...
 
virtual float getSyncEngineTime ()
 
virtual bool hasObject (const std::string &instanceName)=0
 
virtual bool hasRobot (const std::string &robotName)=0
 
virtual bool hasRobotNode (const std::string &robotName, const std::string &robotNodeName)=0
 
virtual void objectGrasped (const std::string &robotName, const std::string &robotNodeName, const std::string &objectName)
 create a joint More...
 
virtual void objectReleased (const std::string &robotName, const std::string &robotNodeName, const std::string &objectName)
 remove a joint More...
 
virtual bool removeObstacle (const std::string &name)
 
virtual bool removeObstacles ()
 
virtual bool removeRobot (const std::string &robotName)
 
virtual bool removeRobots ()
 
virtual bool resetData ()
 resetData Clears all data More...
 
virtual void resetSimTime ()
 
virtual void setObjectPose (const std::string &objectName, const Eigen::Matrix4f &globalPose)=0
 
virtual void setObjectSimType (const std::string &objectName, VirtualRobot::SceneObject::Physics::SimulationType simType)=0
 
virtual void setRobotAngularVelocity (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel)=0
 
virtual void setRobotAngularVelocityRobotRootFrame (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel)=0
 
virtual void setRobotLinearVelocity (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel)=0
 
virtual void setRobotLinearVelocityRobotRootFrame (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel)=0
 
virtual void setRobotMaxTorque (const std::string &robotName, const std::string &nodeName, float maxTorque)=0
 
virtual void setRobotNodeSimType (const std::string &robotName, const std::string &robotNodeName, VirtualRobot::SceneObject::Physics::SimulationType simType)=0
 
virtual void setRobotPose (const std::string &robotName, const Eigen::Matrix4f &globalPose)=0
 
virtual void setupFloor (bool enable, const std::string &floorTexture)
 
 SimulatedWorld ()
 
virtual void stepPhysicsFixedTimeStep ()=0
 Perform one simulation step. More...
 
virtual void stepPhysicsRealTime ()=0
 Perform one simulation step. More...
 
virtual bool synchronizeSimulationData ()
 synchronizeSimulationData Update the sim data according to the internal physics models. More...
 
virtual FramedPosePtr toFramedPose (const Eigen::Matrix4f &globalPose, const std::string &robotName, const std::string &frameName)=0
 toFramedPose Constructs a framed pose More...
 
virtual void updateContacts (bool enable)
 
virtual ~SimulatedWorld () override=default
 
- Public Member Functions inherited from Logging
SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
 disables the logging for the current line for the given amount of seconds. More...
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More...
 
void setTag (const LogTag &tag)
 
void setTag (const std::string &tagName)
 
virtual ~Logging ()
 

Protected Member Functions

virtual bool addObstacleEngine (VirtualRobot::SceneObjectPtr o, VirtualRobot::SceneObject::Physics::SimulationType simType)=0
 
virtual bool addRobotEngine (VirtualRobot::RobotPtr robot, double pid_p, double pid_i, double pid_d, const std::string &filename, bool staticRobot, bool selfCollisions)=0
 
virtual VirtualRobot::SceneObjectPtr getFloor ()=0
 
virtual bool getRobotStatus (const std::string &robotName, NameValueMap &jointAngles, NameValueMap &jointVelocities, NameValueMap &jointTorques, Eigen::Vector3f &linearVelocity, Eigen::Vector3f &angularVelocity)=0
 
virtual bool objectGraspedEngine (const std::string &robotName, const std::string &robotNodeName, const std::string &objectName, Eigen::Matrix4f &storeLocalTransform)=0
 create a joint More...
 
virtual bool objectReleasedEngine (const std::string &robotName, const std::string &robotNodeName, const std::string &objectName)=0
 remove a joint More...
 
virtual bool removeObstacleEngine (const std::string &name)=0
 
virtual bool removeRobotEngine (const std::string &robotName)=0
 
virtual void setupFloorEngine (bool enable, const std::string &floorTexture)=0
 
virtual bool synchronizeObjects ()=0
 
virtual bool synchronizeRobotNodePoses (const std::string &robotName, std::map< std::string, armarx::PoseBasePtr > &objMap)=0
 
virtual bool synchronizeRobots ()
 
virtual bool synchronizeSceneObjectPoses (VirtualRobot::SceneObjectPtr currentObjEngine, std::map< std::string, armarx::PoseBasePtr > &objMap)=0
 
virtual bool synchronizeSimulationDataEngine ()=0
 
virtual bool updateForceTorqueSensor (ForceTorqueInfo &ftInfo)=0
 
- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender. More...
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 

Protected Attributes

std::vector< GraspingInfoattachedObjects
 
bool collectContacts
 
double currentSimTimeSec = 0.0
 
double currentSyncTimeSec = 0.0
 
std::map< std::string, int > engineMtxAccCalls
 
std::map< std::string, floatengineMtxAccTime
 
std::map< std::string, IceUtil::Time > engineMtxLastTime
 
MutexPtrType engineMutex
 
float maxRealTimeSimSpeed = 1
 
SimulatedWorldData simReportData
 
float simStepExecutionDurationMS
 
float simTimeStepMS
 
SceneVisuData simVisuData
 
float synchronizeDurationMS
 
MutexPtrType synchronizeMutex
 
std::map< std::string, int > syncMtxAccCalls
 
std::map< std::string, floatsyncMtxAccTime
 
std::map< std::string, IceUtil::Time > syncMtxLastTime
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Detailed Description

The SimulatedWorld class encapsulates the whole physics simulation and the corresponding data.

Definition at line 128 of file SimulatedWorld.h.

Member Typedef Documentation

◆ MutexPtrType

using MutexPtrType = typename argType<setMutexFunc>::type

Definition at line 315 of file SimulatedWorld.h.

◆ MutexType

using MutexType = MutexPtrType::element_type

Definition at line 316 of file SimulatedWorld.h.

◆ ScopedRecursiveLock

using ScopedRecursiveLock = std::scoped_lock<MutexType>

Definition at line 318 of file SimulatedWorld.h.

◆ ScopedRecursiveLockPtr

using ScopedRecursiveLockPtr = std::shared_ptr<ScopedRecursiveLock>

Definition at line 319 of file SimulatedWorld.h.

◆ setMutexFunc

using setMutexFunc = decltype(&SimDynamics::DynamicsEngine::setMutex)

Definition at line 314 of file SimulatedWorld.h.

Constructor & Destructor Documentation

◆ SimulatedWorld()

Definition at line 52 of file SimulatedWorld.cpp.

◆ ~SimulatedWorld()

virtual ~SimulatedWorld ( )
overridevirtualdefault

Member Function Documentation

◆ activateObject()

void activateObject ( const std::string &  objectName)
virtual

Reimplemented in BulletPhysicsWorld.

Definition at line 64 of file SimulatedWorld.cpp.

◆ actuateRobotJoints()

virtual void actuateRobotJoints ( const std::string &  robotName,
const std::map< std::string, float > &  angles,
const std::map< std::string, float > &  velocities 
)
pure virtual

◆ actuateRobotJointsPos()

virtual void actuateRobotJointsPos ( const std::string &  robotName,
const std::map< std::string, float > &  angles 
)
pure virtual

◆ actuateRobotJointsTorque()

virtual void actuateRobotJointsTorque ( const std::string &  robotName,
const std::map< std::string, float > &  torques 
)
pure virtual

◆ actuateRobotJointsVel()

virtual void actuateRobotJointsVel ( const std::string &  robotName,
const std::map< std::string, float > &  velocities 
)
pure virtual

◆ adaptRobotToWorld()

VirtualRobot::RobotPtr adaptRobotToWorld ( VirtualRobot::RobotPtr  robot)
virtual

Reimplemented in BulletPhysicsWorld.

Definition at line 458 of file SimulatedWorld.cpp.

◆ addObstacle() [1/2]

bool addObstacle ( const std::string &  filename,
const Eigen::Matrix4f &  pose = Eigen::Matrix4f::Identity(),
VirtualRobot::SceneObject::Physics::SimulationType  simType = VirtualRobot::SceneObject::Physics::eUnknown,
const std::string &  localFilename = "" 
)
virtual

Load and add an Obstacle (VirtualRobot xml file).

Parameters
filenameThe obstacle xml file
poseThe inital pose (mm)
simTypeeUnknown: use sim type of SceneObject, to overwrite internal simType use: eStatic: cannot move, but collide; eKinematic: can be moved, but no dynamics; eDynamic: full dynamic simulation

Definition at line 601 of file SimulatedWorld.cpp.

◆ addObstacle() [2/2]

bool addObstacle ( VirtualRobot::SceneObjectPtr  o,
VirtualRobot::SceneObject::Physics::SimulationType  simType = VirtualRobot::SceneObject::Physics::eUnknown,
const std::string &  filename = "",
const std::string &  objectClassName = "",
ObjectVisuPrimitivePtr  primitiveData = {},
const std::string &  project = "" 
)
virtual

Definition at line 652 of file SimulatedWorld.cpp.

◆ addObstacleEngine()

virtual bool addObstacleEngine ( VirtualRobot::SceneObjectPtr  o,
VirtualRobot::SceneObject::Physics::SimulationType  simType 
)
protectedpure virtual

◆ addRobot() [1/2]

bool addRobot ( std::string &  robotInstanceName,
const std::string &  filename,
Eigen::Matrix4f  pose = Eigen::Matrix4f::Identity(),
const std::string &  filenameLocal = "",
double  pid_p = 10.0,
double  pid_i = 0,
double  pid_d = 0,
bool  staticRobot = false,
float  scaling = 1.0f,
bool  colModel = false,
const std::map< std::string, float > &  initConfig = {},
bool  selfCollisions = false 
)
virtual

Load and add a robot.

addRobot Load and add int to the scene

Parameters
filenameThe absolute filename
poseThe initial pose (4x4matrix, in MM)
filenameLocalThe local filename (i.e. not the absolute one)
pid_pPID control paramters, currently all joints use the same pid values
pid_iPID control paramters, currently all joints use the same pid values
pid_dPID control paramters, currently all joints use the same pid values
staticRobotIf set, the robot is added as a static/fixed kinematic object which does not move due to physics (it may be actuated by setting the position of the joints)
scalingThe scaling of the robot (1 = no scaling).
colModelUse the collision model for visualization.
Returns

Definition at line 335 of file SimulatedWorld.cpp.

+ Here is the call graph for this function:

◆ addRobot() [2/2]

bool addRobot ( VirtualRobot::RobotPtr  robot,
double  pid_p,
double  pid_i,
double  pid_d,
const std::string &  filename,
bool  staticRobot = false,
float  scaling = 1.0f,
bool  colModel = false,
bool  selfCollisions = false 
)
virtual

Definition at line 125 of file SimulatedWorld.cpp.

◆ addRobotEngine()

virtual bool addRobotEngine ( VirtualRobot::RobotPtr  robot,
double  pid_p,
double  pid_i,
double  pid_d,
const std::string &  filename,
bool  staticRobot,
bool  selfCollisions 
)
protectedpure virtual

◆ addScene() [1/2]

bool addScene ( const std::string &  filename,
VirtualRobot::SceneObject::Physics::SimulationType  simType = VirtualRobot::SceneObject::Physics::eUnknown 
)
virtual

Load and add an Scene (VirtualRobot xml file).

Parameters
filenameThe scene xml fil
simTypeeStatic: cannot move, but collide; eKinematic: can be moved, but no dynamics; eDynamic: full dynamic simulation

Definition at line 530 of file SimulatedWorld.cpp.

◆ addScene() [2/2]

virtual bool addScene ( VirtualRobot::ScenePtr  scene,
VirtualRobot::SceneObject::Physics::SimulationType  simType = VirtualRobot::SceneObject::Physics::eUnknown 
)
virtual

◆ applyForceObject()

virtual void applyForceObject ( const std::string &  objectName,
const Eigen::Vector3f &  force 
)
pure virtual

◆ applyForceRobotNode()

virtual void applyForceRobotNode ( const std::string &  robotName,
const std::string &  robotNodeName,
const Eigen::Vector3f &  force 
)
pure virtual

◆ applyTorqueObject()

virtual void applyTorqueObject ( const std::string &  objectName,
const Eigen::Vector3f &  torque 
)
pure virtual

◆ applyTorqueRobotNode()

virtual void applyTorqueRobotNode ( const std::string &  robotName,
const std::string &  robotNodeName,
const Eigen::Vector3f &  torque 
)
pure virtual

◆ copyContacts()

virtual std::vector<SimDynamics::DynamicsEngine::DynamicsContactInfo> copyContacts ( )
pure virtual

◆ copyReportData()

SimulatedWorldData copyReportData ( )
virtual

Definition at line 118 of file SimulatedWorld.cpp.

◆ copySceneVisuData()

SceneVisuData copySceneVisuData ( )
virtual

copySceneVisuData Creates a copy of the visualization data

Returns
The copy

Definition at line 938 of file SimulatedWorld.cpp.

◆ enableLogging()

void enableLogging ( const std::string &  robotName,
const std::string &  logFile 
)
virtual

Reimplemented in BulletPhysicsWorld, and KinematicsWorld.

Definition at line 804 of file SimulatedWorld.cpp.

◆ getContactCount()

int getContactCount ( )
virtual

Reimplemented in MujocoPhysicsWorld, and BulletPhysicsWorld.

Definition at line 958 of file SimulatedWorld.cpp.

◆ getCurrentSimTime()

double getCurrentSimTime ( )
virtual

Definition at line 80 of file SimulatedWorld.cpp.

◆ getDistance()

virtual armarx::DistanceInfo getDistance ( const std::string &  robotName,
const std::string &  robotNodeName,
const std::string &  worldObjectName 
)
pure virtual

◆ getFixedTimeStepMS()

virtual int getFixedTimeStepMS ( )
pure virtual
Returns
The number of steps * the timestep in MS

Implemented in BulletPhysicsWorld, KinematicsWorld, and MujocoPhysicsWorld.

◆ getFloor()

virtual VirtualRobot::SceneObjectPtr getFloor ( )
protectedpure virtual

◆ getObjectCount()

int getObjectCount ( )
virtual

Definition at line 965 of file SimulatedWorld.cpp.

◆ getObjectPose()

virtual Eigen::Matrix4f getObjectPose ( const std::string &  objectName)
pure virtual

◆ getObjects()

virtual std::vector<VirtualRobot::SceneObjectPtr> getObjects ( )
pure virtual

◆ getObstacleNames()

virtual std::vector<std::string> getObstacleNames ( )
pure virtual

◆ getReportData()

SimulatedWorldData & getReportData ( )
virtual

Definition at line 112 of file SimulatedWorld.cpp.

◆ getRobot()

virtual VirtualRobot::RobotPtr getRobot ( const std::string &  robotName)
pure virtual

◆ getRobotAngularVelocity()

virtual Eigen::Vector3f getRobotAngularVelocity ( const std::string &  robotName,
const std::string &  nodeName 
)
pure virtual

◆ getRobotForceTorqueSensors()

virtual ForceTorqueDataSeq getRobotForceTorqueSensors ( const std::string &  robotName)
pure virtual

◆ getRobotJointAngle()

virtual float getRobotJointAngle ( const std::string &  robotName,
const std::string &  nodeName 
)
pure virtual

◆ getRobotJointAngleCount()

int getRobotJointAngleCount ( )
virtual

Definition at line 945 of file SimulatedWorld.cpp.

◆ getRobotJointAngles()

virtual std::map< std::string, float> getRobotJointAngles ( const std::string &  robotName)
pure virtual

◆ getRobotJointLimitHi()

virtual float getRobotJointLimitHi ( const std::string &  robotName,
const std::string &  nodeName 
)
pure virtual

◆ getRobotJointLimitLo()

virtual float getRobotJointLimitLo ( const std::string &  robotName,
const std::string &  nodeName 
)
pure virtual

◆ getRobotJointTorques()

virtual std::map< std::string, float> getRobotJointTorques ( const std::string &  robotName)
pure virtual

◆ getRobotJointVelocities()

virtual std::map< std::string, float> getRobotJointVelocities ( const std::string &  robotName)
pure virtual

◆ getRobotJointVelocity()

virtual float getRobotJointVelocity ( const std::string &  robotName,
const std::string &  nodeName 
)
pure virtual

◆ getRobotLinearVelocity()

virtual Eigen::Vector3f getRobotLinearVelocity ( const std::string &  robotName,
const std::string &  nodeName 
)
pure virtual

◆ getRobotMass()

virtual float getRobotMass ( const std::string &  robotName)
pure virtual

◆ getRobotMaxTorque()

virtual float getRobotMaxTorque ( const std::string &  robotName,
const std::string &  nodeName 
)
pure virtual

◆ getRobotNames()

virtual std::vector<std::string> getRobotNames ( )
pure virtual

◆ getRobotNodeDistance()

virtual armarx::DistanceInfo getRobotNodeDistance ( const std::string &  robotName,
const std::string &  robotNodeName1,
const std::string &  robotNodeName2 
)
pure virtual

◆ getRobotNodePose()

virtual Eigen::Matrix4f getRobotNodePose ( const std::string &  robotName,
const std::string &  robotNodeName 
)
pure virtual

◆ getRobotPose()

virtual Eigen::Matrix4f getRobotPose ( const std::string &  robotName)
pure virtual

◆ getRobots()

virtual std::map<std::string, VirtualRobot::RobotPtr> getRobots ( )
pure virtual

◆ getRobotStatus()

virtual bool getRobotStatus ( const std::string &  robotName,
NameValueMap &  jointAngles,
NameValueMap &  jointVelocities,
NameValueMap &  jointTorques,
Eigen::Vector3f &  linearVelocity,
Eigen::Vector3f &  angularVelocity 
)
protectedpure virtual

◆ getScopedEngineLock()

auto getScopedEngineLock ( const std::string &  callStr)
virtual

Definition at line 714 of file SimulatedWorld.cpp.

◆ getScopedSyncLock()

auto getScopedSyncLock ( const std::string &  callStr)
virtual

Definition at line 747 of file SimulatedWorld.cpp.

+ Here is the caller graph for this function:

◆ getSimTime()

float getSimTime ( )
virtual

Definition at line 810 of file SimulatedWorld.cpp.

◆ getSimulationStepDuration()

float getSimulationStepDuration ( )
virtual

getSimulationStepDuration

Returns
The requested duration of the last simulation step (in ms)

Definition at line 792 of file SimulatedWorld.cpp.

◆ getSimulationStepTimeMeasured()

float getSimulationStepTimeMeasured ( )
virtual

getSimulationStepTimeMeasured

Returns
How long it took to simulate the last sim step.

Definition at line 798 of file SimulatedWorld.cpp.

◆ getSyncEngineTime()

float getSyncEngineTime ( )
virtual

Definition at line 816 of file SimulatedWorld.cpp.

◆ hasObject()

virtual bool hasObject ( const std::string &  instanceName)
pure virtual

◆ hasRobot()

virtual bool hasRobot ( const std::string &  robotName)
pure virtual

◆ hasRobotNode()

virtual bool hasRobotNode ( const std::string &  robotName,
const std::string &  robotNodeName 
)
pure virtual

◆ objectGrasped()

void objectGrasped ( const std::string &  robotName,
const std::string &  robotNodeName,
const std::string &  objectName 
)
virtual

create a joint

Definition at line 243 of file SimulatedWorld.cpp.

◆ objectGraspedEngine()

virtual bool objectGraspedEngine ( const std::string &  robotName,
const std::string &  robotNodeName,
const std::string &  objectName,
Eigen::Matrix4f &  storeLocalTransform 
)
protectedpure virtual

create a joint

Implemented in MujocoPhysicsWorld, BulletPhysicsWorld, and KinematicsWorld.

◆ objectReleased()

void objectReleased ( const std::string &  robotName,
const std::string &  robotNodeName,
const std::string &  objectName 
)
virtual

remove a joint

Definition at line 206 of file SimulatedWorld.cpp.

◆ objectReleasedEngine()

virtual bool objectReleasedEngine ( const std::string &  robotName,
const std::string &  robotNodeName,
const std::string &  objectName 
)
protectedpure virtual

remove a joint

Implemented in MujocoPhysicsWorld, BulletPhysicsWorld, and KinematicsWorld.

◆ removeObstacle()

bool removeObstacle ( const std::string &  name)
virtual

Definition at line 299 of file SimulatedWorld.cpp.

+ Here is the call graph for this function:

◆ removeObstacleEngine()

virtual bool removeObstacleEngine ( const std::string &  name)
protectedpure virtual

◆ removeObstacles()

bool removeObstacles ( )
virtual

Definition at line 280 of file SimulatedWorld.cpp.

◆ removeRobot()

bool removeRobot ( const std::string &  robotName)
virtual

Definition at line 464 of file SimulatedWorld.cpp.

◆ removeRobotEngine()

virtual bool removeRobotEngine ( const std::string &  robotName)
protectedpure virtual

◆ removeRobots()

bool removeRobots ( )
virtual

Definition at line 96 of file SimulatedWorld.cpp.

◆ resetData()

bool resetData ( )
virtual

resetData Clears all data

Definition at line 70 of file SimulatedWorld.cpp.

◆ resetSimTime()

void resetSimTime ( )
virtual

Definition at line 90 of file SimulatedWorld.cpp.

◆ setObjectPose()

virtual void setObjectPose ( const std::string &  objectName,
const Eigen::Matrix4f &  globalPose 
)
pure virtual

◆ setObjectSimType()

virtual void setObjectSimType ( const std::string &  objectName,
VirtualRobot::SceneObject::Physics::SimulationType  simType 
)
pure virtual

◆ setRobotAngularVelocity()

virtual void setRobotAngularVelocity ( const std::string &  robotName,
const std::string &  robotNodeName,
const Eigen::Vector3f &  vel 
)
pure virtual

◆ setRobotAngularVelocityRobotRootFrame()

virtual void setRobotAngularVelocityRobotRootFrame ( const std::string &  robotName,
const std::string &  robotNodeName,
const Eigen::Vector3f &  vel 
)
pure virtual

◆ setRobotLinearVelocity()

virtual void setRobotLinearVelocity ( const std::string &  robotName,
const std::string &  robotNodeName,
const Eigen::Vector3f &  vel 
)
pure virtual

◆ setRobotLinearVelocityRobotRootFrame()

virtual void setRobotLinearVelocityRobotRootFrame ( const std::string &  robotName,
const std::string &  robotNodeName,
const Eigen::Vector3f &  vel 
)
pure virtual

◆ setRobotMaxTorque()

virtual void setRobotMaxTorque ( const std::string &  robotName,
const std::string &  nodeName,
float  maxTorque 
)
pure virtual

◆ setRobotNodeSimType()

virtual void setRobotNodeSimType ( const std::string &  robotName,
const std::string &  robotNodeName,
VirtualRobot::SceneObject::Physics::SimulationType  simType 
)
pure virtual

◆ setRobotPose()

virtual void setRobotPose ( const std::string &  robotName,
const Eigen::Matrix4f &  globalPose 
)
pure virtual

◆ setupFloor()

void setupFloor ( bool  enable,
const std::string &  floorTexture 
)
virtual

Definition at line 780 of file SimulatedWorld.cpp.

+ Here is the caller graph for this function:

◆ setupFloorEngine()

virtual void setupFloorEngine ( bool  enable,
const std::string &  floorTexture 
)
protectedpure virtual

◆ stepPhysicsFixedTimeStep()

virtual void stepPhysicsFixedTimeStep ( )
pure virtual

Perform one simulation step.

This updates all models.

Implemented in BulletPhysicsWorld, KinematicsWorld, and MujocoPhysicsWorld.

◆ stepPhysicsRealTime()

virtual void stepPhysicsRealTime ( )
pure virtual

Perform one simulation step.

Calculates the delta update time from the time that has passed since the last call. This updates all models.

Implemented in BulletPhysicsWorld, KinematicsWorld, and MujocoPhysicsWorld.

◆ synchronizeObjects()

virtual bool synchronizeObjects ( )
protectedpure virtual

◆ synchronizeRobotNodePoses()

virtual bool synchronizeRobotNodePoses ( const std::string &  robotName,
std::map< std::string, armarx::PoseBasePtr > &  objMap 
)
protectedpure virtual

Implemented in BulletPhysicsWorld, and KinematicsWorld.

◆ synchronizeRobots()

bool synchronizeRobots ( )
protectedvirtual

Definition at line 822 of file SimulatedWorld.cpp.

◆ synchronizeSceneObjectPoses()

virtual bool synchronizeSceneObjectPoses ( VirtualRobot::SceneObjectPtr  currentObjEngine,
std::map< std::string, armarx::PoseBasePtr > &  objMap 
)
protectedpure virtual

Implemented in BulletPhysicsWorld, and KinematicsWorld.

◆ synchronizeSimulationData()

bool synchronizeSimulationData ( )
virtual

synchronizeSimulationData Update the sim data according to the internal physics models.

Returns
true on success.

Definition at line 880 of file SimulatedWorld.cpp.

+ Here is the call graph for this function:

◆ synchronizeSimulationDataEngine()

virtual bool synchronizeSimulationDataEngine ( )
protectedpure virtual

◆ toFramedPose()

virtual FramedPosePtr toFramedPose ( const Eigen::Matrix4f &  globalPose,
const std::string &  robotName,
const std::string &  frameName 
)
pure virtual

toFramedPose Constructs a framed pose

Parameters
globalPose
robotName
frameName
Returns

Implemented in MujocoPhysicsWorld, BulletPhysicsWorld, and KinematicsWorld.

◆ updateContacts()

void updateContacts ( bool  enable)
virtual

Definition at line 932 of file SimulatedWorld.cpp.

◆ updateForceTorqueSensor()

virtual bool updateForceTorqueSensor ( ForceTorqueInfo ftInfo)
protectedpure virtual

Member Data Documentation

◆ attachedObjects

std::vector<GraspingInfo> attachedObjects
protected

Definition at line 449 of file SimulatedWorld.h.

◆ collectContacts

bool collectContacts
protected

Definition at line 439 of file SimulatedWorld.h.

◆ currentSimTimeSec

double currentSimTimeSec = 0.0
protected

Definition at line 433 of file SimulatedWorld.h.

◆ currentSyncTimeSec

double currentSyncTimeSec = 0.0
protected

Definition at line 434 of file SimulatedWorld.h.

◆ engineMtxAccCalls

std::map< std::string, int > engineMtxAccCalls
protected

Definition at line 462 of file SimulatedWorld.h.

◆ engineMtxAccTime

std::map< std::string, float > engineMtxAccTime
protected

Definition at line 463 of file SimulatedWorld.h.

◆ engineMtxLastTime

std::map< std::string, IceUtil::Time > engineMtxLastTime
protected

Definition at line 464 of file SimulatedWorld.h.

◆ engineMutex

MutexPtrType engineMutex
protected

Definition at line 436 of file SimulatedWorld.h.

◆ maxRealTimeSimSpeed

float maxRealTimeSimSpeed = 1
protected

Definition at line 453 of file SimulatedWorld.h.

◆ simReportData

SimulatedWorldData simReportData
protected

Definition at line 452 of file SimulatedWorld.h.

◆ simStepExecutionDurationMS

float simStepExecutionDurationMS
protected

Definition at line 457 of file SimulatedWorld.h.

◆ simTimeStepMS

float simTimeStepMS
protected

Definition at line 454 of file SimulatedWorld.h.

◆ simVisuData

SceneVisuData simVisuData
protected

Definition at line 451 of file SimulatedWorld.h.

◆ synchronizeDurationMS

float synchronizeDurationMS
protected

Definition at line 459 of file SimulatedWorld.h.

◆ synchronizeMutex

MutexPtrType synchronizeMutex
protected

Definition at line 437 of file SimulatedWorld.h.

◆ syncMtxAccCalls

std::map< std::string, int > syncMtxAccCalls
protected

Definition at line 465 of file SimulatedWorld.h.

◆ syncMtxAccTime

std::map< std::string, float > syncMtxAccTime
protected

Definition at line 466 of file SimulatedWorld.h.

◆ syncMtxLastTime

std::map< std::string, IceUtil::Time > syncMtxLastTime
protected

Definition at line 467 of file SimulatedWorld.h.


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