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 std::shared_ptr<OpenMBVInteractionArrow> ombvForce, ombvMoment;
37 std::shared_ptr<OpenMBVArrow> ombvWeight, ombvAxisOfRotation, ombvMomentum, ombvAngularMomentum, ombvDerivativeOfMomentum, ombvDerivativeOfAngularMomentum;
38 std::vector<std::shared_ptr<OpenMBV::Arrow>> FArrow, MArrow;
39 std::shared_ptr<OpenMBV::Arrow> FWeight, openMBVAxisOfRotation, openMBVMomentum, openMBVAngularMomentum, openMBVDerivativeOfMomentum, openMBVDerivativeOfAngularMomentum;
40 std::string saved_body;
41 std::string saved_frameOfReference;
62 void setRigidBody(
RigidBody *body_) { body = body_; }
63 void setFrameOfReference(
Frame *frameOfReference_) { frameOfReference = frameOfReference_; }
66 void initializeUsingXML(xercesc::DOMElement *element);
70 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))) {
71 ombvWeight = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
75 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))) {
76 ombvForce = std::shared_ptr<OpenMBVInteractionArrow>(
new OpenMBVInteractionArrow(sideOfInteraction,scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
80 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))) {
81 ombvMoment = std::shared_ptr<OpenMBVInteractionArrow>(
new OpenMBVInteractionArrow(sideOfInteraction,scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
85 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))) {
86 ombvAxisOfRotation = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
89 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))) {
90 ombvMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
93 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))) {
94 ombvAngularMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
97 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))) {
98 ombvDerivativeOfMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
101 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))) {
102 ombvDerivativeOfAngularMomentum = std::shared_ptr<OpenMBVArrow>(
new OpenMBVArrow(scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
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:75
Definition: openmbv_utils.h:79
Definition: openmbv_utils.h:111
Definition: rigid_body_observer.h:32
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:70
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:80
InitStage
The stages of the initialization.
Definition: element.h:62
void plot()
plots time dependent data
Definition: rigid_body_observer.cc:172
std::string name
name of element
Definition: element.h:249
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:85
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
Definition: observer.h:26
rigid bodies with arbitrary kinematics
Definition: rigid_body.h:50
namespace MBSim
Definition: eigenanalyzer.cc:47
void init(InitStage stage, const InitConfigSet &config)
plots time series header
Definition: rigid_body_observer.cc:48