15#ifndef SEMANTIC_COMPONENTS__SEMANTIC_COMPONENT_COMMAND_INTERFACE_HPP_
16#define SEMANTIC_COMPONENTS__SEMANTIC_COMPONENT_COMMAND_INTERFACE_HPP_
23#include "controller_interface/helpers.hpp"
24#include "hardware_interface/loaned_command_interface.hpp"
26namespace semantic_components
28template <
typename MessageInputType>
33 const std::string & name,
const std::vector<std::string> & interface_names)
34 : name_(name), interface_names_(interface_names)
36 assert(interface_names.size() > 0);
37 command_interfaces_.reserve(interface_names.size());
50 std::vector<hardware_interface::LoanedCommandInterface> & command_interfaces)
52 return controller_interface::get_ordered_interfaces(
53 command_interfaces, interface_names_,
"", command_interfaces_);
82 if (values.size() != command_interfaces_.size())
88 for (
auto i = 0u; i < values.size(); ++i)
90 all_set &= command_interfaces_[i].get().set_value(values[i]);
104 std::vector<std::string> interface_names_;
105 std::vector<std::reference_wrapper<hardware_interface::LoanedCommandInterface>>
Definition semantic_component_command_interface.hpp:30
const std::vector< std::string > & get_command_interface_names() const
Definition of command interface names for the component.
Definition semantic_component_command_interface.hpp:71
bool set_values(const std::vector< double > &values)
Return all values.
Definition semantic_component_command_interface.hpp:79
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:59
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:49