Biorbd Release_1.13.0
Loading...
Searching...
No Matches
BIORBD_NAMESPACE::internal_forces::muscles::State Class Reference

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

#include <State.h>

Inheritance diagram for BIORBD_NAMESPACE::internal_forces::muscles::State:
BIORBD_NAMESPACE::internal_forces::muscles::StateDynamics BIORBD_NAMESPACE::internal_forces::muscles::StateDynamicsBuchanan BIORBD_NAMESPACE::internal_forces::muscles::StateDynamicsDeGroote

Public Member Functions

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

Protected Member Functions

virtual void setType ()
 Set the type to simple_state.

Protected Attributes

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

Detailed Description

EMG holder to interact with the muscle.

Definition at line 17 of file State.h.

Constructor & Destructor Documentation

◆ State() [1/2]

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

Construct a state.

Parameters
excitationThe muscle excitation
activationThe muscle activation

Definition at line 7 of file State.cpp.

◆ State() [2/2]

internal_forces::muscles::State::State ( const State & other)

Construct a muscle state from another state.

Parameters
otherThe other state

Definition at line 17 of file State.cpp.

◆ ~State()

internal_forces::muscles::State::~State ( )
virtual

Destroy class properly.

Definition at line 24 of file State.cpp.

Member Function Documentation

◆ activation()

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

Return the muscle activation.

Returns
The muscle activation

Definition at line 117 of file State.cpp.

◆ DeepCopy() [1/2]

internal_forces::muscles::State internal_forces::muscles::State::DeepCopy ( ) const

Deep copy of state.

Returns
A deep copy of state

Definition at line 28 of file State.cpp.

◆ DeepCopy() [2/2]

void internal_forces::muscles::State::DeepCopy ( const State & other)

Deep copy of state into another state.

Parameters
otherThe state to copy

Definition at line 35 of file State.cpp.

◆ excitation()

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

Return the muscle excitation.

Returns
The muscle excitation

Definition at line 61 of file State.cpp.

◆ excitationNorm()

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

Return the previously normalized excitation.

Returns
The normalized excitation

Definition at line 85 of file State.cpp.

◆ normalizeExcitation()

const utils::Scalar & internal_forces::muscles::State::normalizeExcitation ( const 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 65 of file State.cpp.

◆ setActivation()

void internal_forces::muscles::State::setActivation ( const 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_NAMESPACE::internal_forces::muscles::StateDynamics, and BIORBD_NAMESPACE::internal_forces::muscles::StateDynamicsBuchanan.

Definition at line 89 of file State.cpp.

◆ setExcitation()

void internal_forces::muscles::State::setExcitation ( const 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_NAMESPACE::internal_forces::muscles::StateDynamics, and BIORBD_NAMESPACE::internal_forces::muscles::StateDynamicsBuchanan.

Definition at line 43 of file State.cpp.

◆ setExcitationNorm()

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

Force set the normalized excitation.

Parameters
valValue of the normalized excitation to set

Definition at line 80 of file State.cpp.

◆ setType()

void internal_forces::muscles::State::setType ( )
protectedvirtual

◆ type()

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

Return the state type.

Returns
The state type

Definition at line 121 of file State.cpp.

Member Data Documentation

◆ m_activation

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::muscles::State::m_activation
protected

The muscle activation.

Definition at line 131 of file State.h.

◆ m_excitation

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::muscles::State::m_excitation
protected

The muscle excitation.

Definition at line 128 of file State.h.

◆ m_excitationNorm

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::muscles::State::m_excitationNorm
protected

The normalized excitation.

Definition at line 130 of file State.h.

◆ m_stateType

std::shared_ptr<STATE_TYPE> BIORBD_NAMESPACE::internal_forces::muscles::State::m_stateType
protected

The state type.

Definition at line 127 of file State.h.


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