diff --git a/hal_hw_interface/include/hal_hw_interface/hal_system_interface.hpp b/hal_hw_interface/include/hal_hw_interface/hal_system_interface.hpp index 93897a8..f6c29b5 100644 --- a/hal_hw_interface/include/hal_hw_interface/hal_system_interface.hpp +++ b/hal_hw_interface/include/hal_hw_interface/hal_system_interface.hpp @@ -45,7 +45,6 @@ #include #include "hardware_interface/handle.hpp" -#include "hardware_interface/base_interface.hpp" #include "hardware_interface/system_interface.hpp" #include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp" #include "rclcpp_lifecycle/state.hpp" @@ -100,16 +99,15 @@ namespace hal_system_interface * [1]: https://github.com/PickNikRobotics/ros_control_boilerplate */ -class HalSystemInterface : public hardware_interface::BaseInterface< - hardware_interface::SystemInterface> +class HalSystemInterface : public hardware_interface::SystemInterface { public: // Define aliases and static functions for using the Class with shared_ptrs RCLCPP_SHARED_PTR_DEFINITIONS(HalSystemInterface); HAL_HW_INTERFACE_PUBLIC - hardware_interface::return_type - configure(const hardware_interface::HardwareInfo& info) override; + CallbackReturn + on_init(const hardware_interface::HardwareInfo& info) override; HAL_HW_INTERFACE_PUBLIC std::vector @@ -130,10 +128,10 @@ class HalSystemInterface : public hardware_interface::BaseInterface< // const std::vector & /*stop_interfaces*/) override; HAL_HW_INTERFACE_PUBLIC - hardware_interface::return_type start() override; + CallbackReturn on_activate(); HAL_HW_INTERFACE_PUBLIC - hardware_interface::return_type stop() override; + CallbackReturn on_deactivate(); HAL_HW_INTERFACE_PUBLIC hardware_interface::return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) override; diff --git a/hal_hw_interface/src/hal_system_interface.cpp b/hal_hw_interface/src/hal_system_interface.cpp index aea8249..a6b45f4 100644 --- a/hal_hw_interface/src/hal_system_interface.cpp +++ b/hal_hw_interface/src/hal_system_interface.cpp @@ -108,12 +108,12 @@ void HalSystemInterface::init_state_interface(const std::string joint_name, .handle_storage = 0.0 }; } -hardware_interface::return_type -HalSystemInterface::configure(const hardware_interface::HardwareInfo& info) +CallbackReturn +HalSystemInterface::on_init(const hardware_interface::HardwareInfo& info) { - if (configure_default(info) != hardware_interface::return_type::OK) + if (hardware_interface::SystemInterface::on_init(info) != CallbackReturn::SUCCESS) { - return hardware_interface::return_type::ERROR; + return CallbackReturn::ERROR; } HAL_ROS_INFO_NAMED(LOG_NAME, "Initializing HAL hardware interface"); @@ -149,7 +149,7 @@ HalSystemInterface::configure(const hardware_interface::HardwareInfo& info) HAL_ROS_INFO_NAMED(LOG_NAME, "Initialized HAL pins"); - return hardware_interface::return_type::OK; + return CallbackReturn::SUCCESS; } // configure() std::vector @@ -190,16 +190,16 @@ hardware_interface::return_type HalSystemInterface::write([[maybe_unused]] const return hardware_interface::return_type::OK; } -hardware_interface::return_type HalSystemInterface::start() +CallbackReturn HalSystemInterface::on_activate() { HAL_ROS_INFO_NAMED(LOG_NAME, "Starting HAL system interface"); - return hardware_interface::return_type::OK; + return CallbackReturn::SUCCESS; } -hardware_interface::return_type HalSystemInterface::stop() +CallbackReturn HalSystemInterface::on_deactivate() { HAL_ROS_INFO_NAMED(LOG_NAME, "Stopping HAL system interface"); - return hardware_interface::return_type::OK; + return CallbackReturn::SUCCESS; } } // namespace hal_system_interface