@@ -1077,26 +1077,26 @@ TEST(TestComponentInterfaces, dummy_sensor_default_interface_export)
1077
1077
EXPECT_EQ (lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id ());
1078
1078
EXPECT_EQ (hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label ());
1079
1079
1080
- auto state_interfaces = sensor_hw.export_state_interfaces ();
1080
+ auto state_interfaces = sensor_hw.on_export_state_interfaces ();
1081
1081
ASSERT_EQ (1u , state_interfaces.size ());
1082
- EXPECT_EQ (" joint1/voltage" , state_interfaces[0 ]. get_name ());
1083
- EXPECT_EQ (" voltage" , state_interfaces[0 ]. get_interface_name ());
1084
- EXPECT_EQ (" joint1" , state_interfaces[0 ]. get_prefix_name ());
1085
- EXPECT_TRUE (std::isnan (state_interfaces[0 ]. get_value ()));
1082
+ EXPECT_EQ (" joint1/voltage" , state_interfaces[0 ]-> get_name ());
1083
+ EXPECT_EQ (" voltage" , state_interfaces[0 ]-> get_interface_name ());
1084
+ EXPECT_EQ (" joint1" , state_interfaces[0 ]-> get_prefix_name ());
1085
+ EXPECT_TRUE (std::isnan (state_interfaces[0 ]-> get_value ()));
1086
1086
1087
1087
// Not updated because is is UNCONFIGURED
1088
1088
sensor_hw.read (TIME, PERIOD);
1089
- EXPECT_TRUE (std::isnan (state_interfaces[0 ]. get_value ()));
1089
+ EXPECT_TRUE (std::isnan (state_interfaces[0 ]-> get_value ()));
1090
1090
1091
1091
// Updated because is is INACTIVE
1092
1092
state = sensor_hw.configure ();
1093
1093
EXPECT_EQ (lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE, state.id ());
1094
1094
EXPECT_EQ (hardware_interface::lifecycle_state_names::INACTIVE, state.label ());
1095
- EXPECT_EQ (0.0 , state_interfaces[0 ]. get_value ());
1095
+ EXPECT_EQ (0.0 , state_interfaces[0 ]-> get_value ());
1096
1096
1097
1097
// It can read now
1098
1098
sensor_hw.read (TIME, PERIOD);
1099
- EXPECT_EQ (0x666 , state_interfaces[0 ]. get_value ());
1099
+ EXPECT_EQ (0x666 , state_interfaces[0 ]-> get_value ());
1100
1100
}
1101
1101
1102
1102
TEST (TestComponentInterfaces, dummy_sensor_default_read_error_behavior)
@@ -1112,7 +1112,7 @@ TEST(TestComponentInterfaces, dummy_sensor_default_read_error_behavior)
1112
1112
const hardware_interface::HardwareInfo voltage_sensor_res = control_resources[0 ];
1113
1113
auto state = sensor_hw.initialize (voltage_sensor_res);
1114
1114
1115
- auto state_interfaces = sensor_hw.export_state_interfaces ();
1115
+ auto state_interfaces = sensor_hw.on_export_state_interfaces ();
1116
1116
// Updated because is is INACTIVE
1117
1117
state = sensor_hw.configure ();
1118
1118
state = sensor_hw.activate ();
@@ -1134,7 +1134,7 @@ TEST(TestComponentInterfaces, dummy_sensor_default_read_error_behavior)
1134
1134
1135
1135
// activate again and expect reset values
1136
1136
state = sensor_hw.configure ();
1137
- EXPECT_EQ (state_interfaces[0 ]. get_value (), 0.0 );
1137
+ EXPECT_EQ (state_interfaces[0 ]-> get_value (), 0.0 );
1138
1138
1139
1139
state = sensor_hw.activate ();
1140
1140
EXPECT_EQ (lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE, state.id ());
@@ -1265,32 +1265,32 @@ TEST(TestComponentInterfaces, dummy_actuator_default)
1265
1265
EXPECT_EQ (lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id ());
1266
1266
EXPECT_EQ (hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label ());
1267
1267
1268
- auto state_interfaces = actuator_hw.export_state_interfaces ();
1268
+ auto state_interfaces = actuator_hw.on_export_state_interfaces ();
1269
1269
ASSERT_EQ (2u , state_interfaces.size ());
1270
- EXPECT_EQ (" joint1/position" , state_interfaces[0 ]. get_name ());
1271
- EXPECT_EQ (hardware_interface::HW_IF_POSITION, state_interfaces[0 ]. get_interface_name ());
1272
- EXPECT_EQ (" joint1" , state_interfaces[0 ]. get_prefix_name ());
1273
- EXPECT_EQ (" joint1/velocity" , state_interfaces[1 ]. get_name ());
1274
- EXPECT_EQ (hardware_interface::HW_IF_VELOCITY, state_interfaces[1 ]. get_interface_name ());
1275
- EXPECT_EQ (" joint1" , state_interfaces[1 ]. get_prefix_name ());
1276
-
1277
- auto command_interfaces = actuator_hw.export_command_interfaces ();
1270
+ EXPECT_EQ (" joint1/position" , state_interfaces[0 ]-> get_name ());
1271
+ EXPECT_EQ (hardware_interface::HW_IF_POSITION, state_interfaces[0 ]-> get_interface_name ());
1272
+ EXPECT_EQ (" joint1" , state_interfaces[0 ]-> get_prefix_name ());
1273
+ EXPECT_EQ (" joint1/velocity" , state_interfaces[1 ]-> get_name ());
1274
+ EXPECT_EQ (hardware_interface::HW_IF_VELOCITY, state_interfaces[1 ]-> get_interface_name ());
1275
+ EXPECT_EQ (" joint1" , state_interfaces[1 ]-> get_prefix_name ());
1276
+
1277
+ auto command_interfaces = actuator_hw.on_export_command_interfaces ();
1278
1278
ASSERT_EQ (1u , command_interfaces.size ());
1279
- EXPECT_EQ (" joint1/velocity" , command_interfaces[0 ]. get_name ());
1280
- EXPECT_EQ (hardware_interface::HW_IF_VELOCITY, command_interfaces[0 ]. get_interface_name ());
1281
- EXPECT_EQ (" joint1" , command_interfaces[0 ]. get_prefix_name ());
1279
+ EXPECT_EQ (" joint1/velocity" , command_interfaces[0 ]-> get_name ());
1280
+ EXPECT_EQ (hardware_interface::HW_IF_VELOCITY, command_interfaces[0 ]-> get_interface_name ());
1281
+ EXPECT_EQ (" joint1" , command_interfaces[0 ]-> get_prefix_name ());
1282
1282
1283
1283
double velocity_value = 1.0 ;
1284
- command_interfaces[0 ]. set_value (velocity_value); // velocity
1284
+ command_interfaces[0 ]-> set_value (velocity_value); // velocity
1285
1285
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.write (TIME, PERIOD));
1286
1286
1287
1287
// Noting should change because it is UNCONFIGURED
1288
1288
for (auto step = 0u ; step < 10 ; ++step)
1289
1289
{
1290
1290
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.read (TIME, PERIOD));
1291
1291
1292
- ASSERT_TRUE (std::isnan (state_interfaces[0 ]. get_value ())); // position value
1293
- ASSERT_TRUE (std::isnan (state_interfaces[1 ]. get_value ())); // velocity
1292
+ ASSERT_TRUE (std::isnan (state_interfaces[0 ]-> get_value ())); // position value
1293
+ ASSERT_TRUE (std::isnan (state_interfaces[1 ]-> get_value ())); // velocity
1294
1294
1295
1295
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.write (TIME, PERIOD));
1296
1296
}
@@ -1304,8 +1304,8 @@ TEST(TestComponentInterfaces, dummy_actuator_default)
1304
1304
{
1305
1305
ASSERT_EQ (hardware_interface::return_type::OK, actuator_hw.read (TIME, PERIOD));
1306
1306
1307
- EXPECT_EQ (step * velocity_value, state_interfaces[0 ]. get_value ()); // position value
1308
- EXPECT_EQ (step ? velocity_value : 0 , state_interfaces[1 ]. get_value ()); // velocity
1307
+ EXPECT_EQ (step * velocity_value, state_interfaces[0 ]-> get_value ()); // position value
1308
+ EXPECT_EQ (step ? velocity_value : 0 , state_interfaces[1 ]-> get_value ()); // velocity
1309
1309
1310
1310
ASSERT_EQ (hardware_interface::return_type::OK, actuator_hw.write (TIME, PERIOD));
1311
1311
}
@@ -1319,8 +1319,8 @@ TEST(TestComponentInterfaces, dummy_actuator_default)
1319
1319
{
1320
1320
ASSERT_EQ (hardware_interface::return_type::OK, actuator_hw.read (TIME, PERIOD));
1321
1321
1322
- EXPECT_EQ ((10 + step) * velocity_value, state_interfaces[0 ]. get_value ()); // position value
1323
- EXPECT_EQ (velocity_value, state_interfaces[1 ]. get_value ()); // velocity
1322
+ EXPECT_EQ ((10 + step) * velocity_value, state_interfaces[0 ]-> get_value ()); // position value
1323
+ EXPECT_EQ (velocity_value, state_interfaces[1 ]-> get_value ()); // velocity
1324
1324
1325
1325
ASSERT_EQ (hardware_interface::return_type::OK, actuator_hw.write (TIME, PERIOD));
1326
1326
}
@@ -1334,8 +1334,8 @@ TEST(TestComponentInterfaces, dummy_actuator_default)
1334
1334
{
1335
1335
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.read (TIME, PERIOD));
1336
1336
1337
- EXPECT_EQ (20 * velocity_value, state_interfaces[0 ]. get_value ()); // position value
1338
- EXPECT_EQ (0 , state_interfaces[1 ]. get_value ()); // velocity
1337
+ EXPECT_EQ (20 * velocity_value, state_interfaces[0 ]-> get_value ()); // position value
1338
+ EXPECT_EQ (0 , state_interfaces[1 ]-> get_value ()); // velocity
1339
1339
1340
1340
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.write (TIME, PERIOD));
1341
1341
}
0 commit comments