Skip to content

Commit 4bcce09

Browse files
Remove deprecated HardwareInfo::thread_priority member (#3484)
1 parent 3414da6 commit 4bcce09

3 files changed

Lines changed: 0 additions & 126 deletions

File tree

hardware_interface/include/hardware_interface/hardware_info.hpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,6 @@ struct HardwareAsyncParams
361361
};
362362

363363
/// This structure stores information about hardware defined in a robot's URDF.
364-
#ifdef _MSC_VER
365-
#pragma warning(push)
366-
#pragma warning(disable : 4996)
367-
#else
368-
#pragma GCC diagnostic push
369-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
370-
#endif
371364
struct HardwareInfo
372365
{
373366
/// Name of the hardware.
@@ -380,8 +373,6 @@ struct HardwareInfo
380373
unsigned int rw_rate;
381374
/// Component is async
382375
bool is_async;
383-
/// Async thread priority
384-
[[deprecated("Use async_params instead.")]] int thread_priority;
385376
/// Async Parameters
386377
HardwareAsyncParams async_params;
387378
/// Name of the pluginlib plugin of the hardware that will be loaded.
@@ -428,11 +419,6 @@ struct HardwareInfo
428419
*/
429420
std::unordered_map<std::string, joint_limits::SoftJointLimits> soft_limits;
430421
};
431-
#ifdef _MSC_VER
432-
#pragma warning(pop)
433-
#else
434-
#pragma GCC diagnostic pop
435-
#endif
436422

437423
} // namespace hardware_interface
438424
#endif // HARDWARE_INTERFACE__HARDWARE_INFO_HPP_

