BulletPhysicsWorld.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2013-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package ArmarXSimulation::Simulator
19  * @author Nikolaus Vahrenkamp ( vahrenkamp at kit dot edu )
20  * @date 2014
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <SimDynamics/DynamicsEngine/DynamicsEngine.h>
28 #include <SimDynamics/DynamicsWorld.h>
29 #include <SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.h>
30 #include <SimDynamics/DynamicsEngine/DynamicsRobot.h>
31 #include <SimDynamics/DynamicsEngine/DynamicsObject.h>
32 #include <SimDynamics/DynamicsEngine/BulletEngine/BulletRobotLogger.h>
33 
34 #include <btBulletDynamicsCommon.h>
35 #include <LinearMath/btQuickprof.h>
36 
37 #include <Eigen/Core>
38 #include <Eigen/Geometry>
39 
40 // just needed for SceneData
41 #include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
42 // #include <ArmarXCore/core/system/Synchronization.h>
45 
46 #include "SimulatedWorld.h"
47 
48 namespace armarx
49 {
50  /*!
51  * \brief The BulletPhysicsWorld class encapsulates the whole physics simulation and the corresponding data
52  *
53  */
55  {
56  public:
57 
59  ~BulletPhysicsWorld() override;
60 
61 
62  virtual void initialize(int stepSizeMS, int bulletFixedTimeStepMS, int bulletFixedTimeStepMaxNrLoops, float maxRealTimeSimSpeed = 1, bool floorPlane = false, std::string floorTexture = std::string());
63 
65 
66  void actuateRobotJoints(const std::string& robotName, const std::map< std::string, float>& angles, const std::map< std::string, float>& velocities) override;
67  void actuateRobotJointsPos(const std::string& robotName, const std::map< std::string, float>& angles) override;
68  void actuateRobotJointsVel(const std::string& robotName, const std::map< std::string, float>& velocities) override;
69  void actuateRobotJointsTorque(const std::string& robotName, const std::map< std::string, float>& torques) override;
70  void setRobotPose(const std::string& robotName, const Eigen::Matrix4f& globalPose) override;
71 
72  void applyForceRobotNode(const std::string& robotName, const std::string& robotNodeName, const Eigen::Vector3f& force) override;
73  void applyTorqueRobotNode(const std::string& robotName, const std::string& robotNodeName, const Eigen::Vector3f& torque) override;
74 
75  void applyForceObject(const std::string& objectName, const Eigen::Vector3f& force) override;
76  void applyTorqueObject(const std::string& objectName, const Eigen::Vector3f& torque) override;
77 
78  bool hasObject(const std::string& instanceName) override;
79  void setObjectPose(const std::string& objectName, const Eigen::Matrix4f& globalPose) override;
80  void activateObject(const std::string& objectName) override;
81 
82  bool hasRobot(const std::string& robotName) override;
83  bool hasRobotNode(const std::string& robotName, const std::string& robotNodeName) override;
84  float getRobotMass(const std::string& robotName) override;
85 
86  std::map< std::string, float> getRobotJointAngles(const std::string& robotName) override;
87  float getRobotJointAngle(const std::string& robotName, const std::string& nodeName) override;
88  std::map< std::string, float> getRobotJointVelocities(const std::string& robotName) override;
89  float getRobotJointVelocity(const std::string& robotName, const std::string& nodeName) override;
90  std::map< std::string, float> getRobotJointTorques(const std::string& robotName) override;
91  ForceTorqueDataSeq getRobotForceTorqueSensors(const std::string& robotName) override;
92 
93  float getRobotJointLimitLo(const std::string& robotName, const std::string& nodeName) override;
94  float getRobotJointLimitHi(const std::string& robotName, const std::string& nodeName) override;
95  Eigen::Matrix4f getRobotPose(const std::string& robotName) override;
96 
97  float getRobotMaxTorque(const std::string& robotName, const std::string& nodeName) override;
98  void setRobotMaxTorque(const std::string& robotName, const std::string& nodeName, float maxTorque) override;
99 
100  Eigen::Matrix4f getRobotNodePose(const std::string& robotName, const std::string& robotNodeName) override;
101 
102  Eigen::Vector3f getRobotLinearVelocity(const std::string& robotName, const std::string& nodeName) override;
103  Eigen::Vector3f getRobotAngularVelocity(const std::string& robotName, const std::string& nodeName) override;
104 
105  void setRobotLinearVelocity(const std::string& robotName, const std::string& robotNodeName, const Eigen::Vector3f& vel) override;
106  void setRobotAngularVelocity(const std::string& robotName, const std::string& robotNodeName, const Eigen::Vector3f& vel) override;
107  void setRobotLinearVelocityRobotRootFrame(const std::string& robotName, const std::string& robotNodeName, const Eigen::Vector3f& vel) override;
108  void setRobotAngularVelocityRobotRootFrame(const std::string& robotName, const std::string& robotNodeName, const Eigen::Vector3f& vel) override;
109 
110  Eigen::Matrix4f getObjectPose(const std::string& objectName) override;
111 
112 
113  FramedPosePtr toFramedPose(const Eigen::Matrix4f& globalPose, const std::string& robotName, const std::string& frameName) override;
114 
115  /**
116  * Perform one simulation step. Calculates the delta update time from the time that has passed since the last call.
117  * This updates all models.
118  */
119  void stepPhysicsRealTime() override;
120 
121  /**
122  * Perform one simulation step.
123  * This updates all models.
124  */
125  void stepPhysicsFixedTimeStep() override;
126 
127  /*!
128  * \brief
129  * \return The number of steps * the timestep in MS
130  */
131  int getFixedTimeStepMS() override;
132 
133  SimDynamics::BulletEnginePtr getEngine();
134 
135  std::vector<VirtualRobot::SceneObjectPtr> getObjects() override;
136 
137  std::vector<SimDynamics::DynamicsObjectPtr> getDynamicObjects();
138  SimDynamics::DynamicsObjectPtr getObject(const std::string& objectName);
139 
140 
141  SimDynamics::DynamicsObjectPtr getDynamicsObject(const std::string& objectName);
142 
143  void enableLogging(const std::string& robotName, const std::string& logFile) override;
144 
145  armarx::DistanceInfo getRobotNodeDistance(const std::string& robotName, const std::string& robotNodeName1, const std::string& robotNodeName2) override;
146  armarx::DistanceInfo getDistance(const std::string& robotName, const std::string& robotNodeName, const std::string& worldObjectName) override;
147 
148  std::vector<SimDynamics::DynamicsEngine::DynamicsContactInfo> copyContacts() override;
149 
150 
151  int getContactCount() override;
152 
153  VirtualRobot::RobotPtr getRobot(const std::string& robotName) override;
154  std::map<std::string, VirtualRobot::RobotPtr> getRobots() override;
155  virtual SimDynamics::DynamicsRobotPtr getDynamicRobot(const std::string& robotName);
156 
157  std::vector<std::string> getRobotNames() override;
158  std::vector<std::string> getObstacleNames() override;
159 
160  void setRobotNodeSimType(const std::string& robotName, const std::string& robotNodeName, VirtualRobot::SceneObject::Physics::SimulationType simType) override;
161  void setObjectSimType(const std::string& objectName, VirtualRobot::SceneObject::Physics::SimulationType simType) override;
162 
163  protected:
164  bool addObstacleEngine(VirtualRobot::SceneObjectPtr o, VirtualRobot::SceneObject::Physics::SimulationType simType) override;
165  bool removeObstacleEngine(const std::string& name) override;
166  bool addRobotEngine(VirtualRobot::RobotPtr robot, double pid_p, double pid_i, double pid_d, const std::string& filename, bool staticRobot, bool selfCollisions) override;
167 
168  //! create a joint
169  bool objectGraspedEngine(const std::string& robotName, const std::string& robotNodeName, const std::string& objectName, Eigen::Matrix4f& storeLocalTransform) override;
170 
171  //! remove a joint
172  bool objectReleasedEngine(const std::string& robotName, const std::string& robotNodeName, const std::string& objectName) override;
173 
174  bool removeRobotEngine(const std::string& robotName) override;
175  bool synchronizeSimulationDataEngine() override;
176 
177  void setupFloorEngine(bool enable, const std::string& floorTexture) override;
178 
179  bool synchronizeObjects() override;
180 
181  bool getRobotStatus(const std::string& robotName,
185  Eigen::Vector3f& linearVelocity,
186  Eigen::Vector3f& angularVelocity) override;
187 
188  bool updateForceTorqueSensor(ForceTorqueInfo& ftInfo) override;
189 
190  bool synchronizeSceneObjectPoses(VirtualRobot::SceneObjectPtr currentObjEngine, std::map< std::string, armarx::PoseBasePtr >& objMap) override;
191 
193 
194  // manually apply velocities to static robots
195  void stepStaticRobots(double deltaInSeconds);
196 
197  // we assume to have a bullet engine
198  SimDynamics::BulletEnginePtr bulletEngine;
202 
203  std::vector<SimDynamics::DynamicsEngine::DynamicsContactInfo> contacts;
204 
205  btClock m_clock;
206 
208  {
210  SimDynamics::DynamicsRobotPtr dynamicsRobot;
211  bool isStatic;
212  std::map<std::string, float> targetVelocities; // only needed for static roobts
213  };
214 
215  SimDynamics::DynamicsWorldPtr dynamicsWorld;
216  std::map<std::string, DynamicsRobotInfo> dynamicRobots;
217  std::vector<SimDynamics::DynamicsObjectPtr> dynamicsObjects;
218 
219  SimDynamics::BulletRobotLoggerPtr robotLogger;
220 
221  btScalar getDeltaTimeMicroseconds();
222 
223  SimDynamics::DynamicsObjectPtr getFirstDynamicsObject(const std::string& robotName, const std::string& nodeName);
224 
225  bool synchronizeRobotNodePoses(const std::string& robotName, std::map<std::string, armarx::PoseBasePtr>& objMap) override;
226  };
227 
228  using BulletPhysicsWorldPtr = std::shared_ptr<BulletPhysicsWorld>;
229 }
230 
231 
armarx::BulletPhysicsWorld::applyTorqueObject
void applyTorqueObject(const std::string &objectName, const Eigen::Vector3f &torque) override
Definition: BulletPhysicsWorld.cpp:432
armarx::BulletPhysicsWorld::setObjectPose
void setObjectPose(const std::string &objectName, const Eigen::Matrix4f &globalPose) override
Definition: BulletPhysicsWorld.cpp:470
armarx::BulletPhysicsWorld::stepSizeMs
int stepSizeMs
Definition: BulletPhysicsWorld.h:201
armarx::BulletPhysicsWorld::synchronizeSceneObjectPoses
bool synchronizeSceneObjectPoses(VirtualRobot::SceneObjectPtr currentObjEngine, std::map< std::string, armarx::PoseBasePtr > &objMap) override
Definition: BulletPhysicsWorld.cpp:2000
armarx::BulletPhysicsWorld::~BulletPhysicsWorld
~BulletPhysicsWorld() override
Definition: BulletPhysicsWorld.cpp:52
armarx::BulletPhysicsWorld::actuateRobotJoints
void actuateRobotJoints(const std::string &robotName, const std::map< std::string, float > &angles, const std::map< std::string, float > &velocities) override
Definition: BulletPhysicsWorld.cpp:93
armarx::BulletPhysicsWorldPtr
std::shared_ptr< BulletPhysicsWorld > BulletPhysicsWorldPtr
Definition: BulletPhysicsWorld.h:228
armarx::BulletPhysicsWorld::addRobotEngine
bool addRobotEngine(VirtualRobot::RobotPtr robot, double pid_p, double pid_i, double pid_d, const std::string &filename, bool staticRobot, bool selfCollisions) override
Definition: BulletPhysicsWorld.cpp:1381
armarx::BulletPhysicsWorld::getDistance
armarx::DistanceInfo getDistance(const std::string &robotName, const std::string &robotNodeName, const std::string &worldObjectName) override
Definition: BulletPhysicsWorld.cpp:2093
armarx::BulletPhysicsWorld::getEngine
SimDynamics::BulletEnginePtr getEngine()
Definition: BulletPhysicsWorld.cpp:1918
armarx::BulletPhysicsWorld::getRobotLinearVelocity
Eigen::Vector3f getRobotLinearVelocity(const std::string &robotName, const std::string &nodeName) override
Definition: BulletPhysicsWorld.cpp:926
armarx::BulletPhysicsWorld::getRobotJointLimitLo
float getRobotJointLimitLo(const std::string &robotName, const std::string &nodeName) override
Definition: BulletPhysicsWorld.cpp:741
armarx::BulletPhysicsWorld::objectGraspedEngine
bool objectGraspedEngine(const std::string &robotName, const std::string &robotNodeName, const std::string &objectName, Eigen::Matrix4f &storeLocalTransform) override
create a joint
Definition: BulletPhysicsWorld.cpp:1295
armarx::BulletPhysicsWorld::DynamicsRobotInfo::robot
VirtualRobot::RobotPtr robot
Definition: BulletPhysicsWorld.h:209
armarx::BulletPhysicsWorld::synchronizeSimulationDataEngine
bool synchronizeSimulationDataEngine() override
Definition: BulletPhysicsWorld.cpp:2023
armarx::BulletPhysicsWorld::setRobotAngularVelocity
void setRobotAngularVelocity(const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel) override
Definition: BulletPhysicsWorld.cpp:1038
armarx::BulletPhysicsWorld::getFixedTimeStepMS
int getFixedTimeStepMS() override
Definition: BulletPhysicsWorld.cpp:1912
armarx::BulletPhysicsWorld::dynamicsWorld
SimDynamics::DynamicsWorldPtr dynamicsWorld
Definition: BulletPhysicsWorld.h:215
armarx::BulletPhysicsWorld::getRobotForceTorqueSensors
ForceTorqueDataSeq getRobotForceTorqueSensors(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:696
armarx::BulletPhysicsWorld::removeObstacleEngine
bool removeObstacleEngine(const std::string &name) override
Definition: BulletPhysicsWorld.cpp:1775
Pose.h
armarx::BulletPhysicsWorld::getObjects
std::vector< VirtualRobot::SceneObjectPtr > getObjects() override
Definition: BulletPhysicsWorld.cpp:1924
armarx::BulletPhysicsWorld::stepPhysicsRealTime
void stepPhysicsRealTime() override
Perform one simulation step.
Definition: BulletPhysicsWorld.cpp:1806
armarx::BulletPhysicsWorld::getRobotStatus
bool getRobotStatus(const std::string &robotName, NameValueMap &jointAngles, NameValueMap &jointVelocities, NameValueMap &jointTorques, Eigen::Vector3f &linearVelocity, Eigen::Vector3f &angularVelocity) override
Definition: BulletPhysicsWorld.cpp:1526
armarx::SimulatedWorld::maxRealTimeSimSpeed
float maxRealTimeSimSpeed
Definition: SimulatedWorld.h:453
armarx::ForceTorqueInfo
Definition: SimulatedWorld.h:48
armarx::BulletPhysicsWorld::getRobotAngularVelocity
Eigen::Vector3f getRobotAngularVelocity(const std::string &robotName, const std::string &nodeName) override
Definition: BulletPhysicsWorld.cpp:993
armarx::SimulatedWorld
The SimulatedWorld class encapsulates the whole physics simulation and the corresponding data.
Definition: SimulatedWorld.h:128
armarx::BulletPhysicsWorld::setRobotMaxTorque
void setRobotMaxTorque(const std::string &robotName, const std::string &nodeName, float maxTorque) override
Definition: BulletPhysicsWorld.cpp:861
armarx::BulletPhysicsWorld::getRobotJointLimitHi
float getRobotJointLimitHi(const std::string &robotName, const std::string &nodeName) override
Definition: BulletPhysicsWorld.cpp:769
armarx::BulletPhysicsWorld::stepStaticRobots
void stepStaticRobots(double deltaInSeconds)
Definition: BulletPhysicsWorld.cpp:1877
armarx::BulletPhysicsWorld::applyTorqueRobotNode
void applyTorqueRobotNode(const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &torque) override
Definition: BulletPhysicsWorld.cpp:386
armarx::BulletPhysicsWorld::stepPhysicsFixedTimeStep
void stepPhysicsFixedTimeStep() override
Perform one simulation step.
Definition: BulletPhysicsWorld.cpp:1834
armarx::BulletPhysicsWorld::getRobotNames
std::vector< std::string > getRobotNames() override
Definition: BulletPhysicsWorld.cpp:1715
armarx::BulletPhysicsWorld::getDynamicObjects
std::vector< SimDynamics::DynamicsObjectPtr > getDynamicObjects()
Definition: BulletPhysicsWorld.cpp:1934
armarx::BulletPhysicsWorld::getFirstDynamicsObject
SimDynamics::DynamicsObjectPtr getFirstDynamicsObject(const std::string &robotName, const std::string &nodeName)
Definition: BulletPhysicsWorld.cpp:941
armarx::BulletPhysicsWorld::setupFloorEngine
void setupFloorEngine(bool enable, const std::string &floorTexture) override
Definition: BulletPhysicsWorld.cpp:1939
IceInternal::Handle< FramedPose >
armarx::BulletPhysicsWorld::getRobotMaxTorque
float getRobotMaxTorque(const std::string &robotName, const std::string &nodeName) override
Definition: BulletPhysicsWorld.cpp:826
armarx::BulletPhysicsWorld::setRobotLinearVelocityRobotRootFrame
void setRobotLinearVelocityRobotRootFrame(const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel) override
Definition: BulletPhysicsWorld.cpp:1068
armarx::BulletPhysicsWorld::DynamicsRobotInfo
Definition: BulletPhysicsWorld.h:207
armarx::BulletPhysicsWorld::updateForceTorqueSensor
bool updateForceTorqueSensor(ForceTorqueInfo &ftInfo) override
Definition: BulletPhysicsWorld.cpp:1588
armarx::BulletPhysicsWorld::activateObject
void activateObject(const std::string &objectName) override
Definition: BulletPhysicsWorld.cpp:484
armarx::BulletPhysicsWorld::synchronizeObjects
bool synchronizeObjects() override
Definition: BulletPhysicsWorld.cpp:1640
armarx::BulletPhysicsWorld::synchronizeRobotNodePoses
bool synchronizeRobotNodePoses(const std::string &robotName, std::map< std::string, armarx::PoseBasePtr > &objMap) override
Definition: BulletPhysicsWorld.cpp:1501
armarx::BulletPhysicsWorld::setRobotAngularVelocityRobotRootFrame
void setRobotAngularVelocityRobotRootFrame(const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel) override
Definition: BulletPhysicsWorld.cpp:1112
armarx::BulletPhysicsWorld::actuateRobotJointsVel
void actuateRobotJointsVel(const std::string &robotName, const std::map< std::string, float > &velocities) override
Definition: BulletPhysicsWorld.cpp:240
FramedPose.h
armarx::BulletPhysicsWorld::getObjectPose
Eigen::Matrix4f getObjectPose(const std::string &objectName) override
Definition: BulletPhysicsWorld.cpp:1243
armarx::BulletPhysicsWorld::getDeltaTimeMicroseconds
btScalar getDeltaTimeMicroseconds()
Definition: BulletPhysicsWorld.cpp:2042
armarx::BulletPhysicsWorld::getObject
SimDynamics::DynamicsObjectPtr getObject(const std::string &objectName)
Definition: BulletPhysicsWorld.cpp:447
armarx::BulletPhysicsWorld::hasRobot
bool hasRobot(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:1158
armarx::BulletPhysicsWorld::removeRobotEngine
bool removeRobotEngine(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:1352
armarx::BulletPhysicsWorld::getRobot
VirtualRobot::RobotPtr getRobot(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:1190
armarx::BulletPhysicsWorld::enableLogging
void enableLogging(const std::string &robotName, const std::string &logFile) override
Definition: BulletPhysicsWorld.cpp:1958
armarx::BulletPhysicsWorld::getRobotJointVelocities
std::map< std::string, float > getRobotJointVelocities(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:590
filename
std::string filename
Definition: VisualizationRobot.cpp:83
armarx::BulletPhysicsWorld::DynamicsRobotInfo::targetVelocities
std::map< std::string, float > targetVelocities
Definition: BulletPhysicsWorld.h:212
armarx::BulletPhysicsWorld::adaptRobotToWorld
VirtualRobot::RobotPtr adaptRobotToWorld(VirtualRobot::RobotPtr robot) override
Definition: BulletPhysicsWorld.cpp:2128
armarx::channels::KinematicUnitObserver::jointVelocities
const KinematicUnitDatafieldCreator jointVelocities("jointVelocities")
armarx::BulletPhysicsWorld::getContactCount
int getContactCount() override
Definition: BulletPhysicsWorld.cpp:2051
armarx::BulletPhysicsWorld::getRobotJointVelocity
float getRobotJointVelocity(const std::string &robotName, const std::string &nodeName) override
Definition: BulletPhysicsWorld.cpp:625
armarx::BulletPhysicsWorld::hasObject
bool hasObject(const std::string &instanceName) override
Definition: BulletPhysicsWorld.cpp:465
armarx::BulletPhysicsWorld::bulletFixedTimeStepMS
int bulletFixedTimeStepMS
Definition: BulletPhysicsWorld.h:200
armarx::BulletPhysicsWorld::dynamicsObjects
std::vector< SimDynamics::DynamicsObjectPtr > dynamicsObjects
Definition: BulletPhysicsWorld.h:217
armarx::BulletPhysicsWorld::robotLogger
SimDynamics::BulletRobotLoggerPtr robotLogger
Definition: BulletPhysicsWorld.h:219
armarx::BulletPhysicsWorld::getRobotPose
Eigen::Matrix4f getRobotPose(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:797
armarx::BulletPhysicsWorld::m_clock
btClock m_clock
Definition: BulletPhysicsWorld.h:205
armarx::BulletPhysicsWorld::getRobotJointAngle
float getRobotJointAngle(const std::string &robotName, const std::string &nodeName) override
Definition: BulletPhysicsWorld.cpp:560
armarx::BulletPhysicsWorld::setRobotPose
void setRobotPose(const std::string &robotName, const Eigen::Matrix4f &globalPose) override
Definition: BulletPhysicsWorld.cpp:331
armarx::BulletPhysicsWorld::actuateRobotJointsPos
void actuateRobotJointsPos(const std::string &robotName, const std::map< std::string, float > &angles) override
Definition: BulletPhysicsWorld.cpp:168
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:91
armarx::channels::KinematicUnitObserver::jointAngles
const KinematicUnitDatafieldCreator jointAngles("jointAngles")
armarx::BulletPhysicsWorld::toFramedPose
FramedPosePtr toFramedPose(const Eigen::Matrix4f &globalPose, const std::string &robotName, const std::string &frameName) override
toFramedPose Constructs a framed pose
Definition: BulletPhysicsWorld.cpp:1475
armarx::BulletPhysicsWorld::getRobotJointTorques
std::map< std::string, float > getRobotJointTorques(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:655
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::BulletPhysicsWorld::copyContacts
std::vector< SimDynamics::DynamicsEngine::DynamicsContactInfo > copyContacts() override
Definition: BulletPhysicsWorld.cpp:1672
armarx::BulletPhysicsWorld::bulletEngine
SimDynamics::BulletEnginePtr bulletEngine
Definition: BulletPhysicsWorld.h:198
armarx::BulletPhysicsWorld::actuateRobotJointsTorque
void actuateRobotJointsTorque(const std::string &robotName, const std::map< std::string, float > &torques) override
Definition: BulletPhysicsWorld.cpp:292
armarx::BulletPhysicsWorld::applyForceRobotNode
void applyForceRobotNode(const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &force) override
Definition: BulletPhysicsWorld.cpp:355
armarx::BulletPhysicsWorld::setObjectSimType
void setObjectSimType(const std::string &objectName, VirtualRobot::SceneObject::Physics::SimulationType simType) override
Definition: BulletPhysicsWorld.cpp:1730
armarx::BulletPhysicsWorld::DynamicsRobotInfo::isStatic
bool isStatic
Definition: BulletPhysicsWorld.h:211
armarx::BulletPhysicsWorld::setRobotNodeSimType
void setRobotNodeSimType(const std::string &robotName, const std::string &robotNodeName, VirtualRobot::SceneObject::Physics::SimulationType simType) override
Definition: BulletPhysicsWorld.cpp:1742
armarx::BulletPhysicsWorld
The BulletPhysicsWorld class encapsulates the whole physics simulation and the corresponding data.
Definition: BulletPhysicsWorld.h:54
armarx::BulletPhysicsWorld::getObstacleNames
std::vector< std::string > getObstacleNames() override
Definition: BulletPhysicsWorld.cpp:1760
armarx::BulletPhysicsWorld::addObstacleEngine
bool addObstacleEngine(VirtualRobot::SceneObjectPtr o, VirtualRobot::SceneObject::Physics::SimulationType simType) override
Definition: BulletPhysicsWorld.cpp:1678
armarx::BulletPhysicsWorld::BulletPhysicsWorld
BulletPhysicsWorld()
Definition: BulletPhysicsWorld.cpp:45
scene3D::SceneObjectPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr
Definition: PointerDefinitions.h:40
armarx::BulletPhysicsWorld::initialize
virtual void initialize(int stepSizeMS, int bulletFixedTimeStepMS, int bulletFixedTimeStepMaxNrLoops, float maxRealTimeSimSpeed=1, bool floorPlane=false, std::string floorTexture=std::string())
Definition: BulletPhysicsWorld.cpp:58
SimulatedWorld.h
armarx::BulletPhysicsWorld::getRobots
std::map< std::string, VirtualRobot::RobotPtr > getRobots() override
Definition: BulletPhysicsWorld.cpp:1202
armarx::BulletPhysicsWorld::getRobotNodePose
Eigen::Matrix4f getRobotNodePose(const std::string &robotName, const std::string &robotNodeName) override
Definition: BulletPhysicsWorld.cpp:896
armarx::BulletPhysicsWorld::getFloor
VirtualRobot::SceneObjectPtr getFloor() override
Definition: BulletPhysicsWorld.cpp:1341
armarx::BulletPhysicsWorld::objectReleasedEngine
bool objectReleasedEngine(const std::string &robotName, const std::string &robotNodeName, const std::string &objectName) override
remove a joint
Definition: BulletPhysicsWorld.cpp:1258
armarx::channels::KinematicUnitObserver::jointTorques
const KinematicUnitDatafieldCreator jointTorques("jointTorques")
armarx::BulletPhysicsWorld::DynamicsRobotInfo::dynamicsRobot
SimDynamics::DynamicsRobotPtr dynamicsRobot
Definition: BulletPhysicsWorld.h:210
armarx::BulletPhysicsWorld::getRobotNodeDistance
armarx::DistanceInfo getRobotNodeDistance(const std::string &robotName, const std::string &robotNodeName1, const std::string &robotNodeName2) override
Definition: BulletPhysicsWorld.cpp:2057
armarx::BulletPhysicsWorld::setRobotLinearVelocity
void setRobotLinearVelocity(const std::string &robotName, const std::string &robotNodeName, const Eigen::Vector3f &vel) override
Definition: BulletPhysicsWorld.cpp:1008
armarx::BulletPhysicsWorld::bulletFixedTimeStepMaxNrLoops
int bulletFixedTimeStepMaxNrLoops
Definition: BulletPhysicsWorld.h:199
armarx::BulletPhysicsWorld::getDynamicsObject
SimDynamics::DynamicsObjectPtr getDynamicsObject(const std::string &objectName)
Definition: BulletPhysicsWorld.cpp:1226
armarx::BulletPhysicsWorld::hasRobotNode
bool hasRobotNode(const std::string &robotName, const std::string &robotNodeName) override
Definition: BulletPhysicsWorld.cpp:1176
armarx::BulletPhysicsWorld::getRobotJointAngles
std::map< std::string, float > getRobotJointAngles(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:525
armarx::BulletPhysicsWorld::contacts
std::vector< SimDynamics::DynamicsEngine::DynamicsContactInfo > contacts
Definition: BulletPhysicsWorld.h:203
armarx::BulletPhysicsWorld::getDynamicRobot
virtual SimDynamics::DynamicsRobotPtr getDynamicRobot(const std::string &robotName)
Definition: BulletPhysicsWorld.cpp:1214
armarx::BulletPhysicsWorld::getRobotMass
float getRobotMass(const std::string &robotName) override
Definition: BulletPhysicsWorld.cpp:503
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::BulletPhysicsWorld::dynamicRobots
std::map< std::string, DynamicsRobotInfo > dynamicRobots
Definition: BulletPhysicsWorld.h:216
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
armarx::BulletPhysicsWorld::applyForceObject
void applyForceObject(const std::string &objectName, const Eigen::Vector3f &force) override
Definition: BulletPhysicsWorld.cpp:418