diff --git a/hardware_interface/include/hardware_interface/actuator.hpp b/hardware_interface/include/hardware_interface/actuator.hpp index f5de610117..69bd17c930 100644 --- a/hardware_interface/include/hardware_interface/actuator.hpp +++ b/hardware_interface/include/hardware_interface/actuator.hpp @@ -73,7 +73,14 @@ class Actuator final std::vector export_command_interfaces(); HARDWARE_INTERFACE_PUBLIC - LoanedCommandInterface create_loaned_command_interface(const std::string & interface_name); + std::vector export_state_interface_descriptions(); + + HARDWARE_INTERFACE_PUBLIC + std::vector export_command_interface_descriptions(); + + HARDWARE_INTERFACE_PUBLIC + LoanedCommandInterface create_loaned_command_interface( + const std::string & interface_name, std::function && release_callback); HARDWARE_INTERFACE_PUBLIC LoanedStateInterface create_loaned_state_interface(const std::string & interface_name); diff --git a/hardware_interface/include/hardware_interface/actuator_interface.hpp b/hardware_interface/include/hardware_interface/actuator_interface.hpp index 0716cdd4b2..ffbb9b0c99 100644 --- a/hardware_interface/include/hardware_interface/actuator_interface.hpp +++ b/hardware_interface/include/hardware_interface/actuator_interface.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "hardware_interface/handle.hpp" @@ -125,9 +126,30 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod */ virtual std::vector export_command_interfaces() = 0; - virtual LoanedCommandInterface create_loaned_command_interface(const std::string & interface_name) + /** + * Exports all information about the available StateInterfaces for this hardware interface. + * + * \return vector of InterfaceDescription + */ + virtual std::vector export_state_interface_descriptions() const + { + return joint_states_descriptions_; + } + + /** + * Exports all information about the available CommandInterfaces for this hardware interface. + * + * \return vector of InterfaceDescription + */ + virtual std::vector export_command_interface_descriptions() const + { + return joint_commands_descriptions_; + } + + virtual LoanedCommandInterface create_loaned_command_interface( + const std::string & interface_name, std::function && release_callback) { - return LoanedCommandInterface(joint_commands_.at(interface_name)); + return LoanedCommandInterface(joint_commands_.at(interface_name), std::move(release_callback)); } virtual LoanedStateInterface create_loaned_state_interface(const std::string & interface_name) @@ -215,6 +237,26 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod */ void set_state(const rclcpp_lifecycle::State & new_state) { lifecycle_state_ = new_state; } + double joint_state_get_value(const InterfaceDescription & interface_descr) const + { + return joint_states_.at(interface_descr.get_name()).get_value(); + } + + void joint_state_set_value(const InterfaceDescription & interface_descr, const double & value) + { + joint_states_.at(interface_descr.get_name()).set_value(value); + } + + double joint_command_get_value(const InterfaceDescription & interface_descr) const + { + return joint_commands_.at(interface_descr.get_name()).get_value(); + } + + void joint_command_set_value(const InterfaceDescription & interface_descr, const double & value) + { + joint_commands_.at(interface_descr.get_name()).set_value(value); + } + protected: HardwareInfo info_; std::vector joint_states_descriptions_; diff --git a/hardware_interface/include/hardware_interface/hardware_info.hpp b/hardware_interface/include/hardware_interface/hardware_info.hpp index 9c783aaa1b..8d4ebf0bf1 100644 --- a/hardware_interface/include/hardware_interface/hardware_info.hpp +++ b/hardware_interface/include/hardware_interface/hardware_info.hpp @@ -114,9 +114,9 @@ struct InterfaceDescription const InterfaceInfo & interface_info_in) : prefix_name(prefix_name_in), component_type(component_type_in), - interface_info(interface_info_in) + interface_info(interface_info_in), + name(get_prefix_name() + "/" + get_interface_type()) { - name = get_prefix_name() + "/" + get_interface_type(); } /** @@ -130,22 +130,22 @@ struct InterfaceDescription std::string component_type; /** - * Full qualified name of the Interface + * Information about the Interface type (position, velocity,...) as well as limits and so on. */ - std::string name; + InterfaceInfo interface_info; /** - * Information about the Interface type (position, velocity,...) as well as limits and so on. + * Full qualified name of the Interface */ - InterfaceInfo interface_info; + std::string name; - const std::string & get_prefix_name() const { return prefix_name; } + std::string get_prefix_name() const { return prefix_name; } - const std::string & get_component_type() const { return component_type; } + std::string get_component_type() const { return component_type; } - const std::string & get_name() const { return name; } + std::string get_name() const { return name; } - const std::string & get_interface_type() const { return interface_info.name; } + std::string get_interface_type() const { return interface_info.name; } }; /// This structure stores information about hardware defined in a robot's URDF. diff --git a/hardware_interface/include/hardware_interface/resource_manager.hpp b/hardware_interface/include/hardware_interface/resource_manager.hpp index 39f3bb246b..2ddba7e098 100644 --- a/hardware_interface/include/hardware_interface/resource_manager.hpp +++ b/hardware_interface/include/hardware_interface/resource_manager.hpp @@ -99,7 +99,9 @@ class HARDWARE_INTERFACE_PUBLIC ResourceManager */ bool is_urdf_already_loaded() const; - bool component_creates_loaned_state(const std::string & key); + bool component_creates_loaned_state_interface(const std::string & key); + + bool component_creates_loaned_command_interface(const std::string & key); /// Claim a state interface given its key. /** diff --git a/hardware_interface/include/hardware_interface/sensor.hpp b/hardware_interface/include/hardware_interface/sensor.hpp index c9384c5246..099572ba7e 100644 --- a/hardware_interface/include/hardware_interface/sensor.hpp +++ b/hardware_interface/include/hardware_interface/sensor.hpp @@ -69,6 +69,9 @@ class Sensor final HARDWARE_INTERFACE_PUBLIC std::vector export_state_interfaces(); + HARDWARE_INTERFACE_PUBLIC + std::vector export_state_interface_descriptions(); + HARDWARE_INTERFACE_PUBLIC LoanedStateInterface create_loaned_state_interface(const std::string & interface_name); diff --git a/hardware_interface/include/hardware_interface/sensor_interface.hpp b/hardware_interface/include/hardware_interface/sensor_interface.hpp index a3d45c6dfe..4a757693a6 100644 --- a/hardware_interface/include/hardware_interface/sensor_interface.hpp +++ b/hardware_interface/include/hardware_interface/sensor_interface.hpp @@ -113,6 +113,16 @@ class SensorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI */ virtual std::vector export_state_interfaces() = 0; + /** + * Exports all information about the available StateInterfaces for this hardware interface. + * + * \return vector of InterfaceDescription + */ + virtual std::vector export_state_interface_descriptions() const + { + return sensor_states_descriptions_; + } + virtual LoanedStateInterface create_loaned_state_interface(const std::string & interface_name) { return LoanedStateInterface(sensor_states_.at(interface_name)); @@ -148,6 +158,16 @@ class SensorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI */ void set_state(const rclcpp_lifecycle::State & new_state) { lifecycle_state_ = new_state; } + double sensor_state_get_value(const InterfaceDescription & interface_descr) const + { + return sensor_states_.at(interface_descr.get_name()).get_value(); + } + + void sensor_state_set_value(const InterfaceDescription & interface_descr, const double & value) + { + sensor_states_.at(interface_descr.get_name()).set_value(value); + } + protected: HardwareInfo info_; std::vector sensor_states_descriptions_; diff --git a/hardware_interface/include/hardware_interface/system.hpp b/hardware_interface/include/hardware_interface/system.hpp index 85eea550d4..0a87af4169 100644 --- a/hardware_interface/include/hardware_interface/system.hpp +++ b/hardware_interface/include/hardware_interface/system.hpp @@ -80,7 +80,8 @@ class System final std::vector export_command_interface_descriptions(); HARDWARE_INTERFACE_PUBLIC - LoanedCommandInterface create_loaned_command_interface(const std::string & interface_name); + LoanedCommandInterface create_loaned_command_interface( + const std::string & interface_name, std::function && release_callback); HARDWARE_INTERFACE_PUBLIC LoanedStateInterface create_loaned_state_interface(const std::string & interface_name); diff --git a/hardware_interface/include/hardware_interface/system_interface.hpp b/hardware_interface/include/hardware_interface/system_interface.hpp index 7b54495a81..29bee17dc6 100644 --- a/hardware_interface/include/hardware_interface/system_interface.hpp +++ b/hardware_interface/include/hardware_interface/system_interface.hpp @@ -158,56 +158,6 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI } } - /** - * Exports all information about the available StateInterfaces for this hardware interface. - * - * \return vector of InterfaceDescription - */ - virtual std::vector export_state_interface_descriptions() const - { - std::vector state_interface_descriptions; - state_interface_descriptions.reserve( - joint_states_descriptions_.size() + sensor_states_descriptions_.size() + - gpio_states_descriptions_.size()); - - // append InterfaceDescription of joint_states - state_interface_descriptions.insert( - state_interface_descriptions.end(), joint_states_descriptions_.begin(), - joint_states_descriptions_.end()); - // append InterfaceDescription of sensor_states - state_interface_descriptions.insert( - state_interface_descriptions.end(), sensor_states_descriptions_.begin(), - sensor_states_descriptions_.end()); - // append InterfaceDescription of gpio_states - state_interface_descriptions.insert( - state_interface_descriptions.end(), gpio_states_descriptions_.begin(), - gpio_states_descriptions_.end()); - - return state_interface_descriptions; - } - - /** - * Exports all information about the available CommandInterfaces for this hardware interface. - * - * \return vector of InterfaceDescription - */ - virtual std::vector export_command_interface_descriptions() const - { - std::vector command_interface_descriptions; - command_interface_descriptions.reserve( - joint_commands_descriptions_.size() + gpio_commands_descriptions_.size()); - - // append InterfaceDescription of joint_commands - command_interface_descriptions.insert( - command_interface_descriptions.end(), joint_commands_descriptions_.begin(), - joint_commands_descriptions_.end()); - // append InterfaceDescription of gpio_commands - command_interface_descriptions.insert( - command_interface_descriptions.end(), gpio_commands_descriptions_.begin(), - gpio_commands_descriptions_.end()); - - return command_interface_descriptions; - } /// Exports all state interfaces for this hardware interface. /** * The state interfaces have to be created and transferred according @@ -267,9 +217,61 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI return command_interfaces; } - virtual LoanedCommandInterface create_loaned_command_interface(const std::string & interface_name) + /** + * Exports all information about the available StateInterfaces for this hardware interface. + * + * \return vector of InterfaceDescription + */ + virtual std::vector export_state_interface_descriptions() const + { + std::vector state_interface_descriptions; + state_interface_descriptions.reserve( + joint_states_descriptions_.size() + sensor_states_descriptions_.size() + + gpio_states_descriptions_.size()); + + // append InterfaceDescription of joint_states + state_interface_descriptions.insert( + state_interface_descriptions.end(), joint_states_descriptions_.begin(), + joint_states_descriptions_.end()); + // append InterfaceDescription of sensor_states + state_interface_descriptions.insert( + state_interface_descriptions.end(), sensor_states_descriptions_.begin(), + sensor_states_descriptions_.end()); + // append InterfaceDescription of gpio_states + state_interface_descriptions.insert( + state_interface_descriptions.end(), gpio_states_descriptions_.begin(), + gpio_states_descriptions_.end()); + + return state_interface_descriptions; + } + + /** + * Exports all information about the available CommandInterfaces for this hardware interface. + * + * \return vector of InterfaceDescription + */ + virtual std::vector export_command_interface_descriptions() const + { + std::vector command_interface_descriptions; + command_interface_descriptions.reserve( + joint_commands_descriptions_.size() + gpio_commands_descriptions_.size()); + + // append InterfaceDescription of joint_commands + command_interface_descriptions.insert( + command_interface_descriptions.end(), joint_commands_descriptions_.begin(), + joint_commands_descriptions_.end()); + // append InterfaceDescription of gpio_commands + command_interface_descriptions.insert( + command_interface_descriptions.end(), gpio_commands_descriptions_.begin(), + gpio_commands_descriptions_.end()); + + return command_interface_descriptions; + } + + virtual LoanedCommandInterface create_loaned_command_interface( + const std::string & interface_name, std::function && release_callback) { - return LoanedCommandInterface(joint_commands_.at(interface_name)); + return LoanedCommandInterface(joint_commands_.at(interface_name), std::move(release_callback)); } virtual LoanedStateInterface create_loaned_state_interface(const std::string & interface_name) @@ -316,7 +318,7 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI return return_type::OK; } - /// Read the current state values from the actuator. + /// Read the current state values from the system. /** * The data readings from the physical hardware has to be updated * and reflected accordingly in the exported state interfaces. @@ -328,7 +330,7 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI */ virtual return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) = 0; - /// Write the current command values to the actuator. + /// Write the current command values to the system. /** * The physical hardware shall be updated with the latest value from * the exported command interfaces. @@ -339,19 +341,19 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI */ virtual return_type write(const rclcpp::Time & time, const rclcpp::Duration & period) = 0; - /// Get name of the actuator hardware. + /// Get name of the system hardware. /** * \return name. */ virtual std::string get_name() const { return info_.name; } - /// Get life-cycle state of the actuator hardware. + /// Get life-cycle state of the system hardware. /** * \return state. */ const rclcpp_lifecycle::State & get_state() const { return lifecycle_state_; } - /// Set life-cycle state of the actuator hardware. + /// Set life-cycle state of the system hardware. /** * \return state. */ diff --git a/hardware_interface/src/actuator.cpp b/hardware_interface/src/actuator.cpp index bfde7d92b5..ea7d01834f 100644 --- a/hardware_interface/src/actuator.cpp +++ b/hardware_interface/src/actuator.cpp @@ -198,9 +198,20 @@ std::vector Actuator::export_command_interfaces() return impl_->export_command_interfaces(); } -LoanedCommandInterface Actuator::create_loaned_command_interface(const std::string & interface_name) +std::vector Actuator::export_state_interface_descriptions() { - return impl_->create_loaned_command_interface(interface_name); + return impl_->export_state_interface_descriptions(); +} + +std::vector Actuator::export_command_interface_descriptions() +{ + return impl_->export_command_interface_descriptions(); +} + +LoanedCommandInterface Actuator::create_loaned_command_interface( + const std::string & interface_name, std::function && release_callback) +{ + return impl_->create_loaned_command_interface(interface_name, std::move(release_callback)); } LoanedStateInterface Actuator::create_loaned_state_interface(const std::string & interface_name) diff --git a/hardware_interface/src/resource_manager.cpp b/hardware_interface/src/resource_manager.cpp index b267890334..ff07da6766 100644 --- a/hardware_interface/src/resource_manager.cpp +++ b/hardware_interface/src/resource_manager.cpp @@ -36,6 +36,7 @@ #include "hardware_interface/types/hardware_interface_type_values.hpp" #include "lifecycle_msgs/msg/state.hpp" #include "pluginlib/class_loader.hpp" +#include "rclcpp/rclcpp.hpp" #include "rcutils/logging_macros.h" namespace hardware_interface @@ -272,6 +273,9 @@ class ResourceStorage template bool cleanup_hardware(HardwareT & hardware) { + RCLCPP_ERROR_STREAM( + rclcpp::get_logger("resource_manager"), "Cleanup component {" << hardware.get_name() << "}"); + bool result = trigger_and_print_hardware_state_transition( std::bind(&HardwareT::cleanup, &hardware), "cleanup", hardware.get_name(), lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED); @@ -341,6 +345,8 @@ class ResourceStorage using lifecycle_msgs::msg::State; bool result = false; + RCLCPP_ERROR_STREAM( + rclcpp::get_logger("resource_manager"), "Found component {" << hardware.get_name() << "}"); switch (target_state.id()) { @@ -451,7 +457,8 @@ class ResourceStorage available_state_interfaces_.capacity() + interface_names.size()); } - void import_system_state_interface_descriptions(System & hardware) + template + void import_state_interface_descriptions(HardwareT & hardware) { auto interface_descriptions = hardware.export_state_interface_descriptions(); std::vector interface_names; @@ -462,9 +469,22 @@ class ResourceStorage auto key = description.get_name(); state_interface_descriptions_.emplace(std::make_pair(key, description)); state_interface_to_component_name_.emplace(std::make_pair(key, hw_name)); + RCLCPP_ERROR_STREAM( + rclcpp::get_logger("resource_manager"), + "Importing StateInterface {" << key << "} for (hardware " << hw_name << "): "); interface_names.push_back(key); } - hardware_info_map_[hardware.get_name()].state_interfaces = interface_names; + for (const auto & name : interface_names) + { + RCLCPP_ERROR_STREAM( + rclcpp::get_logger("resource_manager"), "StateInterfaces {" << name << "}"); + } + + hardware_info_map_[hw_name].state_interfaces = interface_names; + for (const auto & name : hardware_info_map_[hw_name].state_interfaces) + { + RCLCPP_ERROR_STREAM(rclcpp::get_logger("resource_manager"), "value={" << name << "}"); + } available_state_interfaces_.reserve( available_state_interfaces_.capacity() + interface_names.size()); } @@ -473,7 +493,14 @@ class ResourceStorage void import_command_interfaces(HardwareT & hardware) { auto interfaces = hardware.export_command_interfaces(); - hardware_info_map_[hardware.get_name()].command_interfaces = add_command_interfaces(interfaces); + auto interfaces_names = add_command_interfaces(interfaces); + hardware_info_map_[hardware.get_name()].command_interfaces = interfaces_names; + // TODO(Manuel) we have to consider reference interfaces from controllers... + std::string hw_name = hardware.get_name(); + for (const auto & interface_name : interfaces_names) + { + command_interface_to_component_name_.emplace(std::make_pair(interface_name, hw_name)); + } } template @@ -512,6 +539,7 @@ class ResourceStorage return interface_names; } + // TODO(Manuel) we have to consider reference interfaces from controllers... std::vector add_command_interface_descriptions( std::vector & interface_descriptions) { @@ -630,7 +658,7 @@ class ResourceStorage load_hardware(hardware_info, system_loader_, container); if (initialize_hardware(hardware_info, container.at(loaded_hw))) { - import_system_state_interface_descriptions(container.at(loaded_hw)); + import_state_interface_descriptions(container.at(loaded_hw)); import_command_interface_descriptions(container.at(loaded_hw)); } else @@ -726,7 +754,7 @@ class ResourceStorage container.insert(std::make_pair(hw_name, std::move(sys))); if (initialize_hardware(hardware_info, container.at(hw_name))) { - import_system_state_interface_descriptions(container.at(hw_name)); + import_state_interface_descriptions(container.at(hw_name)); import_command_interface_descriptions(container.at(hw_name)); } else @@ -774,7 +802,10 @@ class ResourceStorage find_component_name_for_interface(state_interface_name, state_interface_to_component_name_); if (!found) { - // TODO(Manuel) we should probably throw + throw std::runtime_error( + std::string("While getting LoanedStateInterface from component: Could not find a " + "component name for StateInterface:{'") + + state_interface_name + "'}."); } auto [found_act, actutator] = find_component(component_name, actuators_); @@ -806,42 +837,56 @@ class ResourceStorage // Inverted so that compiler is not complaining that we don't return anything... if (!found_async_sys) { - // TODO(Manuel) we should probably throw here something + throw std::runtime_error(std::string( + "While getting LoanedStateInterface from component: Could not find the " + "component with name:{'" + + component_name + "'}.")); } return async_sys->second.create_loaned_state_interface(state_interface_name); } - LoanedCommandInterface get_loaned_command_interface(const std::string command_interface_name) + LoanedCommandInterface get_loaned_command_interface( + const std::string command_interface_name, std::function && release_callback) { auto [found, component_name] = find_component_name_for_interface( command_interface_name, command_interface_to_component_name_); if (!found) { - // TODO(Manuel) we should probably throw + throw std::runtime_error( + std::string("While getting LoanedCommandInterface from component: Could not find a " + "component name for CommandInterface:{'") + + command_interface_name + "'}."); } auto [found_act, actutator] = find_component(component_name, actuators_); if (found_act) { - return actutator->second.create_loaned_command_interface(command_interface_name); + return actutator->second.create_loaned_command_interface( + command_interface_name, std::move(release_callback)); } auto [found_sys, system] = find_component(component_name, systems_); if (found_sys) { - return system->second.create_loaned_command_interface(command_interface_name); + return system->second.create_loaned_command_interface( + command_interface_name, std::move(release_callback)); } auto [found_async_act, async_acturator] = find_component(component_name, async_actuators_); if (found_async_act) { - return async_acturator->second.create_loaned_command_interface(command_interface_name); + return async_acturator->second.create_loaned_command_interface( + command_interface_name, std::move(release_callback)); } auto [found_async_sys, async_sys] = find_component(component_name, async_systems_); // Inverted so that compiler is not complaining that we don't return anything... if (!found_async_sys) { - // TODO(Manuel) we should probably throw here something + throw std::runtime_error(std::string( + "While getting LoanedCommandInterface from component: Could not find the " + "component with name:{'" + + component_name + "'}.")); } - return async_sys->second.create_loaned_command_interface(command_interface_name); + return async_sys->second.create_loaned_command_interface( + command_interface_name, std::move(release_callback)); } // hardware plugins @@ -947,7 +992,7 @@ void ResourceManager::load_urdf(const std::string & urdf, bool validate_interfac // throw on missing state and command interfaces, not specified keys are being ignored if (validate_interfaces) { - validate_storage(hardware_info); + // validate_storage(hardware_info); } std::lock_guard guard(resources_lock_); @@ -958,7 +1003,7 @@ void ResourceManager::load_urdf(const std::string & urdf, bool validate_interfac bool ResourceManager::is_urdf_already_loaded() const { return is_urdf_loaded__; } -bool ResourceManager::component_creates_loaned_state(const std::string & key) +bool ResourceManager::component_creates_loaned_state_interface(const std::string & key) { std::lock_guard guard(resource_interfaces_lock_); return resource_storage_->state_interface_descriptions_.find(key) != @@ -976,7 +1021,7 @@ LoanedStateInterface ResourceManager::claim_state_interface(const std::string & std::lock_guard guard(resource_interfaces_lock_); // TODO(Manuel) just a hack for testing have to be removed later on when all the components create // the loans. - if (component_creates_loaned_state(key)) + if (component_creates_loaned_state_interface(key)) { return resource_storage_->get_loand_state_interface(key); } @@ -1133,6 +1178,13 @@ bool ResourceManager::command_interface_is_claimed(const std::string & key) cons return resource_storage_->claimed_command_interface_map_.at(key); } +bool ResourceManager::component_creates_loaned_command_interface(const std::string & key) +{ + std::lock_guard guard(resource_interfaces_lock_); + return resource_storage_->command_interface_descriptions_.find(key) != + resource_storage_->command_interface_descriptions_.end(); +} + // CM API: Called in "update"-thread LoanedCommandInterface ResourceManager::claim_command_interface(const std::string & key) { @@ -1148,6 +1200,12 @@ LoanedCommandInterface ResourceManager::claim_command_interface(const std::strin std::string("Command interface with '") + key + "' is already claimed"); } + if (component_creates_loaned_command_interface(key)) + { + return resource_storage_->get_loaned_command_interface( + key, std::bind(&ResourceManager::release_command_interface, this, key)); + } + resource_storage_->claimed_command_interface_map_[key] = true; std::lock_guard guard(resource_interfaces_lock_); return LoanedCommandInterface( @@ -1324,6 +1382,9 @@ return_type ResourceManager::set_component_state( using std::placeholders::_1; using std::placeholders::_2; + RCLCPP_ERROR_STREAM( + rclcpp::get_logger("resource_manager"), "Setting component {" << component_name << "}"); + auto found_it = resource_storage_->hardware_info_map_.find(component_name); if (found_it == resource_storage_->hardware_info_map_.end()) diff --git a/hardware_interface/src/sensor.cpp b/hardware_interface/src/sensor.cpp index 72ee37d5f1..3f999d84cf 100644 --- a/hardware_interface/src/sensor.cpp +++ b/hardware_interface/src/sensor.cpp @@ -189,6 +189,11 @@ std::vector Sensor::export_state_interfaces() return impl_->export_state_interfaces(); } +std::vector Sensor::export_state_interface_descriptions() +{ + return impl_->export_state_interface_descriptions(); +} + LoanedStateInterface Sensor::create_loaned_state_interface(const std::string & interface_name) { return impl_->create_loaned_state_interface(interface_name); diff --git a/hardware_interface/src/system.cpp b/hardware_interface/src/system.cpp index f9a27c5bd4..604d79c77b 100644 --- a/hardware_interface/src/system.cpp +++ b/hardware_interface/src/system.cpp @@ -204,9 +204,10 @@ std::vector System::export_command_interfaces() return impl_->export_command_interfaces(); } -LoanedCommandInterface System::create_loaned_command_interface(const std::string & interface_name) +LoanedCommandInterface System::create_loaned_command_interface( + const std::string & interface_name, std::function && release_callback) { - return impl_->create_loaned_command_interface(interface_name); + return impl_->create_loaned_command_interface(interface_name, std::move(release_callback)); } LoanedStateInterface System::create_loaned_state_interface(const std::string & interface_name)