Skip to content

Commit

Permalink
Add test for initial value of GPIO state interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Feb 15, 2024
1 parent a7cd009 commit 8708299
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions hardware_interface/test/test_component_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ const auto valid_urdf_ros2_control_system_robot_with_gpio =
</gpio>
<gpio name="flange_vacuum">
<command_interface name="vacuum"/>
<state_interface name="vacuum"/> <!-- Needed to know current state of the input -->
<state_interface name="vacuum"> <!-- Needed to know current state of the input -->
<param name="initial_value">1.0</param>
</state_interface>
</gpio>
</ros2_control>
)";
Expand Down

0 comments on commit 8708299

Please sign in to comment.