diff options
| author | CoprDistGit <infra@openeuler.org> | 2026-10-09 10:22:57 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2026-10-09 10:22:57 +0000 |
| commit | 0aeb30d4e27978ab39e7cd573874b064c4807ced (patch) | |
| tree | d9aa1315e4a80b8f24aab1e637ed8e09ae3cc05a /fix-humble-ros2-control-api.patch | |
| parent | 5811ef8dab6f7fe665d3d5d51efb9d38548e6577 (diff) | |
automatic import of ros-humble-picknik-reset-fault-controller
Diffstat (limited to 'fix-humble-ros2-control-api.patch')
| -rw-r--r-- | fix-humble-ros2-control-api.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/fix-humble-ros2-control-api.patch b/fix-humble-ros2-control-api.patch new file mode 100644 index 0000000..c1abded --- /dev/null +++ b/fix-humble-ros2-control-api.patch @@ -0,0 +1,46 @@ +--- a/picknik_reset_fault_controller/src/picknik_reset_fault_controller.cpp ++++ b/picknik_reset_fault_controller/src/picknik_reset_fault_controller.cpp +@@ -64,12 +64,8 @@ + { + if (realtime_publisher_) + { +- auto state_op = state_interfaces_[StateInterfaces::IN_FAULT].get_optional(); +- if (state_op.has_value()) +- { +- state_.data = static_cast<bool>(state_op.value()); +- } +- realtime_publisher_->try_publish(state_); ++ state_.data = static_cast<bool>(state_interfaces_[StateInterfaces::IN_FAULT].get_value()); ++ realtime_publisher_->tryPublish(state_); + } + + return controller_interface::return_type::OK; +@@ -124,23 +120,15 @@ + + RCLCPP_INFO(get_node()->get_logger(), "Trying to reset faults on hardware controller."); + +- while (command_interfaces_[CommandInterfaces::RESET_FAULT_ASYNC_SUCCESS].get_optional().value_or( +- ASYNC_WAITING) == ASYNC_WAITING) ++ while (command_interfaces_[CommandInterfaces::RESET_FAULT_ASYNC_SUCCESS].get_value() == ++ ASYNC_WAITING) + { + // Asynchronous wait until the hardware interface has set the io value + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + } +- auto async_result_op = +- command_interfaces_[CommandInterfaces::RESET_FAULT_ASYNC_SUCCESS].get_optional(); +- if (!async_result_op.has_value()) +- { +- RCLCPP_ERROR( +- get_node()->get_logger(), +- "Failed to get result of fault reset command from hardware controller."); +- resp->success = false; +- return resp->success; +- } +- resp->success = static_cast<bool>(async_result_op.value()); ++ double async_result = ++ command_interfaces_[CommandInterfaces::RESET_FAULT_ASYNC_SUCCESS].get_value(); ++ resp->success = static_cast<bool>(async_result); + + RCLCPP_INFO( + get_node()->get_logger(), "Resetting fault on hardware controller '%s'!", |
