SimObject.cpp
Go to the documentation of this file.
1 #ifdef MUJOCO_PHYSICS_WORLD
2 #include "SimObject.h"
3 
4 #include <VirtualRobot/math/Helpers.h>
5 
7 
8 #include <MujocoX/libraries/Simulation/Data.h>
9 
10 
11 using namespace mujoco;
12 
13 
15 {}
16 
17 SimObject::SimObject(const std::string& name) : body(name), geom(name)
18 {}
19 
20 SimObject::SimObject(VirtualRobot::SceneObjectPtr sceneObject) :
21  body(sceneObject->getName()), geom(sceneObject->getName()), sceneObject(sceneObject)
22 {}
23 
24 
25 void SimObject::update(Model& model)
26 {
27  body.update(model);
28  geom.update(model);
29 }
30 
31 void SimObject::updateSceneObjectPose(const Data& data, float lengthScaling)
32 {
33  ARMARX_CHECK(sceneObject);
34  Eigen::Matrix4f pose = data.getBodyPose(body);
35  math::Helpers::Position(pose) *= lengthScaling;
36  sceneObject->setGlobalPose(pose);
37 }
38 
39 const std::string& SimObject::name() const
40 {
41  return body.name();
42 }
43 
44 
45 #endif
mujoco
Definition: SimObject.h:8
ARMARX_CHECK
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
Definition: ExpressionException.h:82
SimObject.h
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
mujoco::SimObject::SimObject
SimObject()
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
ExpressionException.h
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
scene3D::SceneObjectPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr
Definition: PointerDefinitions.h:40
armarx::navigation::core::Position
Eigen::Vector3f Position
Definition: basic_types.h:36