From e8fa1311b25e28bf6fa42e144131e3fa1b9aa890 Mon Sep 17 00:00:00 2001 From: Manuel Muth Date: Mon, 19 Aug 2024 09:31:30 +0200 Subject: [PATCH] add interface_name to InterfaceDescription Co-authored-by: Sai Kishor Kothakota --- .../include/hardware_interface/hardware_info.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hardware_interface/include/hardware_interface/hardware_info.hpp b/hardware_interface/include/hardware_interface/hardware_info.hpp index bf14f24041..b4e47c610e 100644 --- a/hardware_interface/include/hardware_interface/hardware_info.hpp +++ b/hardware_interface/include/hardware_interface/hardware_info.hpp @@ -133,7 +133,9 @@ struct TransmissionInfo struct InterfaceDescription { InterfaceDescription(const std::string & prefix_name_in, const InterfaceInfo & interface_info_in) - : prefix_name(prefix_name_in), interface_info(interface_info_in) + : prefix_name(prefix_name_in), + interface_info(interface_info_in), + interface_name(prefix_name + "/" + interface_info.name) { } @@ -147,9 +149,16 @@ struct InterfaceDescription */ InterfaceInfo interface_info; - std::string get_name() const { return prefix_name + "/" + interface_info.name; } + /** + * Name of the interface + */ + std::string interface_name; + + std::string get_prefix_name() const { return prefix_name; } + + std::string get_interface_name() const { return interface_info.name; } - std::string get_interface_type() const { return interface_info.name; } + std::string get_name() const { return interface_name; } }; /// This structure stores information about hardware defined in a robot's URDF.