Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic Creation of Handles in HW, Adding Getters/Setters (variant support) #1688

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a2dfd76
split hw related changes from #1240
mamueluth Aug 16, 2024
dc1d1d5
Merge branch 'master' into hardware_interfaces_getter_setter
mamueluth Aug 16, 2024
7bb89bc
add orderd vector of StateInterfaces and CommandInterfaces
mamueluth Aug 23, 2024
c073b31
Make compileable after splittin
mamueluth Aug 23, 2024
70c674c
Merge branch 'master' into hardware_interfaces_getter_setter
mamueluth Aug 23, 2024
7f24010
Merge branch 'master' into hardware_interfaces_getter_setter
mamueluth Aug 27, 2024
cc112c0
Merge branch 'master' into hardware_interfaces_getter_setter
mamueluth Aug 28, 2024
132a5e3
review suggestions
mamueluth Aug 28, 2024
0a61ac5
make compileable
mamueluth Aug 28, 2024
786d03c
Merge branch 'master' into hardware_interfaces_getter_setter
bmagyar Sep 12, 2024
569658e
Introduce type aliases for shared_ptr CommandInterface and StateInter…
bmagyar Sep 12, 2024
b1e490b
Remove old TODOs
bmagyar Sep 12, 2024
995db63
export_unlisted_state_interface_descriptions()
bmagyar Sep 16, 2024
6a5430f
export_unlisted_command_interface_descriptions()
bmagyar Sep 16, 2024
bec9c06
Fix _2() variants in docs
bmagyar Sep 16, 2024
a369f96
shorten comments
bmagyar Sep 16, 2024
4c63d28
Remove comments about renaming function
bmagyar Sep 16, 2024
50c7b9e
Apply suggestions from code review
bmagyar Sep 25, 2024
f2adeb1
redecorating
bmagyar Sep 25, 2024
334a6c4
refactor add interfaces
bmagyar Sep 25, 2024
9024adc
fix format
bmagyar Sep 25, 2024
ef1fa2c
Merge branch 'master' into hardware_interfaces_getter_setter
bmagyar Sep 25, 2024
7423f61
Update hardware_interface/src/resource_manager.cpp
bmagyar Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make compileable
  • Loading branch information
