iDynTree::BipedFootContactClassifier class

Public types

enum contactFoot { LEFT_FOOT, RIGHT_FOOT, UNKNOWN_FOOT }
Enumeration of foot in contact.

Constructors, destructors, conversion operators

BipedFootContactClassifier(const SchmittParams& leftFootSchmittParams, const SchmittParams& rightFootSchmittParams)
Constructor @params leftFootSchmittParams const ref to struct containing parameters for the left foot schmitt trigger device @params rightFootSchmittParams const ref to struct containing parameters for the right foot schmitt trigger device.

Public functions

void updateFootContactState(double currentTime, double leftFootNormalForce, double rightFootNormalForce)
Updates the contact state machine for both the foot, determines the current state and detects foot transition for setting the primary foot(active foot)
auto getPrimaryFoot() -> contactFoot
Get the primary foot.
auto getLeftFootContactState() -> bool
Get left foot contact state.
auto getRightFootContactState() -> bool
Get right foot contact state.
void setContactSwitchingPattern(SwitchingPattern pattern)
set switching pattern to be considered for determining primary foot
void setPrimaryFoot(contactFoot foot)
set primary foot This method was mainly intended to be called by an external process to set the primary foot in the initial setting, before any contact is broken.

Public variables

std::unique_ptr<ContactStateMachine> m_leftFootContactClassifier
std::unique_ptr<ContactStateMachine> m_rightFootContactClassifier

Function documentation

void iDynTree::BipedFootContactClassifier::updateFootContactState(double currentTime, double leftFootNormalForce, double rightFootNormalForce)

Updates the contact state machine for both the foot, determines the current state and detects foot transition for setting the primary foot(active foot)

Parameters
currentTime time
leftFootNormalForce
rightFootNormalForce

contactFoot iDynTree::BipedFootContactClassifier::getPrimaryFoot()

Get the primary foot.

Returns contactFoot left, right or unknown

bool iDynTree::BipedFootContactClassifier::getLeftFootContactState()

Get left foot contact state.

Returns true if in contact, false otherwise

bool iDynTree::BipedFootContactClassifier::getRightFootContactState()

Get right foot contact state.

Returns true if in contact, false otherwise

void iDynTree::BipedFootContactClassifier::setContactSwitchingPattern(SwitchingPattern pattern)

set switching pattern to be considered for determining primary foot

Parameters
pattern switching pattern

void iDynTree::BipedFootContactClassifier::setPrimaryFoot(contactFoot foot)

set primary foot This method was mainly intended to be called by an external process to set the primary foot in the initial setting, before any contact is broken.

Parameters
foot primary foot

In case it is set to UNKNOWN_FOOT, it waits for the foot normal force measurements (checks left first and then right), and activates corresponding foot, handled in the detectTransitions() method.