Biorbd
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
biorbd::muscles::State Class Reference

EMG holder to interact with the muscle. More...

#include <State.h>

Inheritance diagram for biorbd::muscles::State:
biorbd::muscles::StateDynamics biorbd::muscles::StateDynamicsBuchanan biorbd::muscles::StateDynamicsDeGroote

Public Member Functions

 State (const biorbd::utils::Scalar &excitation=0, const biorbd::utils::Scalar &activation=0)
 Construct a state. More...
 
 State (const biorbd::muscles::State &other)
 Construct a muscle state from another state. More...
 
virtual ~State ()
 Destroy class properly.
 
biorbd::muscles::State DeepCopy () const
 Deep copy of state. More...
 
void DeepCopy (const biorbd::muscles::State &other)
 Deep copy of state into another state. More...
 
virtual void setExcitation (const biorbd::utils::Scalar &val, bool turnOffWarnings=false)
 Set the muscle excitation. More...
 
const biorbd::utils::Scalar & excitation () const
 Return the muscle excitation. More...
 
const biorbd::utils::Scalar & normalizeExcitation (const biorbd::muscles::State &emgMax, bool turnOffWarnings=false)
 Compute and return the normalized excitation. More...
 
void setExcitationNorm (const biorbd::utils::Scalar &val)
 Force set the normalized excitation. More...
 
const biorbd::utils::Scalar & excitationNorm () const
 Return the previously normalized excitation. More...
 
virtual void setActivation (const biorbd::utils::Scalar &val, bool turnOffWarnings=false)
 Set the muscle activation. More...
 
const biorbd::utils::Scalar & activation () const
 Return the muscle activation. More...
 
biorbd::muscles::STATE_TYPE type () const
 Return the state type. More...
 

Protected Member Functions

virtual void setType ()
 Set the type to simple_state.
 

Protected Attributes

std::shared_ptr< biorbd::muscles::STATE_TYPE > m_stateType
 The state type.
 
std::shared_ptr< biorbd::utils::Scalar > m_excitation
 The muscle excitation.
 
std::shared_ptr< biorbd::utils::Scalar > m_excitationNorm
 The normalized excitation.
 
std::shared_ptr< biorbd::utils::Scalar > m_activation
 The muscle activation.
 

Detailed Description

EMG holder to interact with the muscle.

Definition at line 15 of file State.h.

Constructor & Destructor Documentation

◆ State() [1/2]

biorbd::muscles::State::State ( const biorbd::utils::Scalar &  excitation = 0,
const biorbd::utils::Scalar &  activation = 0 
)

Construct a state.

Parameters
excitationThe muscle excitation
activationThe muscle activation

Definition at line 6 of file State.cpp.

◆ State() [2/2]

biorbd::muscles::State::State ( const biorbd::muscles::State other)

Construct a muscle state from another state.

Parameters
otherThe other state

Definition at line 17 of file State.cpp.

Member Function Documentation

◆ activation()

const biorbd::utils::Scalar & biorbd::muscles::State::activation ( ) const

Return the muscle activation.

Returns
The muscle activation

Definition at line 127 of file State.cpp.

◆ DeepCopy() [1/2]

biorbd::muscles::State biorbd::muscles::State::DeepCopy ( ) const

Deep copy of state.

Returns
A deep copy of state

Definition at line 32 of file State.cpp.

◆ DeepCopy() [2/2]

void biorbd::muscles::State::DeepCopy ( const biorbd::muscles::State other)

Deep copy of state into another state.

Parameters
otherThe state to copy

Definition at line 39 of file State.cpp.

◆ excitation()

const biorbd::utils::Scalar & biorbd::muscles::State::excitation ( ) const

Return the muscle excitation.

Returns
The muscle excitation

Definition at line 66 of file State.cpp.

◆ excitationNorm()

const biorbd::utils::Scalar & biorbd::muscles::State::excitationNorm ( ) const

Return the previously normalized excitation.

Returns
The normalized excitation

Definition at line 93 of file State.cpp.

◆ normalizeExcitation()

const biorbd::utils::Scalar & biorbd::muscles::State::normalizeExcitation ( const biorbd::muscles::State emgMax,
bool  turnOffWarnings = false 
)

Compute and return the normalized excitation.

Parameters
emgMaxThe maximal emg
turnOffWarningsIf the warning when excitation is higher than 1 should be off or on
Returns
The normalized excitation

Even when the warning is ON, the computation is performed anyway

Definition at line 71 of file State.cpp.

◆ setActivation()

void biorbd::muscles::State::setActivation ( const biorbd::utils::Scalar &  val,
bool  turnOffWarnings = false 
)
virtual

Set the muscle activation.

Parameters
valThe value of the muscle activation
turnOffWarningsIf the warnings should be OFF or ON.

Even if the warning on the activation being lower than 0 is set to OFF it changes it to 0 anyway, but doesn't send a warning saying it.

Even if the warning on the activation being higher than 1 is set to OFF it changes it to 1 anyway, but doesn't send a warning saying it.

Reimplemented in biorbd::muscles::StateDynamics, and biorbd::muscles::StateDynamicsBuchanan.

Definition at line 98 of file State.cpp.

◆ setExcitation()

void biorbd::muscles::State::setExcitation ( const biorbd::utils::Scalar &  val,
bool  turnOffWarnings = false 
)
virtual

Set the muscle excitation.

Parameters
valThe value of the muscle excitation
turnOffWarningsIf the warnings should be OFF or ON.

Even if the warning on the excitation being lower than 0 is set to OFF it changes it to 0 anyway, but doesn't send a warning saying it.

Reimplemented in biorbd::muscles::StateDynamicsBuchanan, and biorbd::muscles::StateDynamics.

Definition at line 47 of file State.cpp.

◆ setExcitationNorm()

void biorbd::muscles::State::setExcitationNorm ( const biorbd::utils::Scalar &  val)

Force set the normalized excitation.

Parameters
valValue of the normalized excitation to set

Definition at line 87 of file State.cpp.

◆ type()

biorbd::muscles::STATE_TYPE biorbd::muscles::State::type ( ) const

Return the state type.

Returns
The state type

Definition at line 132 of file State.cpp.


The documentation for this class was generated from the following files: