mbsimcontrol  4.0.0
MBSim Control Module
motion_observer.h
1/* Copyright (C) 2004-2024 MBSim Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 *
17 * Contact: martin.o.foerg@gmail.com
18 */
19
20#ifndef _MBSIMCONTROl_MOTION_OBSERVER_H__
21#define _MBSIMCONTROl_MOTION_OBSERVER_H__
22
23#include "mbsim/observers/observer.h"
24
25//#include <mbsim/utils/boost_parameters.h>
26//#include <mbsim/utils/openmbv_utils.h>
27
28namespace OpenMBV {
29 class RigidBody;
30}
31
32namespace MBSim {
33 class Frame;
34}
35
36namespace MBSimControl {
37
38 class Signal;
39
41 protected:
42 std::string saved_frame, saved_position_signal, saved_orientation_signal;
43 MBSim::Frame* frame{nullptr};
44 Signal *position{nullptr};
45 Signal *orientation{nullptr};
46 std::shared_ptr<OpenMBV::RigidBody> openMBVBody;
47 fmatvec::Vec3 rOQ, rOP, rPQ, cardan;
48 fmatvec::SqrMat3 AIK, AIB, ABK;
49
50 public:
51 MotionObserver(const std::string &name="");
52 void setFrameOfReference(MBSim::Frame *frame_) { frame = frame_; }
53 void setPositionSignal(Signal* position_) { position = position_; }
54 void setOrientationSignal(Signal* orientation_) { orientation = orientation_; }
55 void init(InitStage stage, const MBSim::InitConfigSet &config) override;
56 void plot() override;
57 void initializeUsingXML(xercesc::DOMElement *element) override;
58 };
59
60}
61
62#endif
Definition: motion_observer.h:40
Signal.
Definition: signal_.h:38
std::string name