20 #ifndef _RELATIVE_KINEMATICS_OBSERVER_H__
21 #define _RELATIVE_KINEMATICS_OBSERVER_H__
23 #include "mbsim/observers/observer.h"
25 #include <mbsim/utils/boost_parameters.h>
26 #include <mbsim/utils/openmbv_utils.h>
34 Frame *frame, *refFrame;
35 std::string saved_frame, saved_frameOfReference;
36 std::shared_ptr<OpenMBV::Group> openMBVPosGrp, openMBVVelGrp, openMBVAngVelGrp, openMBVAccGrp, openMBVAngAccGrp;
37 std::shared_ptr<OpenMBV::Arrow> openMBVPosition, openMBVVelocity, openMBVAngularVelocity, openMBVAcceleration, openMBVAngularAcceleration, openMBVrTrans, openMBVrRel, openMBVvTrans, openMBVvRot, openMBVvRel, openMBVvF, openMBVaTrans, openMBVaRot, openMBVaZp, openMBVaCor, openMBVaRel, openMBVaF, openMBVomTrans, openMBVomRel, openMBVpsiTrans, openMBVpsiRot, openMBVpsiRel;
42 void setFrame(
Frame *frame_) { frame = frame_; }
43 void setFrameOfReference(
Frame *frame_) { refFrame = frame_; }
45 void init(
InitStage stage,
const InitConfigSet &config)
override;
47 void initializeUsingXML(xercesc::DOMElement *element)
override;
49 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVPosition, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
50 OpenMBVArrow ombv(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,0,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth);
51 openMBVPosition=ombv.createOpenMBV();
53 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVVelocity, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
54 OpenMBVArrow ombv(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,0,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth);
55 openMBVVelocity=ombv.createOpenMBV();
57 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVAngularVelocity, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
58 OpenMBVArrow ombv(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,0,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth);
59 openMBVAngularVelocity=ombv.createOpenMBV();
61 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVAcceleration, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
62 OpenMBVArrow ombv(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,0,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth);
63 openMBVAcceleration=ombv.createOpenMBV();
65 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVAngularAcceleration, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::fromPoint)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
66 OpenMBVArrow ombv(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,0,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth);
67 openMBVAngularAcceleration=ombv.createOpenMBV();
void plot() override
plots time dependent data
Definition: relative_kinematics_observer.cc:181
Definition: openmbv_utils.h:79
InitStage
The stages of the initialization.
Definition: element.h:62
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: relative_kinematics_observer.cc:39
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
Definition: observer.h:26
Definition: relative_kinematics_observer.h:32