Biorbd
IMU.cpp
1 #define BIORBD_API_EXPORTS
2 #include "RigidBody/IMU.h"
3 
4 #include "Utils/String.h"
5 
7  bool isTechnical,
8  bool isAnatomical) :
9  biorbd::utils::RotoTransNode(),
10  m_technical(std::make_shared<bool>(isTechnical)),
11  m_anatomical(std::make_shared<bool>(isAnatomical))
12 {
13 
14 }
15 
17  const biorbd::utils::RotoTransNode &RotoTrans,
18  bool isTechnical,
19  bool isAnatomical) :
20  biorbd::utils::RotoTransNode(RotoTrans),
21  m_technical(std::make_shared<bool>(isTechnical)),
22  m_anatomical(std::make_shared<bool>(isAnatomical))
23 {
24 
25 }
26 
27 #ifdef BIORBD_USE_CASADI_MATH
28 
30  const biorbd::rigidbody::IMU &imu) :
31  biorbd::utils::RotoTransNode (imu),
32  m_technical(std::make_shared<bool>(*imu.m_technical)),
33  m_anatomical(std::make_shared<bool>(*imu.m_anatomical))
34 {
35 
36 }
37 
39  const biorbd::rigidbody::IMU &other) const
40 {
43  this->biorbd::utils::RotoTransNode::operator*(other),
45  this->parent()),
46  this->isTechnical() && other.isTechnical(),
47  this->isAnatomical() && other.isAnatomical());
48 }
49 
50 #endif
51 
53 {
55  copy.DeepCopy(*this);
56  return copy;
57 }
58 
60 {
62  *m_technical = *other.m_technical;
63  *m_anatomical = *other.m_anatomical;
64 }
65 
67 {
68  return *m_anatomical;
69 }
70 
72 {
73  return *m_technical;
74 }
biorbd::rigidbody::IMU::m_technical
std::shared_ptr< bool > m_technical
If a IMU is a technical IMU.
Definition: IMU.h:103
biorbd::rigidbody::IMU::isAnatomical
bool isAnatomical() const
Return if the IMU is anatomical.
Definition: IMU.cpp:66
biorbd::rigidbody::IMU
Class IMU.
Definition: IMU.h:23
biorbd::utils::RotoTransNode::operator*
biorbd::utils::RotoTrans operator*(const biorbd::utils::RotoTransNode &other) const
operator* Matrix multiplication
Definition: RotoTransNode.cpp:47
biorbd::utils::RotoTransNode
A RotoTrans which is attached to a segment.
Definition: RotoTransNode.h:16
biorbd::utils::Node::name
const biorbd::utils::String & name() const
Return the name of the node.
Definition: Node.cpp:59
biorbd::rigidbody::IMU::m_anatomical
std::shared_ptr< bool > m_anatomical
It IMU is a anatomical IMU.
Definition: IMU.h:104
biorbd::utils::RotoTransNode::DeepCopy
biorbd::utils::RotoTransNode DeepCopy() const
Deep copy of a RotoTransNode.
Definition: RotoTransNode.cpp:23
biorbd::rigidbody::IMU::DeepCopy
biorbd::rigidbody::IMU DeepCopy() const
Deep copy of the IMU data.
Definition: IMU.cpp:52
biorbd::rigidbody::IMU::IMU
IMU(bool isTechnical=true, bool isAnatomical=true)
Construct inertial measurement unit.
Definition: IMU.cpp:6
biorbd::rigidbody::IMU::isTechnical
bool isTechnical() const
Return if the IMU is technical.
Definition: IMU.cpp:71