20#ifndef _RIGID_BODY_OBSERVER_H__
21#define _RIGID_BODY_OBSERVER_H__
23#include "mbsim/observers/observer.h"
25#include "mbsim/utils/boost_parameters.h"
26#include "mbsim/utils/openmbv_utils.h"
35 Frame *frameOfReference;
36 Frame *outputFrame {
nullptr };
37 std::shared_ptr<OpenMBVInteractionArrow> ombvForce, ombvMoment;
38 std::shared_ptr<OpenMBVArrow> ombvWeight, ombvAxisOfRotation, ombvMomentum, ombvAngularMomentum, ombvDerivativeOfMomentum, ombvDerivativeOfAngularMomentum;
39 std::vector<std::shared_ptr<OpenMBV::Arrow>> FArrow, MArrow;
40 std::shared_ptr<OpenMBV::Arrow> FWeight, openMBVAxisOfRotation, openMBVMomentum, openMBVAngularMomentum, openMBVDerivativeOfMomentum, openMBVDerivativeOfAngularMomentum;
41 std::string saved_body;
42 std::string saved_frameOfReference;
43 std::string saved_outputFrame;
64 void setRigidBody(
RigidBody *body_) { body = body_; }
65 void setFrameOfReference(
Frame *frameOfReference_) { frameOfReference = frameOfReference_; }
66 void setOutputFrame(
Frame *outputFrame_) { outputFrame = outputFrame_; }
69 void initializeUsingXML(xercesc::DOMElement *element);
73 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVWeight, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::toPoint)(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 ombvWeight = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
78 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVJointForce, tag, (optional (sideOfInteraction,(OpenMBVInteractionArrow::SideOfInteraction),OpenMBVInteractionArrow::action)(scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::toPoint)(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))) {
79 ombvForce = std::shared_ptr<OpenMBVInteractionArrow>(
new OpenMBVInteractionArrow(sideOfInteraction,scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
83 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVJointMoment, tag, (optional (sideOfInteraction,(OpenMBVInteractionArrow::SideOfInteraction),OpenMBVInteractionArrow::action)(scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::toPoint)(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))) {
84 ombvMoment = std::shared_ptr<OpenMBVInteractionArrow>(
new OpenMBVInteractionArrow(sideOfInteraction,scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
88 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVAxisOfRotation, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::toPoint)(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))) {
89 ombvAxisOfRotation = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
92 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
93 ombvMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
96 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
97 ombvAngularMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
100 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
101 ombvDerivativeOfMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
104 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&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
105 ombvDerivativeOfAngularMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
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
Definition: openmbv_utils.h:111
Definition: rigid_body_observer.h:32
BOOST_PARAMETER_MEMBER_FUNCTION((void), enableOpenMBVAxisOfRotation, tag,(optional(scaleLength,(double), 1)(scaleSize,(double), 1)(referencePoint,(OpenMBVArrow::ReferencePoint), OpenMBVArrow::toPoint)(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)))
Visualize the center of rotation.
Definition: rigid_body_observer.h:88
void init(InitStage stage, const InitConfigSet &config)
plots time series header
Definition: rigid_body_observer.cc:48
void plot()
plots time dependent data
Definition: rigid_body_observer.cc:156
BOOST_PARAMETER_MEMBER_FUNCTION((void), enableOpenMBVWeight, tag,(optional(scaleLength,(double), 1)(scaleSize,(double), 1)(referencePoint,(OpenMBVArrow::ReferencePoint), OpenMBVArrow::toPoint)(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)))
Visualize the weight.
Definition: rigid_body_observer.h:73
BOOST_PARAMETER_MEMBER_FUNCTION((void), enableOpenMBVJointForce, tag,(optional(sideOfInteraction,(OpenMBVInteractionArrow::SideOfInteraction), OpenMBVInteractionArrow::action)(scaleLength,(double), 1)(scaleSize,(double), 1)(referencePoint,(OpenMBVArrow::ReferencePoint), OpenMBVArrow::toPoint)(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)))
Visualize the joint force.
Definition: rigid_body_observer.h:78
BOOST_PARAMETER_MEMBER_FUNCTION((void), enableOpenMBVJointMoment, tag,(optional(sideOfInteraction,(OpenMBVInteractionArrow::SideOfInteraction), OpenMBVInteractionArrow::action)(scaleLength,(double), 1)(scaleSize,(double), 1)(referencePoint,(OpenMBVArrow::ReferencePoint), OpenMBVArrow::toPoint)(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)))
Visualize the joint moment.
Definition: rigid_body_observer.h:83
rigid bodies with arbitrary kinematics
Definition: rigid_body.h:50
namespace MBSim
Definition: bilateral_constraint.cc:30