Biorbd
Release_1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
IdealizedActuator.cpp
1
#define BIORBD_API_EXPORTS
2
#include "InternalForces/Muscles/IdealizedActuator.h"
3
4
#include "InternalForces/Muscles/Characteristics.h"
5
#include "InternalForces/Muscles/State.h"
6
#include "Utils/String.h"
7
8
using namespace
BIORBD_NAMESPACE;
9
10
internal_forces::muscles::IdealizedActuator::IdealizedActuator
()
11
: internal_forces::muscles::
Muscle
() {
12
setType
();
13
}
14
15
internal_forces::muscles::IdealizedActuator::IdealizedActuator
(
16
const
utils::String
&
name
,
17
const
internal_forces::muscles::MuscleGeometry
&geometry,
18
const
internal_forces::muscles::Characteristics
&
characteristics
)
19
: internal_forces::muscles::
Muscle
(
name
, geometry,
characteristics
) {
20
setType
();
21
}
22
23
internal_forces::muscles::IdealizedActuator::IdealizedActuator
(
24
const
utils::String
&
name
,
25
const
internal_forces::muscles::MuscleGeometry
&geometry,
26
const
internal_forces::muscles::Characteristics
&
characteristics
,
27
const
internal_forces::muscles::State
&emg)
28
: internal_forces::muscles::
Muscle
(
name
, geometry,
characteristics
, emg) {
29
setType
();
30
}
31
32
internal_forces::muscles::IdealizedActuator::IdealizedActuator
(
33
const
utils::String
&
name
,
34
const
internal_forces::muscles::MuscleGeometry
&geometry,
35
const
internal_forces::muscles::Characteristics
&
characteristics
,
36
const
internal_forces::PathModifiers
&pathModifiers)
37
: internal_forces::muscles::
Muscle
(
38
name
,
39
geometry,
40
characteristics
,
41
pathModifiers) {
42
setType
();
43
}
44
45
internal_forces::muscles::IdealizedActuator::IdealizedActuator
(
46
const
utils::String
&
name
,
47
const
internal_forces::muscles::MuscleGeometry
&geometry,
48
const
internal_forces::muscles::Characteristics
&
characteristics
,
49
const
internal_forces::PathModifiers
&pathModifiers,
50
const
internal_forces::muscles::State
&emg)
51
: internal_forces::muscles::
Muscle
(
52
name
,
53
geometry,
54
characteristics
,
55
pathModifiers,
56
emg) {
57
setType
();
58
}
59
60
internal_forces::muscles::IdealizedActuator::IdealizedActuator
(
61
const
internal_forces::muscles::Muscle
&other)
62
: internal_forces::muscles::
Muscle
(other) {}
63
64
internal_forces::muscles::IdealizedActuator::IdealizedActuator
(
65
const
std::shared_ptr<Muscle> other)
66
: internal_forces::muscles::
Muscle
(other) {}
67
68
internal_forces::muscles::IdealizedActuator
69
internal_forces::muscles::IdealizedActuator::DeepCopy
()
const
{
70
internal_forces::muscles::IdealizedActuator
copy;
71
copy.
DeepCopy
(*
this
);
72
return
copy;
73
}
74
75
void
internal_forces::muscles::IdealizedActuator::DeepCopy
(
76
const
internal_forces::muscles::IdealizedActuator
&other) {
77
internal_forces::muscles::Muscle::DeepCopy
(other);
78
}
79
80
const
utils::Scalar &
internal_forces::muscles::IdealizedActuator::force
(
81
const
internal_forces::muscles::State
&emg) {
82
computeForce
(emg);
83
return
*
m_force
;
84
}
85
86
const
utils::Scalar &
internal_forces::muscles::IdealizedActuator::force
(
87
rigidbody::Joints
&,
88
const
rigidbody::GeneralizedCoordinates
&,
89
const
rigidbody::GeneralizedVelocity
&,
90
const
internal_forces::muscles::State
&emg,
91
bool
) {
92
computeForce
(emg);
93
return
*
m_force
;
94
}
95
96
const
utils::Scalar &
internal_forces::muscles::IdealizedActuator::force
(
97
rigidbody::Joints
&,
98
const
rigidbody::GeneralizedCoordinates
&,
99
const
internal_forces::muscles::State
&emg,
100
bool
) {
101
computeForce
(emg);
102
return
*
m_force
;
103
}
104
105
utils::Scalar
106
internal_forces::muscles::IdealizedActuator::getForceFromActivation
(
107
const
internal_forces::muscles::State
&emg) {
108
return
characteristics
().forceIsoMax() * (emg.
activation
());
109
}
110
111
void
internal_forces::muscles::IdealizedActuator::setType
() {
112
*
m_type
= internal_forces::muscles::MUSCLE_TYPE::IDEALIZED_ACTUATOR;
113
}
BIORBD_NAMESPACE::internal_forces::Compound::name
const utils::String & name() const
Return the name of the muscle.
Definition
Compound.cpp:48
BIORBD_NAMESPACE::internal_forces::Compound::m_force
std::shared_ptr< utils::Scalar > m_force
The last computed force.
Definition
Compound.h:108
BIORBD_NAMESPACE::internal_forces::Compound::force
virtual const utils::Scalar & force()
Return the last computed muscle force norm.
Definition
Compound.cpp:63
BIORBD_NAMESPACE::internal_forces::PathModifiers
Holder of all the path modifiers of a muscle.
Definition
PathModifiers.h:18
BIORBD_NAMESPACE::internal_forces::muscles::Characteristics
Class Holds that muscle characteristics.
Definition
Characteristics.h:19
BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator
Muscle that has a constant maximal force.
Definition
IdealizedActuator.h:15
BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator::DeepCopy
IdealizedActuator DeepCopy() const
Deep copy of an idealized actuator.
Definition
IdealizedActuator.cpp:69
BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator::getForceFromActivation
virtual utils::Scalar getForceFromActivation(const State &emg)
Function allowing modification of the way the multiplication is done in computeForce(EMG).
Definition
IdealizedActuator.cpp:106
BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator::IdealizedActuator
IdealizedActuator()
Contruct an idealized actuator.
Definition
IdealizedActuator.cpp:10
BIORBD_NAMESPACE::internal_forces::muscles::IdealizedActuator::setType
virtual void setType()
Set the type to Idealized_actuator.
Definition
IdealizedActuator.cpp:111
BIORBD_NAMESPACE::internal_forces::muscles::MuscleGeometry
Class muscle geometry of the muscle.
Definition
MuscleGeometry.h:34
BIORBD_NAMESPACE::internal_forces::muscles::Muscle
Base class of all muscle.
Definition
Muscle.h:27
BIORBD_NAMESPACE::internal_forces::muscles::Muscle::characteristics
Characteristics & characteristics() const
Return the muscle characteristics.
Definition
Muscle.cpp:254
BIORBD_NAMESPACE::internal_forces::muscles::Muscle::Muscle
Muscle()
Construct a muscle.
Definition
Muscle.cpp:19
BIORBD_NAMESPACE::internal_forces::muscles::Muscle::computeForce
virtual void computeForce(const State &emg)
Computer the forces from a specific emg.
Definition
Muscle.cpp:222
BIORBD_NAMESPACE::internal_forces::muscles::Muscle::m_type
std::shared_ptr< MUSCLE_TYPE > m_type
The type of the muscle.
Definition
Muscle.h:343
BIORBD_NAMESPACE::internal_forces::muscles::Muscle::DeepCopy
void DeepCopy(const Muscle &other)
Deep copy of a muscle in new muscle.
Definition
Muscle.cpp:120
BIORBD_NAMESPACE::internal_forces::muscles::State
EMG holder to interact with the muscle.
Definition
State.h:17
BIORBD_NAMESPACE::internal_forces::muscles::State::activation
const utils::Scalar & activation() const
Return the muscle activation.
Definition
State.cpp:117
BIORBD_NAMESPACE::rigidbody::GeneralizedCoordinates
Class GeneralizedCoordinates.
Definition
GeneralizedCoordinates.h:15
BIORBD_NAMESPACE::rigidbody::GeneralizedVelocity
Class GeneralizedVelocity.
Definition
GeneralizedVelocity.h:15
BIORBD_NAMESPACE::rigidbody::Joints
This is the core of the musculoskeletal model in biorbd.
Definition
Joints.h:48
BIORBD_NAMESPACE::utils::String
Wrapper around the std::string class with augmented functionality.
Definition
String.h:18
src
InternalForces
Muscles
IdealizedActuator.cpp
Generated by
1.18.0