iDynTree::LinkUnknownWrenchContacts class

A set of UnknownWrenchContact for each link, representing all the contacts between the model and the external environment whose wrench is unkwnon.

Constructors, destructors, conversion operators

LinkUnknownWrenchContacts(unsigned int nrOfLinks = 0)
Create a LinkWrenches vector, with the size given by nrOfLinks .
LinkUnknownWrenchContacts(const Model& model)

Public functions

void clear()
Preserving the number of links, remove all the previously added unknowns.
void resize(unsigned int nrOfLinks)
void resize(const Model& model)
auto getNrOfContactsForLink(const LinkIndex linkIndex) const -> size_t
Get the number of external contacts for a given link.
void setNrOfContactsForLink(const LinkIndex linkIndex, const size_t nrOfContacts)
Set the number of external contacts for a given link.
void addNewContactForLink(const LinkIndex linkIndex, const UnknownWrenchContact& newContact)
Add a new contact for a link.
auto addNewContactInFrame(const Model& model, const FrameIndex frameIndex, const UnknownWrenchContact& newContact) -> bool
Add a new contact for a frame.
auto addNewUnknownFullWrenchInFrameOrigin(const Model& model, const FrameIndex frameIndex) -> bool
Add a full wrench unknown at the origin of the specified frame.
auto contactWrench(const LinkIndex linkIndex, const size_t contactIndex) -> UnknownWrenchContact&
Get a specific ContactWrench.
auto contactWrench(const LinkIndex linkIndex, const size_t contactIndex) const -> const UnknownWrenchContact&
auto toString(const Model& model) const -> std::string
Get a human readable description of the LinkUnknownWrenchContacts (for debug)

Function documentation

iDynTree::LinkUnknownWrenchContacts::LinkUnknownWrenchContacts(unsigned int nrOfLinks = 0)

Create a LinkWrenches vector, with the size given by nrOfLinks .

Parameters
nrOfLinks in the size of the vector.

void iDynTree::LinkUnknownWrenchContacts::resize(unsigned int nrOfLinks)

Parameters
nrOfLinks in the number of links used to resize

bool iDynTree::LinkUnknownWrenchContacts::addNewContactInFrame(const Model& model, const FrameIndex frameIndex, const UnknownWrenchContact& newContact)

Add a new contact for a frame.

Parameters
model in the model class for getting frame information.
frameIndex in the index of the frame in which you are expressing the new unknown wrench.
newContact in the new unknown wrench to add.
Returns true if all went well, false otherwise

If the specified frame is not the a link frame, the method automatically convert the unknown wrench to the relative link frame.

bool iDynTree::LinkUnknownWrenchContacts::addNewUnknownFullWrenchInFrameOrigin(const Model& model, const FrameIndex frameIndex)

Add a full wrench unknown at the origin of the specified frame.

Parameters
model in the model class for getting frame information.
frameIndex in the index of the frame in which you are expressing the new unknown wrench.
Returns true if all went well, false otherwise

Simplified version of a addNewContactInFrame, in which the contact point is the origin of the frame and the unknown type is FULL_WRENCH.

Equivalent to addNewContactInFrame(model,frame,UnknownWrenchContact(FULL_WRENCH,Position::Zero()))

UnknownWrenchContact& iDynTree::LinkUnknownWrenchContacts::contactWrench(const LinkIndex linkIndex, const size_t contactIndex)

Get a specific ContactWrench.

Parameters
linkIndex in the index of the link for which the contact is retrieved
contactIndex in a index (between 0 and getNrOfContactsForLink(link)-1 ) identifing the specific contact.