iDynTree::skinDynLibConversionsHelper class

Helper for conversion between iDynTree data structures and skinDynLib data structures.

There are several differences to handle:

  • In iDynTree, link and frames and identified by name and (in the context of an instantiated model) by their index, while in skinDynLib link are identified by the bodyPart, a numeric id representing a part of the robot the linkIndex, a progressive numeric id uniquely identifyng the link in the part.
  • The link frame of a link in iDynTree does not match the link frame assumed in skinDynLib. For this reason we need to specify an additional frame to specify the frame of the link used by skinDynLib, to properly convert the contact data back and forth.

Public functions

auto addSkinDynLibAlias(const Model& model, const std::string iDynTree_link_name, const std::string iDynTree_frame_name, const int skinDynLib_body_part, const int skinDynLib_link_index) -> bool
This function enables interoperability between the iDynTree library and the iCub skinDynLib library.
auto getSkinDynLibAlias(const Model& model, const std::string iDynTree_link_name, std::string& iDynTree_frame_name, int& skinDynLib_body_part, int& skinDynLib_link_index) const -> bool
Retrieve the skinDynLib alias of a link, added to the class using the addSkinDynLibAlias method.
auto getSkinDynLibAlias(const Model& model, const LinkIndex iDynTree_link_index, FrameIndex& iDynTree_frame_index, int& skinDynLib_body_part, int& skinDynLib_link_index) const -> bool
Retrieve the skinDynLib alias of a link, added to the class using the addSkinDynLibAlias method.
auto skinDynLib2iDynTree(const int skinDynLib_body_part, const int skinDynLib_link_index, LinkIndex& iDynTree_link_index, FrameIndex& iDynTree_frame_index) const -> bool
Convert a skinDynLib identifier to a iDynTree link/frame identifier.
auto removeSkinDynLibAlias(const Model& model, const std::string linkName) -> bool
Remove a alias in the form (body_part, link_index) for a link.
auto fromSkinDynLibToiDynTree(const Model& model, const iCub::skinDynLib::dynContactList& dynList, LinkUnknownWrenchContacts& unknowns) -> bool
Convert a dynContactList to a LinkUnknownWrenchContacts.
auto fromSkinDynLibToiDynTree(const Model& model, const iCub::skinDynLib::skinContactList& skinList, LinkUnknownWrenchContacts& unknowns) -> bool
Convert a skinContactList to a LinkUnknownWrenchContacts.
auto fromiDynTreeToSkinDynLib(const Model& model, const LinkContactWrenches& contactWrenches, iCub::skinDynLib::dynContactList& dynList) -> bool
Convert a LinkContactWrenches to a iCub::skinDynLib::dynContactList.
auto updateSkinContactListFromLinkContactWrenches(const Model& model, const LinkContactWrenches& contactWrenches, iCub::skinDynLib::skinContactList& skinContactListToUpdate) -> bool
Update an existing skinContactList in which some forces and torque are unknown using the estimated contact wrenches contained in a LinkContactWrenches.

Function documentation

bool iDynTree::skinDynLibConversionsHelper::addSkinDynLibAlias(const Model& model, const std::string iDynTree_link_name, const std::string iDynTree_frame_name, const int skinDynLib_body_part, const int skinDynLib_link_index)

This function enables interoperability between the iDynTree library and the iCub skinDynLib library.

This function can be used to assign a match between a skinDynLib link, and a iDynTree link.

In skinDynLib a link is represented by two numbers:

  • the bodyPart, a numeric id representing a part of the robot
  • the linkIndex, a progressive numeric id uniquely identifyng the link in the part We associate this to two iDynTree concept
  • the link_name of the considered link
  • the frame_name of the frame used by skinDynLib when dealing with that link. This frame can be the link frame, in this case frame_name == link_name, otherwise another frame can be used, under the constraint that this frame must be rigidly attached to the considered link.

bool iDynTree::skinDynLibConversionsHelper::fromSkinDynLibToiDynTree(const Model& model, const iCub::skinDynLib::dynContactList& dynList, LinkUnknownWrenchContacts& unknowns)

Convert a dynContactList to a LinkUnknownWrenchContacts.

The contactId contained in the dynContactList is preserved and saved in the appropriate attribute in the LinkUnknownWrenchContacts class.

bool iDynTree::skinDynLibConversionsHelper::fromSkinDynLibToiDynTree(const Model& model, const iCub::skinDynLib::skinContactList& skinList, LinkUnknownWrenchContacts& unknowns)

Convert a skinContactList to a LinkUnknownWrenchContacts.

The contactId contained in the skinContactList is preserved and saved in the appropriate attribute in the LinkUnknownWrenchContacts class.

bool iDynTree::skinDynLibConversionsHelper::fromiDynTreeToSkinDynLib(const Model& model, const LinkContactWrenches& contactWrenches, iCub::skinDynLib::dynContactList& dynList)

Convert a LinkContactWrenches to a iCub::skinDynLib::dynContactList.

This function creates a new dynContactList.

bool iDynTree::skinDynLibConversionsHelper::updateSkinContactListFromLinkContactWrenches(const Model& model, const LinkContactWrenches& contactWrenches, iCub::skinDynLib::skinContactList& skinContactListToUpdate)

Update an existing skinContactList in which some forces and torque are unknown using the estimated contact wrenches contained in a LinkContactWrenches.

The matching between the skinContactList and the LinkContactWrenches contacts is done through the contactId, that then should be consistent between the two functions.