From 87082995be3c64767da4d96e2a3cea354835177d Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Thu, 1 Feb 2024 22:08:58 +0000 Subject: [PATCH] Add test for initial value of GPIO state interfaces --- hardware_interface/test/test_component_parser.cpp | 1 + .../include/ros2_control_test_assets/components_urdfs.hpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hardware_interface/test/test_component_parser.cpp b/hardware_interface/test/test_component_parser.cpp index f67f91308d..968d41ed97 100644 --- a/hardware_interface/test/test_component_parser.cpp +++ b/hardware_interface/test/test_component_parser.cpp @@ -564,6 +564,7 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_robot_with_gpio EXPECT_THAT(hardware_info.gpios[1].state_interfaces, SizeIs(1)); EXPECT_THAT(hardware_info.gpios[1].command_interfaces, SizeIs(1)); EXPECT_EQ(hardware_info.gpios[1].state_interfaces[0].name, "vacuum"); + EXPECT_EQ(hardware_info.gpios[1].state_interfaces[0].initial_value, "1.0"); EXPECT_EQ(hardware_info.gpios[1].command_interfaces[0].name, "vacuum"); EXPECT_THAT(hardware_info.transmissions, IsEmpty()); diff --git a/ros2_control_test_assets/include/ros2_control_test_assets/components_urdfs.hpp b/ros2_control_test_assets/include/ros2_control_test_assets/components_urdfs.hpp index a42d39a241..7b2dd46e7a 100644 --- a/ros2_control_test_assets/include/ros2_control_test_assets/components_urdfs.hpp +++ b/ros2_control_test_assets/include/ros2_control_test_assets/components_urdfs.hpp @@ -372,7 +372,9 @@ const auto valid_urdf_ros2_control_system_robot_with_gpio = - + + 1.0 + )";