diff --git a/hardware_interface/include/hardware_interface/components/joint.hpp b/hardware_interface/include/hardware_interface/components/joint.hpp index 64ede0a2bc..0101afa6f0 100644 --- a/hardware_interface/include/hardware_interface/components/joint.hpp +++ b/hardware_interface/include/hardware_interface/components/joint.hpp @@ -50,6 +50,7 @@ class Joint * return_type::ERROR otherwise. */ HARDWARE_INTERFACE_PUBLIC + virtual return_type configure(const ComponentInfo & joint_info); /** @@ -58,6 +59,7 @@ class Joint * \return string list with command interfaces. */ HARDWARE_INTERFACE_PUBLIC + virtual std::vector get_command_interfaces() const; /** @@ -66,6 +68,7 @@ class Joint * \return string list with state interfaces. */ HARDWARE_INTERFACE_PUBLIC + virtual std::vector get_state_interfaces() const; /** @@ -82,9 +85,9 @@ class Joint * is empty; return_type::OK otherwise. */ HARDWARE_INTERFACE_EXPORT + virtual return_type get_command( - std::vector & command, - const std::vector & interfaces) const; + std::vector & command, const std::vector & interfaces) const; /** * \brief Get complete command list for the joint. This function is used by the hardware to get @@ -95,6 +98,7 @@ class Joint * \return return_type::OK always. */ HARDWARE_INTERFACE_EXPORT + virtual return_type get_command(std::vector & command) const; /** @@ -114,9 +118,9 @@ class Joint * (see: https://github.com/ros-controls/ros2_control/issues/129) */ HARDWARE_INTERFACE_EXPORT + virtual return_type set_command( - const std::vector & command, - const std::vector & interfaces); + const std::vector & command, const std::vector & interfaces); /** * \brief Get complete state list from the joint. This function is used by the hardware to get @@ -129,6 +133,7 @@ class Joint * of limits; return_type::OK otherwise. */ HARDWARE_INTERFACE_EXPORT + virtual return_type set_command(const std::vector & command); /** @@ -144,6 +149,7 @@ class Joint * is empty; return_type::OK otherwise. */ HARDWARE_INTERFACE_EXPORT + virtual return_type get_state( std::vector & state, const std::vector & interfaces) const; @@ -157,6 +163,7 @@ class Joint * \return return_type::OK always. */ HARDWARE_INTERFACE_EXPORT + virtual return_type get_state(std::vector & state) const; /** @@ -171,9 +178,9 @@ class Joint * defined for the joint; return_type::OK otherwise. */ HARDWARE_INTERFACE_EXPORT + virtual return_type set_state( - const std::vector & state, - const std::vector & interfaces); + const std::vector & state, const std::vector & interfaces); /** * \brief Set complete state list from the joint.This function is used by the hardware to set its @@ -185,6 +192,7 @@ class Joint * joint's state interfaces, return_type::OK otherwise. */ HARDWARE_INTERFACE_EXPORT + virtual return_type set_state(const std::vector & state); protected: diff --git a/hardware_interface/include/hardware_interface/components/sensor.hpp b/hardware_interface/include/hardware_interface/components/sensor.hpp index a99c85eec9..b44fb12718 100644 --- a/hardware_interface/include/hardware_interface/components/sensor.hpp +++ b/hardware_interface/include/hardware_interface/components/sensor.hpp @@ -50,6 +50,7 @@ class Sensor * return_type::ERROR otherwise. */ HARDWARE_INTERFACE_PUBLIC + virtual return_type configure(const ComponentInfo & joint_info); /** @@ -58,7 +59,8 @@ class Sensor * \return string list with state interfaces. */ HARDWARE_INTERFACE_PUBLIC - std::vector get_state_interfaces(); + virtual + std::vector get_state_interfaces() const; /** * \brief Get state list from the sensor. This function is used by the controller to get the @@ -73,9 +75,9 @@ class Sensor * is empty; return_type::OK otherwise. */ HARDWARE_INTERFACE_EXPORT + virtual return_type get_state( - std::vector & state, - const std::vector & interfaces) const; + std::vector & state, const std::vector & interfaces) const; /** * \brief Get complete state list from the sensor. This function is used by the controller to get @@ -86,6 +88,7 @@ class Sensor * \return return_type::OK always. */ HARDWARE_INTERFACE_EXPORT + virtual return_type get_state(std::vector & state) const; /** @@ -100,9 +103,9 @@ class Sensor * defined for the sensor; return_type::OK otherwise. */ HARDWARE_INTERFACE_EXPORT + virtual return_type set_state( - const std::vector & state, - const std::vector & interfaces); + const std::vector & state, const std::vector & interfaces); /** * \brief Set complete state list from the sensor.This function is used by the hardware to set its @@ -114,6 +117,7 @@ class Sensor * sensor's state interfaces, return_type::OK otherwise. */ HARDWARE_INTERFACE_EXPORT + virtual return_type set_state(const std::vector & state); protected: diff --git a/hardware_interface/src/components/joint.cpp b/hardware_interface/src/components/joint.cpp index badd4d3e9a..8aaa0c661d 100644 --- a/hardware_interface/src/components/joint.cpp +++ b/hardware_interface/src/components/joint.cpp @@ -16,7 +16,6 @@ #include #include "hardware_interface/components/joint.hpp" - #include "hardware_interface/components/component_info.hpp" #include "hardware_interface/types/hardware_interface_return_values.hpp" @@ -61,8 +60,7 @@ return_type Joint::get_command(std::vector & command) const } return_type Joint::set_command( - const std::vector & command, - const std::vector & interfaces) + const std::vector & command, const std::vector & interfaces) { return set_internal_values(command, interfaces, info_.command_interfaces, commands_); } diff --git a/hardware_interface/src/components/sensor.cpp b/hardware_interface/src/components/sensor.cpp index 0229e8b14f..397bee648d 100644 --- a/hardware_interface/src/components/sensor.cpp +++ b/hardware_interface/src/components/sensor.cpp @@ -16,7 +16,6 @@ #include #include "hardware_interface/components/sensor.hpp" - #include "hardware_interface/components/component_info.hpp" #include "hardware_interface/types/hardware_interface_return_values.hpp" @@ -36,7 +35,7 @@ return_type Sensor::configure(const ComponentInfo & joint_info) return return_type::OK; } -std::vector Sensor::get_state_interfaces() +std::vector Sensor::get_state_interfaces() const { return info_.state_interfaces; }