15#ifndef SEMANTIC_COMPONENTS__SEMANTIC_COMPONENT_COMMAND_INTERFACE_HPP_
16#define SEMANTIC_COMPONENTS__SEMANTIC_COMPONENT_COMMAND_INTERFACE_HPP_
21#include "controller_interface/helpers.hpp"
22#include "hardware_interface/loaned_command_interface.hpp"
24namespace semantic_components
26template <
typename MessageInputType>
31 const std::string & name,
const std::vector<std::string> & interface_names)
32 : name_(name), interface_names_(interface_names)
34 assert(interface_names.size() > 0);
35 command_interfaces_.reserve(interface_names.size());
47 std::vector<hardware_interface::LoanedCommandInterface> & command_interfaces)
49 return controller_interface::get_ordered_interfaces(
50 command_interfaces, interface_names_,
"", command_interfaces_);
75 if (values.size() != command_interfaces_.size())
81 for (
auto i = 0u; i < values.size(); ++i)
83 all_set &= command_interfaces_[i].get().set_value(values[i]);
96 std::vector<std::string> interface_names_;
97 std::vector<std::reference_wrapper<hardware_interface::LoanedCommandInterface>>
Definition semantic_component_command_interface.hpp:28
const std::vector< std::string > & get_command_interface_names() const
Definition of command interface names for the component.
Definition semantic_component_command_interface.hpp:65
bool set_values(const std::vector< double > &values)
Return all values.
Definition semantic_component_command_interface.hpp:72
virtual bool set_values_from_message(const MessageInputType &)=0
Set values from MessageInputType.
void release_interfaces()
Release loaned command interfaces from the hardware.
Definition semantic_component_command_interface.hpp:54
bool assign_loaned_command_interfaces(std::vector< hardware_interface::LoanedCommandInterface > &command_interfaces)
Assign loaned command interfaces from the hardware.
Definition semantic_component_command_interface.hpp:46