From 11184b10dc013a4840df95277b1e6d1edd64432c Mon Sep 17 00:00:00 2001 From: Thibault Poignonec Date: Mon, 13 Jan 2025 12:28:12 +0100 Subject: [PATCH 1/3] fix test for jazzy --- test/test_modbus_hardware_interface.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/test_modbus_hardware_interface.cpp b/test/test_modbus_hardware_interface.cpp index 3ea6b86..0ec1803 100644 --- a/test/test_modbus_hardware_interface.cpp +++ b/test/test_modbus_hardware_interface.cpp @@ -16,6 +16,8 @@ #include +#include "rclcpp/rclcpp.hpp" + #include "hardware_interface/resource_manager.hpp" #include "ros2_control_test_assets/components_urdfs.hpp" #include "ros2_control_test_assets/descriptions.hpp" @@ -23,6 +25,10 @@ class TestModbusHardwareInterface : public ::testing::Test { protected: + static void SetUpTestCase() { rclcpp::init(0, nullptr); } + + static void TearDownTestCase() { rclcpp::shutdown(); } + void SetUp() override { // TODO(anyone): Extend this description to your robot @@ -66,11 +72,15 @@ class TestModbusHardwareInterface : public ::testing::Test )"; } std::string valid_modbus_hardware; + + rclcpp::Node::SharedPtr rm_node = std::make_shared("ResourceManager"); }; TEST_F(TestModbusHardwareInterface, load_modbus_hardware_interface_2dof) { auto urdf = ros2_control_test_assets::urdf_head + valid_modbus_hardware + ros2_control_test_assets::urdf_tail; - ASSERT_NO_THROW(hardware_interface::ResourceManager rm(urdf)); + + ASSERT_NO_THROW(hardware_interface::ResourceManager rm( + urdf, rm_node->get_node_clock_interface(), rm_node->get_node_logging_interface())); } From 226e82ba2e00115353fef848a3de3f7928307edd Mon Sep 17 00:00:00 2001 From: Thibault Poignonec Date: Mon, 13 Jan 2025 12:28:54 +0100 Subject: [PATCH 2/3] fix typo in README.md (pre-commit run --all) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37430f9..4f00ef2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Video explanation of its implemntation and how to use can be found [here](https://youtu.be/iEiZje8imeU?si=3jsBkv6SsXmHkQpW). +Video explanation of its implementation and how to use can be found [here](https://youtu.be/iEiZje8imeU?si=3jsBkv6SsXmHkQpW). # ModbusHardwareInterface If you not familiar with `ros2_control.xacro` check the [section at the end](#mini-urdf-and-xacro-introduction). ## Using ModbusHardwareInterface in ros2_control.xacro From 7196a6a6d9a37926c349520a5fb84b828587c3d5 Mon Sep 17 00:00:00 2001 From: Thibault Poignonec Date: Mon, 13 Jan 2025 12:29:31 +0100 Subject: [PATCH 3/3] add backward_ros for exception backtracing --- CMakeLists.txt | 1 + package.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38a1d9f..ec28e49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS # find dependencies find_package(ament_cmake REQUIRED) +find_package(backward_ros REQUIRED) foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS}) find_package(${Dependency} REQUIRED) endforeach() diff --git a/package.xml b/package.xml index e1aa75a..5f82b02 100644 --- a/package.xml +++ b/package.xml @@ -12,6 +12,7 @@ ament_cmake pkg-config + backward_ros hardware_interface libmodbus-dev pluginlib