20 #ifndef _RIGID_BODY_SYSTEM_OBSERVER_H__
21 #define _RIGID_BODY_SYSTEM_OBSERVER_H__
23 #include "mbsim/observers/observer.h"
25 #include <mbsim/utils/boost_parameters.h>
26 #include <mbsim/utils/openmbv_utils.h>
35 std::vector<RigidBody*> body;
36 Frame *frameOfReference;
37 std::shared_ptr<OpenMBVArrow> ombvPosition, ombvVelocity, ombvAcceleration, ombvWeight, ombvMomentum, ombvAngularMomentum, ombvDerivativeOfMomentum, ombvDerivativeOfAngularMomentum;
38 std::shared_ptr<OpenMBV::Arrow> openMBVPosition, openMBVVelocity, openMBVAcceleration, openMBVWeight, openMBVMomentum, openMBVAngularMomentum, openMBVDerivativeOfMomentum, openMBVDerivativeOfAngularMomentum;
39 std::vector<std::string> saved_body;
40 std::string saved_frameOfReference;
44 void addRigidBody(
RigidBody *body_) { body.push_back(body_); }
45 void setFrameOfReference(
Frame *frameOfReference_) { frameOfReference = frameOfReference_; }
47 void init(
InitStage stage,
const InitConfigSet &config)
override;
48 void initializeUsingXML(xercesc::DOMElement *element)
override;
51 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVPosition, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
52 ombvPosition = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
55 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVVelocity, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
56 ombvVelocity = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
59 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVAcceleration, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
60 ombvAcceleration = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
63 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVWeight, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
64 ombvWeight = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
67 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVMomentum, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
68 ombvMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
71 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVAngularMomentum, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
72 ombvAngularMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
75 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVDerivativeOfMomentum, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
76 ombvDerivativeOfMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
79 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVDerivativeOfAngularMomentum, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
80 ombvDerivativeOfAngularMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
Definition: openmbv_utils.h:79
Definition: rigid_body_system_observer.h:33
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: rigid_body_system_observer.cc:42
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:235
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
void plot() override
plots time dependent data
Definition: rigid_body_system_observer.cc:99
Definition: observer.h:26
rigid bodies with arbitrary kinematics
Definition: rigid_body.h:50