mamueluth committed Aug 28, 2024
commit 0a61ac52351216614b432bf5e9f8eb856aa617ec
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod
virtual void import_state_interface_descriptions(const HardwareInfo & hardware_info)
{
auto joint_state_interface_descriptions =
parse_state_interface_descriptions_from_hardware_info(hardware_info.joints);
parse_state_interface_descriptions(hardware_info.joints);
for (const auto & description : joint_state_interface_descriptions)
{
joint_state_interfaces_.insert(std::make_pair(description.get_name(), description));
Expand All @@ -149,7 +149,7 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod
virtual void import_command_interface_descriptions(const HardwareInfo & hardware_info)
{
auto joint_command_interface_descriptions =
parse_command_interface_descriptions_from_hardware_info(hardware_info.joints);
parse_command_interface_descriptions(hardware_info.joints);
for (const auto & description : joint_command_interface_descriptions)
{
joint_command_interfaces_.insert(std::make_pair(description.get_name(), description));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class SensorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
virtual void import_state_interface_descriptions(const HardwareInfo & hardware_info)
{
auto sensor_state_interface_descriptions =
parse_state_interface_descriptions_from_hardware_info(hardware_info.sensors);
parse_state_interface_descriptions(hardware_info.sensors);
for (const auto & description : sensor_state_interface_descriptions)
{
sensor_state_interfaces_.insert(std::make_pair(description.get_name(), description));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
void import_state_interface_descriptions(const HardwareInfo & hardware_info)
{
auto joint_state_interface_descriptions =
parse_state_interface_descriptions_from_hardware_info(hardware_info.joints);
parse_state_interface_descriptions(hardware_info.joints);
for (const auto & description : joint_state_interface_descriptions)
{
joint_state_interfaces_.insert(std::make_pair(description.get_name(), description));
}
auto sensor_state_interface_descriptions =
parse_state_interface_descriptions_from_hardware_info(hardware_info.sensors);
parse_state_interface_descriptions(hardware_info.sensors);
for (const auto & description : sensor_state_interface_descriptions)
{
sensor_state_interfaces_.insert(std::make_pair(description.get_name(), description));
}
auto gpio_state_interface_descriptions =
parse_state_interface_descriptions_from_hardware_info(hardware_info.gpios);
parse_state_interface_descriptions(hardware_info.gpios);
for (const auto & description : gpio_state_interface_descriptions)
{
gpio_state_interfaces_.insert(std::make_pair(description.get_name(), description));
Expand All @@ -164,13 +164,13 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
void import_command_interface_descriptions(const HardwareInfo & hardware_info)
{
auto joint_command_interface_descriptions =
parse_command_interface_descriptions_from_hardware_info(hardware_info.joints);
parse_command_interface_descriptions(hardware_info.joints);
for (const auto & description : joint_command_interface_descriptions)
{
joint_command_interfaces_.insert(std::make_pair(description.get_name(), description));
}
auto gpio_command_interface_descriptions =
parse_command_interface_descriptions_from_hardware_info(hardware_info.gpios);
parse_command_interface_descriptions(hardware_info.gpios);
for (const auto & description : gpio_command_interface_descriptions)
{
gpio_command_interfaces_.insert(std::make_pair(description.get_name(), description));
Expand Down
20 changes: 10 additions & 10 deletions hardware_interface/test/test_component_interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ TEST(TestComponentInterfaces, dummy_actuator_read_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, actuator_hw.read(TIME, PERIOD));

state = actuator_hw.get_state();
state = actuator_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::FINALIZED, state.label());

Expand Down Expand Up @@ -1426,7 +1426,7 @@ TEST(TestComponentInterfaces, dummy_actuator_default_read_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, actuator_hw.read(TIME, PERIOD));

state = actuator_hw.get_state();
state = actuator_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label());

Expand Down Expand Up @@ -1513,7 +1513,7 @@ TEST(TestComponentInterfaces, dummy_actuator_write_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, actuator_hw.write(TIME, PERIOD));

state = actuator_hw.get_state();
state = actuator_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::FINALIZED, state.label());

Expand Down Expand Up @@ -1558,7 +1558,7 @@ TEST(TestComponentInterfaces, dummy_actuator_default_write_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, actuator_hw.write(TIME, PERIOD));

state = actuator_hw.get_state();
state = actuator_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label());

Expand Down Expand Up @@ -1691,7 +1691,7 @@ TEST(TestComponentInterfaces, dummy_sensor_default_read_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, sensor_hw.read(TIME, PERIOD));

state = sensor_hw.get_state();
state = sensor_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label());

Expand All @@ -1711,7 +1711,7 @@ TEST(TestComponentInterfaces, dummy_sensor_default_read_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, sensor_hw.read(TIME, PERIOD));

state = sensor_hw.get_state();
state = sensor_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::FINALIZED, state.label());

Expand Down Expand Up @@ -1777,7 +1777,7 @@ TEST(TestComponentInterfaces, dummy_system_read_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, system_hw.read(TIME, PERIOD));

state = system_hw.get_state();
state = system_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::FINALIZED, state.label());

Expand Down Expand Up @@ -1821,7 +1821,7 @@ TEST(TestComponentInterfaces, dummy_system_default_read_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, system_hw.read(TIME, PERIOD));

state = system_hw.get_state();
state = system_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label());

Expand Down Expand Up @@ -1915,7 +1915,7 @@ TEST(TestComponentInterfaces, dummy_system_write_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, system_hw.write(TIME, PERIOD));

state = system_hw.get_state();
state = system_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::FINALIZED, state.label());

Expand Down Expand Up @@ -1959,7 +1959,7 @@ TEST(TestComponentInterfaces, dummy_system_default_write_error_behavior)
}
ASSERT_EQ(hardware_interface::return_type::ERROR, system_hw.write(TIME, PERIOD));

state = system_hw.get_state();
state = system_hw.get_lifecycle_state();
EXPECT_EQ(lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id());
EXPECT_EQ(hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label());

Expand Down
Loading