20#ifndef _FRAME_OBSERVER_H__
21#define _FRAME_OBSERVER_H__
23#include "mbsim/observers/observer.h"
25#include <mbsim/utils/boost_parameters.h>
26#include <mbsim/utils/openmbv_utils.h>
35 std::string saved_frame;
36 std::shared_ptr<OpenMBVArrow> ombvPositionArrow, ombvVelocityArrow, ombvAngularVelocityArrow, ombvAccelerationArrow, ombvAngularAccelerationArrow;
37 std::shared_ptr<OpenMBV::Arrow> openMBVPosition, openMBVVelocity, openMBVAngularVelocity, openMBVAcceleration, openMBVAngularAcceleration;
39 double (
FrameObserver::*evalOMBVPositionColorRepresentation[2])();
40 double (
FrameObserver::*evalOMBVVelocityColorRepresentation[2])();
41 double (
FrameObserver::*evalOMBVAngularVelocityColorRepresentation[2])();
42 double (
FrameObserver::*evalOMBVAccelerationColorRepresentation[2])();
43 double (
FrameObserver::*evalOMBVAngularAccelerationColorRepresentation[2])();
45 double evalNone() {
return 0.5; }
46 double evalAbsolutePosition();
47 double evalAbsoluteVelocitiy();
48 double evalAbsoluteAngularVelocitiy();
49 double evalAbsoluteAcceleration();
50 double evalAbsoluteAngularAcceleration();
54 void setFrame(
Frame *frame_) { frame = frame_; }
55 void setOutputFrame(
Frame *outputFrame_) { outputFrame = outputFrame_; }
59 void initializeUsingXML(xercesc::DOMElement *element);
61 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
62 ombvPositionArrow = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
64 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
65 ombvVelocityArrow = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
67 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVAngularVelocity, 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
68 ombvAngularVelocityArrow = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
70 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
71 ombvAccelerationArrow = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
73 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVAngularAcceleration, 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
74 ombvAngularAccelerationArrow = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
77 Frame *outputFrame {
nullptr };
78 std::string saved_outputFrame;
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
Definition: frame_observer.h:32
void plot()
plots time dependent data
Definition: frame_observer.cc:110
void init(InitStage stage, const InitConfigSet &config)
plots time series header
Definition: frame_observer.cc:50
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
Definition: observer.h:26
Definition: openmbv_utils.h:79
namespace MBSim
Definition: bilateral_constraint.cc:30