diff --git a/actuators_rppico_hardware_interface/CMakeLists.txt b/actuators_rppico_hardware_interface/CMakeLists.txt index 7a0acdf..6d5fa8c 100644 --- a/actuators_rppico_hardware_interface/CMakeLists.txt +++ b/actuators_rppico_hardware_interface/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16) project(actuators_rppico_h_i LANGUAGES CXX) if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") - add_compile_options(-Wall -Wextra -Wno-unused-variable) + add_compile_options(-Wno-unused-variable) endif() # find dependencies diff --git a/actuators_rppico_hardware_interface/hardware/actuators_rppico_h_i.cpp b/actuators_rppico_hardware_interface/hardware/actuators_rppico_h_i.cpp index 4c108ac..2ba5e17 100644 --- a/actuators_rppico_hardware_interface/hardware/actuators_rppico_h_i.cpp +++ b/actuators_rppico_hardware_interface/hardware/actuators_rppico_h_i.cpp @@ -179,7 +179,11 @@ hardware_interface::CallbackReturn ActuatorsRpPicoHardware::on_deactivate( hardware_interface::return_type ActuatorsRpPicoHardware::read( const rclcpp::Time & /*time*/, const rclcpp::Duration & period) { - + if (!comms_.connected()) + { + return hardware_interface::return_type::ERROR; + } + return hardware_interface::return_type::OK; } diff --git a/actuators_rppico_hardware_interface/hardware/include/actuators_rppico_h_i/servo.hpp b/actuators_rppico_hardware_interface/hardware/include/actuators_rppico_h_i/servo.hpp index 9e24607..463cccf 100644 --- a/actuators_rppico_hardware_interface/hardware/include/actuators_rppico_h_i/servo.hpp +++ b/actuators_rppico_hardware_interface/hardware/include/actuators_rppico_h_i/servo.hpp @@ -16,13 +16,13 @@ class Servo Servo() = default; - Servo(const std::string &servo_name, int servo_number) + Servo(const std::string servo_name, int servo_number) { setup(servo_name, servo_number); } - void setup(const std::string &servo_name, int servo_number) + void setup(const std::string servo_name, int servo_number) { name = servo_name; this->servo_number = servo_number;