Biorbd Release_1.13.0
Loading...
Searching...
No Matches
FatigueDynamicState.cpp
1#define BIORBD_API_EXPORTS
2#include "InternalForces/Muscles/FatigueDynamicState.h"
3
4#include "Utils/Error.h"
5
6using namespace BIORBD_NAMESPACE;
7
9 const utils::Scalar& active,
10 const utils::Scalar& fatigued,
11 const utils::Scalar& resting)
12 : internal_forces::muscles::FatigueState(active, fatigued, resting),
13 m_activeFibersDot(std::make_shared<utils::Scalar>(0)),
14 m_fatiguedFibersDot(std::make_shared<utils::Scalar>(0)),
15 m_restingFibersDot(std::make_shared<utils::Scalar>(0)) {
16 setType();
17}
18
20 const std::shared_ptr<FatigueState> other)
21 : internal_forces::muscles::FatigueState(other) {
22 std::shared_ptr<internal_forces::muscles::FatigueDynamicState> muscle_tp(
23 std::dynamic_pointer_cast<internal_forces::muscles::FatigueDynamicState>(
24 other));
25 if (!muscle_tp) {
26 utils::Error::raise("This is not a dynamically fatigable muscle");
27 }
28 m_activeFibersDot = muscle_tp->m_activeFibersDot;
29 m_fatiguedFibersDot = muscle_tp->m_fatiguedFibersDot;
30 m_restingFibersDot = muscle_tp->m_restingFibersDot;
31}
32
40
41const utils::Scalar&
45
46const utils::Scalar&
50
51const utils::Scalar&
Class A state of fatigue that dynamically evolves over the usage of the muscle.
std::shared_ptr< utils::Scalar > m_fatiguedFibersDot
The fatigued fibers derivative.
const utils::Scalar & activeFibersDot() const
Return the active fibers derivative.
FatigueDynamicState(const utils::Scalar &active=0, const utils::Scalar &fatigued=0, const utils::Scalar &resting=1)
Construct the fatigue dynamic state.
std::shared_ptr< utils::Scalar > m_activeFibersDot
The active fibers derivative.
const utils::Scalar & fatiguedFibersDot() const
Return the fatigued fibers derivative.
const utils::Scalar & restingFibersDot() const
Return the resting fibers derivative.
std::shared_ptr< utils::Scalar > m_restingFibersDot
The resting fibers derivative.
FatigueState DeepCopy() const
Deep copy of the fatigue state.
FatigueState(const utils::Scalar &active=1, const utils::Scalar &fatigued=0, const utils::Scalar &resting=0)
Construct fatigue state.
static void raise(const String &message)
Throw an error message.
Definition Error.cpp:6