Template Function controller_interface::get_ordered_interfaces

Function Documentation

template<typename T>
bool controller_interface::get_ordered_interfaces(std::vector<T> &unordered_interfaces, const std::vector<std::string> &ordered_names, const std::string &interface_type, std::vector<std::reference_wrapper<T>> &ordered_interfaces)

Reorder interfaces with references according to joint names or full interface names.

Method to reorder and check if all expected interfaces are provided for the joint. Fill ordered_interfaces with references from unordered_interfaces in the same order as in ordered_names.

Parameters:
  • unordered_interfaces[in] vector with loaned unordered state or command interfaces.

  • ordered_names[in] vector with ordered names to order unordered_interfaces. The valued inputs are list of joint names or interface full names. If joint names are used for ordering, interface_type specifies valid interface. If full interface names are used for ordering, interface_type should be empty string (“”).

  • interface_type[in] used for ordering interfaces with respect to joint names.

  • ordered_interfaces[out] vector with ordered interfaces.

Returns:

true if all interfaces or joints in ordered_names are found, otherwise false.