Biorbd
Compound.h
1  #ifndef BIORBD_MUSCLES_COMPOUND_H
2 #define BIORBD_MUSCLES_COMPOUND_H
3 
4 #include <memory>
5 #include <vector>
6 #include "biorbdConfig.h"
7 #include "Muscles/MusclesEnums.h"
8 #include "Utils/Scalar.h"
9 
10 namespace biorbd {
11 namespace utils {
12 class String;
13 class Vector3d;
14 }
15 
16 namespace rigidbody {
17 class Joints;
18 class GeneralizedCoordinates;
19 class GeneralizedVelocity;
20 }
21 
22 namespace muscles {
23 class Characteristics;
24 class PathModifiers;
25 class State;
29 class BIORBD_API Compound
30 {
31 public:
35  Compound();
36 
41  Compound(
42  const biorbd::utils::String &name);
43 
49  Compound(
50  const biorbd::utils::String& name,
51  const biorbd::muscles::PathModifiers& pathModifiers);
56  Compound(
57  const biorbd::muscles::Compound& other);
58 
63  Compound(
64  const std::shared_ptr<biorbd::muscles::Compound> other);
65 
69  virtual ~Compound();
70 
75  void DeepCopy(
76  const biorbd::muscles::Compound& other);
77 
82  void setName(const biorbd::utils::String& name);
83 
88  const biorbd::utils::String& name() const;
89 
90 
95  biorbd::muscles::MUSCLE_TYPE type() const;
96 
97  // Wrapping object
102  const biorbd::muscles::PathModifiers& pathModifier();
103 
108  void addPathObject(biorbd::utils::Vector3d& wrap);
109 
114  virtual const biorbd::utils::Scalar& force();
115 
121  virtual const biorbd::utils::Scalar& force(
122  const biorbd::muscles::State& emg) = 0;
123 
133  virtual const biorbd::utils::Scalar& force(
137  const biorbd::muscles::State& emg,
138  int updateKin = 2) = 0;
139 
148  virtual const biorbd::utils::Scalar& force(
151  const biorbd::muscles::State& emg,
152  int updateKin = 2) = 0;
153 
154 protected:
155  std::shared_ptr<biorbd::utils::String> m_name;
156  std::shared_ptr<biorbd::muscles::MUSCLE_TYPE> m_type;
157  std::shared_ptr<biorbd::muscles::PathModifiers> m_pathChanger;
158  std::shared_ptr<biorbd::utils::Scalar> m_force;
159 
163  virtual void setType()=0;
164 
165 };
166 
167 }}
168 
169 #endif // BIORBD_MUSCLES_COMPOUND_H
biorbd::muscles::Compound
Class compound is a very generic definition of what a muscle is. It should be the base class of every...
Definition: Compound.h:30
biorbd::muscles::State
EMG holder to interact with the muscle.
Definition: State.h:16
biorbd::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition: Vector3d.h:24
biorbd::muscles::Compound::m_name
std::shared_ptr< biorbd::utils::String > m_name
The name of the muscle.
Definition: Compound.h:155
biorbd::rigidbody::GeneralizedCoordinates
Class GeneralizedCoordinates.
Definition: GeneralizedCoordinates.h:15
biorbd::muscles::Compound::force
virtual const biorbd::utils::Scalar & force(biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates &Q, const biorbd::muscles::State &emg, int updateKin=2)=0
Return the computed force norm from EMG.
biorbd::rigidbody::Joints
This is the core of the musculoskeletal model in biorbd.
Definition: Joints.h:40
biorbd::muscles::PathModifiers
Holder of all the path modifiers of a muscle.
Definition: PathModifiers.h:18
biorbd::utils::String
Wrapper around the std::string class with augmented functionality.
Definition: String.h:17
biorbd::muscles::Compound::force
virtual const biorbd::utils::Scalar & force(biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates &Q, const biorbd::rigidbody::GeneralizedVelocity &Qdot, const biorbd::muscles::State &emg, int updateKin=2)=0
Return the computed force norm from EMG.
biorbd::muscles::Compound::force
virtual const biorbd::utils::Scalar & force(const biorbd::muscles::State &emg)=0
Computes and returns the forces norm from the EMG.
biorbd::muscles::Compound::m_type
std::shared_ptr< biorbd::muscles::MUSCLE_TYPE > m_type
The type of muscle.
Definition: Compound.h:156
biorbd::muscles::Compound::m_pathChanger
std::shared_ptr< biorbd::muscles::PathModifiers > m_pathChanger
The set of path modifiers.
Definition: Compound.h:157
biorbd::rigidbody::GeneralizedVelocity
Class GeneralizedVelocity.
Definition: GeneralizedVelocity.h:15
biorbd::muscles::Compound::setType
virtual void setType()=0
Set the type of muscle.
biorbd::muscles::Compound::m_force
std::shared_ptr< biorbd::utils::Scalar > m_force
The last computed force.
Definition: Compound.h:158