|
The BulletPhysicsWorld class encapsulates the whole physics simulation and the corresponding data. More...
#include <ArmarXSimulation/components/Simulator/BulletPhysicsWorld.h>
Classes | |
struct | DynamicsRobotInfo |
Public Member Functions | |
void | activateObject (const std::string &objectName) override |
void | actuateRobotJoints (const std::string &robotName, const std::map< std::string, float > &angles, const std::map< std::string, float > &velocities) override |
void | actuateRobotJointsPos (const std::string &robotName, const std::map< std::string, float > &angles) override |
void | actuateRobotJointsTorque (const std::string &robotName, const std::map< std::string, float > &torques) override |
void | actuateRobotJointsVel (const std::string &robotName, const std::map< std::string, float > &velocities) override |
VirtualRobot::RobotPtr | adaptRobotToWorld (VirtualRobot::RobotPtr robot) override |
void | applyForceObject (const std::string &objectName, const Eigen::Vector3f &force) override |
void | applyForceRobotNode (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &force) override |
void | applyTorqueObject (const std::string &objectName, const Eigen::Vector3f &torque) override |
void | applyTorqueRobotNode (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &torque) override |
BulletPhysicsWorld () | |
std::vector< SimDynamics::DynamicsEngine::DynamicsContactInfo > | copyContacts () override |
void | enableLogging (const std::string &robotName, const std::string &logFile) override |
int | getContactCount () override |
armarx::DistanceInfo | getDistance (const std::string &robotName, const std::string &robotNodeName, const std::string &worldObjectName) override |
std::vector< SimDynamics::DynamicsObjectPtr > | getDynamicObjects () |
virtual SimDynamics::DynamicsRobotPtr | getDynamicRobot (const std::string &robotName) |
SimDynamics::DynamicsObjectPtr | getDynamicsObject (const std::string &objectName) |
SimDynamics::BulletEnginePtr | getEngine () |
int | getFixedTimeStepMS () override |
SimDynamics::DynamicsObjectPtr | getObject (const std::string &objectName) |
Eigen::Matrix4f | getObjectPose (const std::string &objectName) override |
std::vector< VirtualRobot::SceneObjectPtr > | getObjects () override |
std::vector< std::string > | getObstacleNames () override |
VirtualRobot::RobotPtr | getRobot (const std::string &robotName) override |
Eigen::Vector3f | getRobotAngularVelocity (const std::string &robotName, const std::string &nodeName) override |
ForceTorqueDataSeq | getRobotForceTorqueSensors (const std::string &robotName) override |
float | getRobotJointAngle (const std::string &robotName, const std::string &nodeName) override |
std::map< std::string, float > | getRobotJointAngles (const std::string &robotName) override |
float | getRobotJointLimitHi (const std::string &robotName, const std::string &nodeName) override |
float | getRobotJointLimitLo (const std::string &robotName, const std::string &nodeName) override |
std::map< std::string, float > | getRobotJointTorques (const std::string &robotName) override |
std::map< std::string, float > | getRobotJointVelocities (const std::string &robotName) override |
float | getRobotJointVelocity (const std::string &robotName, const std::string &nodeName) override |
Eigen::Vector3f | getRobotLinearVelocity (const std::string &robotName, const std::string &nodeName) override |
float | getRobotMass (const std::string &robotName) override |
float | getRobotMaxTorque (const std::string &robotName, const std::string &nodeName) override |
std::vector< std::string > | getRobotNames () override |
armarx::DistanceInfo | getRobotNodeDistance (const std::string &robotName, const std::string &robotNodeName1, const std::string &robotNodeName2) override |
Eigen::Matrix4f | getRobotNodePose (const std::string &robotName, const std::string &robotNodeName) override |
Eigen::Matrix4f | getRobotPose (const std::string &robotName) override |
std::map< std::string, VirtualRobot::RobotPtr > | getRobots () override |
bool | hasObject (const std::string &instanceName) override |
bool | hasRobot (const std::string &robotName) override |
bool | hasRobotNode (const std::string &robotName, const std::string &robotNodeName) override |
virtual void | initialize (int stepSizeMS, int bulletFixedTimeStepMS, int bulletFixedTimeStepMaxNrLoops, float maxRealTimeSimSpeed=1, bool floorPlane=false, std::string floorTexture=std::string()) |
void | setObjectPose (const std::string &objectName, const Eigen::Matrix4f &globalPose) override |
void | setObjectSimType (const std::string &objectName, VirtualRobot::SceneObject::Physics::SimulationType simType) override |
void | setRobotAngularVelocity (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel) override |
void | setRobotAngularVelocityRobotRootFrame (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel) override |
void | setRobotLinearVelocity (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel) override |
void | setRobotLinearVelocityRobotRootFrame (const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel) override |
void | setRobotMaxTorque (const std::string &robotName, const std::string &nodeName, float maxTorque) override |
void | setRobotNodeSimType (const std::string &robotName, const std::string &robotNodeName, VirtualRobot::SceneObject::Physics::SimulationType simType) override |
void | setRobotPose (const std::string &robotName, const Eigen::Matrix4f &globalPose) override |
void | stepPhysicsFixedTimeStep () override |
Perform one simulation step. More... | |
void | stepPhysicsRealTime () override |
Perform one simulation step. More... | |
FramedPosePtr | toFramedPose (const Eigen::Matrix4f &globalPose, const std::string &robotName, const std::string &frameName) override |
toFramedPose Constructs a framed pose More... | |
~BulletPhysicsWorld () override | |
Public Member Functions inherited from SimulatedWorld | |
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 SimulatedWorldData | copyReportData () |
virtual SceneVisuData | copySceneVisuData () |
copySceneVisuData Creates a copy of the visualization data More... | |
virtual double | getCurrentSimTime () |
virtual int | getObjectCount () |
virtual SimulatedWorldData & | getReportData () |
virtual int | getRobotJointAngleCount () |
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 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 | setupFloor (bool enable, const std::string &floorTexture) |
SimulatedWorld () | |
virtual bool | synchronizeSimulationData () |
synchronizeSimulationData Update the sim data according to the internal physics models. 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 | |
bool | addObstacleEngine (VirtualRobot::SceneObjectPtr o, VirtualRobot::SceneObject::Physics::SimulationType simType) override |
bool | addRobotEngine (VirtualRobot::RobotPtr robot, double pid_p, double pid_i, double pid_d, const std::string &filename, bool staticRobot, bool selfCollisions) override |
btScalar | getDeltaTimeMicroseconds () |
SimDynamics::DynamicsObjectPtr | getFirstDynamicsObject (const std::string &robotName, const std::string &nodeName) |
VirtualRobot::SceneObjectPtr | getFloor () override |
bool | getRobotStatus (const std::string &robotName, NameValueMap &jointAngles, NameValueMap &jointVelocities, NameValueMap &jointTorques, Eigen::Vector3f &linearVelocity, Eigen::Vector3f &angularVelocity) override |
bool | objectGraspedEngine (const std::string &robotName, const std::string &robotNodeName, const std::string &objectName, Eigen::Matrix4f &storeLocalTransform) override |
create a joint More... | |
bool | objectReleasedEngine (const std::string &robotName, const std::string &robotNodeName, const std::string &objectName) override |
remove a joint More... | |
bool | removeObstacleEngine (const std::string &name) override |
bool | removeRobotEngine (const std::string &robotName) override |
void | setupFloorEngine (bool enable, const std::string &floorTexture) override |
void | stepStaticRobots (double deltaInSeconds) |
bool | synchronizeObjects () override |
bool | synchronizeRobotNodePoses (const std::string &robotName, std::map< std::string, armarx::PoseBasePtr > &objMap) override |
bool | synchronizeSceneObjectPoses (VirtualRobot::SceneObjectPtr currentObjEngine, std::map< std::string, armarx::PoseBasePtr > &objMap) override |
bool | synchronizeSimulationDataEngine () override |
bool | updateForceTorqueSensor (ForceTorqueInfo &ftInfo) override |
Protected Member Functions inherited from SimulatedWorld | |
virtual bool | synchronizeRobots () |
Protected Member Functions inherited from Logging | |
bool | checkLogLevel (MessageTypeT level) const |
const LogSenderPtr & | getLogSender () const |
Retrieve log sender. More... | |
LogSenderPtr | loghelper (const char *file, int line, const char *function) const |
Protected Attributes | |
SimDynamics::BulletEnginePtr | bulletEngine |
int | bulletFixedTimeStepMaxNrLoops |
int | bulletFixedTimeStepMS |
std::vector< SimDynamics::DynamicsEngine::DynamicsContactInfo > | contacts |
std::map< std::string, DynamicsRobotInfo > | dynamicRobots |
std::vector< SimDynamics::DynamicsObjectPtr > | dynamicsObjects |
SimDynamics::DynamicsWorldPtr | dynamicsWorld |
btClock | m_clock |
SimDynamics::BulletRobotLoggerPtr | robotLogger |
int | stepSizeMs |
Protected Attributes inherited from SimulatedWorld | |
std::vector< GraspingInfo > | attachedObjects |
bool | collectContacts |
double | currentSimTimeSec = 0.0 |
double | currentSyncTimeSec = 0.0 |
std::map< std::string, int > | engineMtxAccCalls |
std::map< std::string, float > | engineMtxAccTime |
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, float > | syncMtxAccTime |
std::map< std::string, IceUtil::Time > | syncMtxLastTime |
Protected Attributes inherited from Logging | |
MessageTypeT | minimumLoggingLevel |
SpamFilterDataPtr | spamFilter |
LogTag | tag |
Additional Inherited Members | |
Public Types inherited from SimulatedWorld | |
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) |
The BulletPhysicsWorld class encapsulates the whole physics simulation and the corresponding data.
Definition at line 54 of file BulletPhysicsWorld.h.
Definition at line 45 of file BulletPhysicsWorld.cpp.
|
override |
Definition at line 52 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Reimplemented from SimulatedWorld.
Definition at line 484 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 93 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 168 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 292 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 240 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Reimplemented from SimulatedWorld.
Definition at line 2128 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1678 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1381 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 418 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 355 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 432 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 386 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1672 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Reimplemented from SimulatedWorld.
Definition at line 1958 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Reimplemented from SimulatedWorld.
Definition at line 2051 of file BulletPhysicsWorld.cpp.
|
protected |
Definition at line 2042 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 2093 of file BulletPhysicsWorld.cpp.
std::vector< SimDynamics::DynamicsObjectPtr > getDynamicObjects | ( | ) |
Definition at line 1934 of file BulletPhysicsWorld.cpp.
|
virtual |
Definition at line 1214 of file BulletPhysicsWorld.cpp.
SimDynamics::DynamicsObjectPtr getDynamicsObject | ( | const std::string & | objectName | ) |
SimDynamics::BulletEnginePtr getEngine | ( | ) |
Definition at line 1918 of file BulletPhysicsWorld.cpp.
|
protected |
Definition at line 941 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1912 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1341 of file BulletPhysicsWorld.cpp.
SimDynamics::DynamicsObjectPtr getObject | ( | const std::string & | objectName | ) |
Definition at line 447 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1243 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1924 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1760 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1190 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 993 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 696 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 560 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 525 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 769 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 741 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 655 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 590 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 625 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 926 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 503 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 826 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1715 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 2057 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 896 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 797 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1202 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1526 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 465 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1158 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1176 of file BulletPhysicsWorld.cpp.
|
virtual |
|
overrideprotectedvirtual |
create a joint
Implements SimulatedWorld.
Definition at line 1295 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
remove a joint
Implements SimulatedWorld.
Definition at line 1258 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1775 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1352 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 470 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1730 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1038 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1112 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1008 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1068 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 861 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 1742 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Implements SimulatedWorld.
Definition at line 331 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1939 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Perform one simulation step.
This updates all models.
*bulletFixedTimeStepMaxNrLoops **/ stepSize * 1000.0f;
(float)bulletFixedTimeStepMaxNrLoops
Implements SimulatedWorld.
Definition at line 1834 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
Perform one simulation step.
Calculates the delta update time from the time that has passed since the last call. This updates all models.
Implements SimulatedWorld.
Definition at line 1806 of file BulletPhysicsWorld.cpp.
|
protected |
Definition at line 1877 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1640 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1501 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 2000 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 2023 of file BulletPhysicsWorld.cpp.
|
overridevirtual |
toFramedPose Constructs a framed pose
globalPose | |
robotName | |
frameName |
Implements SimulatedWorld.
Definition at line 1475 of file BulletPhysicsWorld.cpp.
|
overrideprotectedvirtual |
Implements SimulatedWorld.
Definition at line 1588 of file BulletPhysicsWorld.cpp.
|
protected |
Definition at line 198 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 199 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 200 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 203 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 216 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 217 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 215 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 205 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 219 of file BulletPhysicsWorld.h.
|
protected |
Definition at line 201 of file BulletPhysicsWorld.h.