iDynTree::ContactStateMachine class

Contact State Machine class for binary contact state detection Contains a Schmitt Trigger device for updating the contact states using the contact normal force acting on the contact link and Determines contact transitions using simple binary switching logic.

Can be used to determine stable contacts, contact breaking and contact making. The parameters to the Schmitt Trigger are passed as a struct and is the Schmitt Trigger is instantiated in the class constructor.

NOTE: There are no default parameters to the Schmitt Trigger. These parameters are set through the constructor during instantiation.

This class does not exactly abstract the Schmitt Trigger class. Schmitt Trigger methods are still accessible through the m_contactSchmitt object. This class uses a generic Schmitt Trigger object and augments its functionality specific to physical contacts based scenarios.

Public types

enum contactTransition { STABLE_OFFCONTACT, STABLE_ONCONTACT, CONTACT_BREAK, CONTACT_MAKE, UNKNOWN_TRANSITION = -1 }
Enumeration of contact transitions.

Constructors, destructors, conversion operators

ContactStateMachine(const SchmittParams& s)
Constructor.

Public functions

void contactMeasurementUpdate(double currentTime, double contactNormalForce)
Calls schmitt trigger device update.
void resetDevice()
Calls schmitt trigger device reset.
auto contactState() -> bool
Get current contact state.
auto contactTransitionMode() -> contactTransition
Determines contact transitions using simple binary switching logic.
auto lastUpdateTime() -> double
Get time of last contact state update.

Public variables

std::unique_ptr<SchmittTrigger> m_contactSchmitt
unique pointer to the schmitt trigger device

Enum documentation

enum iDynTree::ContactStateMachine::contactTransition

Enumeration of contact transitions.

Enumerators
STABLE_OFFCONTACT

previous state: off contact, current state: off contact

STABLE_ONCONTACT

previous state: on contact, current state: on contact

CONTACT_BREAK

previous state: on contact, current state: off contact

CONTACT_MAKE

previous state: off contact, current state: on contact

UNKNOWN_TRANSITION

Unknown transition.

Function documentation

iDynTree::ContactStateMachine::ContactStateMachine(const SchmittParams& s)

Constructor.

Parameters
s const reference to a struct containing schmitt trigger device parameters

void iDynTree::ContactStateMachine::contactMeasurementUpdate(double currentTime, double contactNormalForce)

Calls schmitt trigger device update.

Parameters
currentTime time
contactNormalForce normal force acting on the contact link in consideration

bool iDynTree::ContactStateMachine::contactState()

Get current contact state.

Returns true, if in contact, false otherwise

contactTransition iDynTree::ContactStateMachine::contactTransitionMode()

Determines contact transitions using simple binary switching logic.

Returns contactTransition enumerated value

double iDynTree::ContactStateMachine::lastUpdateTime()

Get time of last contact state update.

Returns time