From 8b186d525b99f8ec018e4c70c776d42d2bc4f30b Mon Sep 17 00:00:00 2001 From: Baris Yazici Date: Thu, 24 Aug 2023 11:17:52 +0200 Subject: [PATCH] fix: remove error response in write --- franka_hardware/src/franka_hardware_interface.cpp | 4 ---- .../test/franka_hardware_interface_test.cpp | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/franka_hardware/src/franka_hardware_interface.cpp b/franka_hardware/src/franka_hardware_interface.cpp index 58de2549..a052e6d7 100644 --- a/franka_hardware/src/franka_hardware_interface.cpp +++ b/franka_hardware/src/franka_hardware_interface.cpp @@ -106,10 +106,6 @@ hardware_interface::return_type FrankaHardwareInterface::write(const rclcpp::Tim } if (effort_interface_running_) { robot_->writeOnce(hw_commands_); - } else { - RCLCPP_FATAL(getLogger(), - "Effort interface is not running. Did you claim the command interface?"); - return hardware_interface::return_type::ERROR; } return hardware_interface::return_type::OK; } diff --git a/franka_hardware/test/franka_hardware_interface_test.cpp b/franka_hardware/test/franka_hardware_interface_test.cpp index fbe6c05e..17c167c8 100644 --- a/franka_hardware/test/franka_hardware_interface_test.cpp +++ b/franka_hardware/test/franka_hardware_interface_test.cpp @@ -439,21 +439,6 @@ TEST(FrankaHardwareInterfaceTest, hardware_interface::return_type::OK); } -TEST(FrankaHardwareInterfaceTest, - given_effort_interface_not_claimed_when_write_called_expect_error_response) { - auto mock_robot = std::make_shared(); - - franka_hardware::FrankaHardwareInterface franka_hardware_interface(mock_robot); - - const auto time = rclcpp::Time(0, 0); - const auto duration = rclcpp::Duration(0, 0); - - const auto hardware_info = createHardwareInfo(); - franka_hardware_interface.on_init(hardware_info); - EXPECT_EQ(franka_hardware_interface.write(time, duration), - hardware_interface::return_type::ERROR); -} - TEST(FrankaHardwareInterfaceTest, given_that_effort_control_started_perform_command_mode_switch_stop_expect_ok) { auto mock_robot = std::make_shared();