hardware_interface/src/component_parser.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -705,20 +705,6 @@ HardwareInfo parse_resource_from_xml(
705705
hardware.async_params.thread_priority = hardware.is_async
706706
? parse_thread_priority_attribute(ros2_control_it)
707707
: std::numeric_limits<int>::max();
708-
// TODO(anyone): remove this line once thread_priority is removed
709-
#ifdef _MSC_VER
710-
#pragma warning(push)
711-
#pragma warning(disable : 4996)
712-
#else
713-
#pragma GCC diagnostic push
714-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
715-
#endif
716-
hardware.thread_priority = hardware.async_params.thread_priority;
717-
#ifdef _MSC_VER
718-
#pragma warning(pop)
719-
#else
720-
#pragma GCC diagnostic pop
721-
#endif
722708

723709
// Parse everything under ros2_control tag
724710
hardware.hardware_plugin_name = "";
@@ -769,20 +755,6 @@ HardwareInfo parse_resource_from_xml(
769755
if (async_it->FindAttribute(kThreadPriorityAttribute))
770756
{
771757
hardware.async_params.thread_priority = parse_thread_priority_attribute(async_it);
772-
// TODO(anyone): remove this line once thread_priority is removed
773-
#ifdef _MSC_VER
774-
#pragma warning(push)
775-
#pragma warning(disable : 4996)
776-
#else
777-
#pragma GCC diagnostic push
778-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
779-
#endif
780-
hardware.thread_priority = hardware.async_params.thread_priority;
781-
#ifdef _MSC_VER
782-
#pragma warning(pop)
783-
#else
784-
#pragma GCC diagnostic pop
785-
#endif
786758
}
787759
if (async_it->FindAttribute(kPrintWarningsAttribute))
788760
{

hardware_interface/test/test_component_parser.cpp

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -884,20 +884,6 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_robot_with_gpio
884884
hardware_info.hardware_plugin_name, "ros2_control_demo_hardware/RRBotSystemWithGPIOHardware");
885885

886886
ASSERT_FALSE(hardware_info.is_async);
887-
// TODO(anyone): remove this line once thread_priority is removed
888-
#ifdef _MSC_VER
889-
#pragma warning(push)
890-
#pragma warning(disable : 4996)
891-
#else
892-
#pragma GCC diagnostic push
893-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
894-
#endif
895-
ASSERT_EQ(hardware_info.thread_priority, hardware_info.async_params.thread_priority);
896-
#ifdef _MSC_VER
897-
#pragma warning(pop)
898-
#else
899-
#pragma GCC diagnostic pop
900-
#endif
901887
ASSERT_EQ(hardware_info.async_params.thread_priority, std::numeric_limits<int>::max());
902888
ASSERT_THAT(hardware_info.joints, SizeIs(2));
903889

@@ -970,20 +956,6 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_system_with_size_and_d
970956
ASSERT_THAT(hardware_info.joints, SizeIs(1));
971957

972958
ASSERT_FALSE(hardware_info.is_async);
973-
// TODO(anyone): remove this line once thread_priority is removed
974-
#ifdef _MSC_VER
975-
#pragma warning(push)
976-
#pragma warning(disable : 4996)
977-
#else
978-
#pragma GCC diagnostic push
979-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
980-
#endif
981-
ASSERT_EQ(hardware_info.thread_priority, hardware_info.async_params.thread_priority);
982-
#ifdef _MSC_VER
983-
#pragma warning(pop)
984-
#else
985-
#pragma GCC diagnostic pop
986-
#endif
987959
ASSERT_EQ(hardware_info.async_params.thread_priority, std::numeric_limits<int>::max());
988960
EXPECT_EQ(hardware_info.joints[0].name, "joint1");
989961
EXPECT_EQ(hardware_info.joints[0].type, "joint");
@@ -1034,20 +1006,6 @@ TEST_F(
10341006

10351007
ASSERT_THAT(hardware_info.joints, SizeIs(1));
10361008
ASSERT_FALSE(hardware_info.is_async);
1037-
// TODO(anyone): remove this line once thread_priority is removed
1038-
#ifdef _MSC_VER
1039-
#pragma warning(push)
1040-
#pragma warning(disable : 4996)
1041-
#else
1042-
#pragma GCC diagnostic push
1043-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1044-
#endif
1045-
ASSERT_EQ(hardware_info.thread_priority, hardware_info.async_params.thread_priority);
1046-
#ifdef _MSC_VER
1047-
#pragma warning(pop)
1048-
#else
1049-
#pragma GCC diagnostic pop
1050-
#endif
10511009
ASSERT_EQ(hardware_info.async_params.thread_priority, std::numeric_limits<int>::max());
10521010
EXPECT_EQ(hardware_info.joints[0].name, "joint1");
10531011
EXPECT_EQ(hardware_info.joints[0].type, "joint");
@@ -1484,20 +1442,6 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_async_components)
14841442
ASSERT_THAT(hardware_info.group, IsEmpty());
14851443
ASSERT_THAT(hardware_info.joints, SizeIs(1));
14861444
ASSERT_TRUE(hardware_info.is_async);
1487-
// TODO(anyone): remove this line once thread_priority is removed
1488-
#ifdef _MSC_VER
1489-
#pragma warning(push)
1490-
#pragma warning(disable : 4996)
1491-
#else
1492-
#pragma GCC diagnostic push
1493-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1494-
#endif
1495-
ASSERT_EQ(hardware_info.thread_priority, hardware_info.async_params.thread_priority);
1496-
#ifdef _MSC_VER
1497-
#pragma warning(pop)
1498-
#else
1499-
#pragma GCC diagnostic pop
1500-
#endif
15011445
ASSERT_EQ(hardware_info.async_params.thread_priority, 30);
15021446
ASSERT_EQ(hardware_info.async_params.scheduling_policy, "detached");
15031447
ASSERT_FALSE(hardware_info.async_params.print_warnings);
@@ -1517,20 +1461,6 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_async_components)
15171461
ASSERT_THAT(hardware_info.joints, IsEmpty());
15181462
ASSERT_THAT(hardware_info.sensors, SizeIs(1));
15191463
ASSERT_TRUE(hardware_info.is_async);
1520-
// TODO(anyone): remove this line once thread_priority is removed
1521-
#ifdef _MSC_VER
1522-
#pragma warning(push)
1523-
#pragma warning(disable : 4996)
1524-
#else
1525-
#pragma GCC diagnostic push
1526-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1527-
#endif
1528-
ASSERT_EQ(hardware_info.thread_priority, hardware_info.async_params.thread_priority);
1529-
#ifdef _MSC_VER
1530-
#pragma warning(pop)
1531-
#else
1532-
#pragma GCC diagnostic pop
1533-
#endif
15341464
ASSERT_EQ(hardware_info.async_params.thread_priority, 50);
15351465
ASSERT_EQ(hardware_info.async_params.scheduling_policy, "synchronized");
15361466
ASSERT_TRUE(hardware_info.async_params.print_warnings);
@@ -1558,20 +1488,6 @@ TEST_F(TestComponentParser, successfully_parse_valid_urdf_async_components)
15581488
EXPECT_EQ(hardware_info.gpios[0].name, "configuration");
15591489
EXPECT_EQ(hardware_info.gpios[0].type, "gpio");
15601490
ASSERT_TRUE(hardware_info.is_async);
1561-
// TODO(anyone): remove this line once thread_priority is removed
1562-
#ifdef _MSC_VER
1563-
#pragma warning(push)
1564-
#pragma warning(disable : 4996)
1565-
#else
1566-
#pragma GCC diagnostic push
1567-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1568-
#endif
1569-
ASSERT_EQ(hardware_info.thread_priority, hardware_info.async_params.thread_priority);
1570-
#ifdef _MSC_VER
1571-
#pragma warning(pop)
1572-
#else
1573-
#pragma GCC diagnostic pop
1574-
#endif
15751491
ASSERT_EQ(hardware_info.async_params.thread_priority, 70);
15761492
ASSERT_EQ(hardware_info.async_params.scheduling_policy, "synchronized");
15771493
ASSERT_EQ(1u, hardware_info.async_params.cpu_affinity_cores.size());

0 commit comments

Comments
 (0)