BipedalLocomotion::Contacts::ContactPhaseList class

The ContactPhaseList class computes the contact phases according to a bunch of input contact lists.

Public types

using const_iterator = std::vector<ContactPhase>::const_iterator
Internal method to compute the phases.
using const_reverse_iterator = std::vector<ContactPhase>::const_reverse_iterator

Constructors, destructors, conversion operators

ContactPhaseList() defaulted
Constructor.
~ContactPhaseList() defaulted
Destructor.
ContactPhaseList(const ContactPhaseList& other)
Copy constructor.
ContactPhaseList(ContactPhaseList&& other) defaulted
Move constructor.

Public functions

auto operator=(const ContactPhaseList& other) -> ContactPhaseList&
Copy assignment operator.
auto operator=(ContactPhaseList&& other) -> ContactPhaseList& defaulted
Move assignment operator.
void setLists(const ContactListMap& contactLists)
Set the input lists.
auto setLists(const std::initializer_list<ContactList>& contactLists) -> bool
Set the input lists.
auto getPresentPhase(const std::chrono::nanoseconds& time) const -> const_iterator
Get the phase given the time.
auto lists() const -> const ContactListMap&
A reference to the lists stored in this class.
auto begin() const -> const_iterator
Const iterator to the begin of the phases.
auto cbegin() const -> const_iterator
Const iterator to the begin of the phases.
auto rbegin() const -> const_reverse_iterator
Const reverse iterator to the the phases (basically starting from the last phase, going backward).
auto crbegin() const -> const_reverse_iterator
Const reverse iterator to the the phases (basically starting from the last phase, going backward).
auto end() const -> const_iterator
Return a const iterator to the end of the list.
auto cend() const -> const_iterator
Return a const iterator to the end of the list.
auto rend() const -> const_reverse_iterator
Return a const reverse iterator to the end of the list.
auto crend() const -> const_reverse_iterator
Return a const reverse iterator to the end of the list.
auto operator[](size_t index) const -> const ContactPhase&
Access phases by index.
auto firstPhase() const -> const_iterator
A const iterator to the first phase.
auto lastPhase() const -> const_iterator
A const iterator to the last phase.
auto size() const -> size_t
Get the number of phases.
void clear()
Clear the phases and the stored lists.
auto toString() const -> std::string
Convert the contact phase list to a string.
auto forceSampleTime(const std::chrono::nanoseconds& dt) -> bool
Force the sample time of the contact list stored in the contact phase list.

Function documentation

BipedalLocomotion::Contacts::ContactPhaseList::ContactPhaseList() defaulted

Constructor.

BipedalLocomotion::Contacts::ContactPhaseList::~ContactPhaseList() defaulted

Destructor.

BipedalLocomotion::Contacts::ContactPhaseList::ContactPhaseList(const ContactPhaseList& other)

Copy constructor.

Parameters
other another ContactPhaseList.

BipedalLocomotion::Contacts::ContactPhaseList::ContactPhaseList(ContactPhaseList&& other) defaulted

Move constructor.

Parameters
other another ContactPhaseList.

ContactPhaseList& BipedalLocomotion::Contacts::ContactPhaseList::operator=(const ContactPhaseList& other)

Copy assignment operator.

Parameters
other another ContactPhaseList.

ContactPhaseList& BipedalLocomotion::Contacts::ContactPhaseList::operator=(ContactPhaseList&& other) defaulted

Move assignment operator.

Parameters
other another ContactPhaseList.

void BipedalLocomotion::Contacts::ContactPhaseList::setLists(const ContactListMap& contactLists)

Set the input lists.

Parameters
contactLists The set of lists to be used for computing the phases.

bool BipedalLocomotion::Contacts::ContactPhaseList::setLists(const std::initializer_list<ContactList>& contactLists)

Set the input lists.

Returns False if some lists have the same defaultName.

const_iterator BipedalLocomotion::Contacts::ContactPhaseList::getPresentPhase(const std::chrono::nanoseconds& time) const

Get the phase given the time.

Parameters
time The present time.
Returns an iterator to the last phase having an activation time lower than time. If no phase satisfies this condition, it returns a pointer to the end.

It returns the contact phase with the highest begin time lower than time. If no contacts phase has a begin time lower than time, it returns an iterator to the end.

const ContactListMap& BipedalLocomotion::Contacts::ContactPhaseList::lists() const

A reference to the lists stored in this class.

Returns A const reference to the input lists.

const_iterator BipedalLocomotion::Contacts::ContactPhaseList::end() const

Return a const iterator to the end of the list.

This is only a placeholder, it does not reference any phase.

const_iterator BipedalLocomotion::Contacts::ContactPhaseList::cend() const

Return a const iterator to the end of the list.

This is only a placeholder, it does not reference any phase.

const_reverse_iterator BipedalLocomotion::Contacts::ContactPhaseList::rend() const

Return a const reverse iterator to the end of the list.

This is only a placeholder, it does not reference any phase.

const_reverse_iterator BipedalLocomotion::Contacts::ContactPhaseList::crend() const

Return a const reverse iterator to the end of the list.

This is only a placeholder, it does not reference any phase.

const ContactPhase& BipedalLocomotion::Contacts::ContactPhaseList::operator[](size_t index) const

Access phases by index.

Parameters
index of the phase to be accessed.
Returns A const reference to the desired phase.

std::string BipedalLocomotion::Contacts::ContactPhaseList::toString() const

Convert the contact phase list to a string.

Returns A string containing the information of the contact phase list.

bool BipedalLocomotion::Contacts::ContactPhaseList::forceSampleTime(const std::chrono::nanoseconds& dt)

Force the sample time of the contact list stored in the contact phase list.

Parameters
dt The new sample time.
Returns true if the contact lists has been correctly resampled.