Biorbd Release_1.13.0
Loading...
Searching...
No Matches
SegmentCharacteristics.h
1#ifndef BIORBD_RIGIDBODY_SEGMENT_CHARACTERISTICS_H
2#define BIORBD_RIGIDBODY_SEGMENT_CHARACTERISTICS_H
3
4#include "biorbdConfig.h"
5
6#include <memory>
7
8#include <rbdl/Body.h>
9
10#include "Utils/Scalar.h"
11
12namespace BIORBD_NAMESPACE {
13namespace utils {
14class Vector3d;
15class Matrix3d;
16} // namespace utils
17
18namespace rigidbody {
19class Mesh;
20
25#ifdef SWIG
26class BIORBD_API SegmentCharacteristics
27#else
28class BIORBD_API SegmentCharacteristics : public RigidBodyDynamics::Body
29#endif
30{
31 public:
36
44 const utils::Scalar &mass,
45 const utils::Vector3d &com,
47
56 const utils::Scalar &mass,
57 const utils::Vector3d &com,
59 const Mesh &mesh);
60
66
71 void DeepCopy(const SegmentCharacteristics &other);
72
77 void setLength(const utils::Scalar &val);
78
83 utils::Scalar length() const;
84
89 void setMass(const utils::Scalar &newMass);
90
95 utils::Scalar mass() const;
96
102 utils::Vector3d CoM() const;
103
108 void setCoM(const utils::Vector3d &com);
109
114 Mesh &mesh();
115
120 const Mesh &mesh() const;
121
126 const utils::Matrix3d inertia() const;
127
133
134 protected:
135 std::shared_ptr<utils::Scalar> m_length;
136 std::shared_ptr<Mesh> m_mesh;
137};
138
139} // namespace rigidbody
140} // namespace BIORBD_NAMESPACE
141
142#endif // BIORBD_RIGIDBODY_SEGMENT_CHARACTERISTICS_H
A class that holds the geometry of a segment.
Definition Mesh.h:22
Characteristics of a segment, namely the mass, the center of mass, the inertia, the length and its me...
void setLength(const utils::Scalar &val)
Set the segment length.
std::shared_ptr< utils::Scalar > m_length
Length of the segment.
utils::Scalar length() const
Returns the segment length.
const utils::Matrix3d inertia() const
Returns the segment inertia matrix.
SegmentCharacteristics DeepCopy() const
Deep copy of the segment characteristics.
utils::Vector3d CoM() const
CoM Returns the position of the center of mass in the local reference frame.
std::shared_ptr< Mesh > m_mesh
Mesh of the segment.
utils::Scalar mass() const
Returns the segment mass.
void setCoM(const utils::Vector3d &com)
setCoM Change the position of the center of mass
void setMass(const utils::Scalar &newMass)
Set the new mass.
void setInertia(const utils::Matrix3d &inertia)
Set the matrix of inertia.
A wrapper for the Eigen::MatrixXd.
Definition Matrix3d.h:21
Wrapper around Eigen Vector3d and attach it to a parent.
Definition Vector3d.h:27