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/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
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
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()));
}