@@ -1089,26 +1089,26 @@ TEST(TestComponentInterfaces, dummy_sensor_default_interface_export)
1089
1089
EXPECT_EQ (lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id ());
1090
1090
EXPECT_EQ (hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label ());
1091
1091
1092
- auto state_interfaces = sensor_hw.export_state_interfaces ();
1092
+ auto state_interfaces = sensor_hw.on_export_state_interfaces ();
1093
1093
ASSERT_EQ (1u , state_interfaces.size ());
1094
- EXPECT_EQ (" joint1/voltage" , state_interfaces[0 ]. get_name ());
1095
- EXPECT_EQ (" voltage" , state_interfaces[0 ]. get_interface_name ());
1096
- EXPECT_EQ (" joint1" , state_interfaces[0 ]. get_prefix_name ());
1097
- EXPECT_TRUE (std::isnan (state_interfaces[0 ]. get_value ()));
1094
+ EXPECT_EQ (" joint1/voltage" , state_interfaces[0 ]-> get_name ());
1095
+ EXPECT_EQ (" voltage" , state_interfaces[0 ]-> get_interface_name ());
1096
+ EXPECT_EQ (" joint1" , state_interfaces[0 ]-> get_prefix_name ());
1097
+ EXPECT_TRUE (std::isnan (state_interfaces[0 ]-> get_value ()));
1098
1098
1099
1099
// Not updated because is is UNCONFIGURED
1100
1100
sensor_hw.read (TIME, PERIOD);
1101
- EXPECT_TRUE (std::isnan (state_interfaces[0 ]. get_value ()));
1101
+ EXPECT_TRUE (std::isnan (state_interfaces[0 ]-> get_value ()));
1102
1102
1103
1103
// Updated because is is INACTIVE
1104
1104
state = sensor_hw.configure ();
1105
1105
EXPECT_EQ (lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE, state.id ());
1106
1106
EXPECT_EQ (hardware_interface::lifecycle_state_names::INACTIVE, state.label ());
1107
- EXPECT_EQ (0.0 , state_interfaces[0 ]. get_value ());
1107
+ EXPECT_EQ (0.0 , state_interfaces[0 ]-> get_value ());
1108
1108
1109
1109
// It can read now
1110
1110
sensor_hw.read (TIME, PERIOD);
1111
- EXPECT_EQ (0x666 , state_interfaces[0 ]. get_value ());
1111
+ EXPECT_EQ (0x666 , state_interfaces[0 ]-> get_value ());
1112
1112
}
1113
1113
1114
1114
TEST (TestComponentInterfaces, dummy_sensor_default_read_error_behavior)
@@ -1124,7 +1124,7 @@ TEST(TestComponentInterfaces, dummy_sensor_default_read_error_behavior)
1124
1124
const hardware_interface::HardwareInfo voltage_sensor_res = control_resources[0 ];
1125
1125
auto state = sensor_hw.initialize (voltage_sensor_res);
1126
1126
1127
- auto state_interfaces = sensor_hw.export_state_interfaces ();
1127
+ auto state_interfaces = sensor_hw.on_export_state_interfaces ();
1128
1128
// Updated because is is INACTIVE
1129
1129
state = sensor_hw.configure ();
1130
1130
state = sensor_hw.activate ();
@@ -1146,7 +1146,7 @@ TEST(TestComponentInterfaces, dummy_sensor_default_read_error_behavior)
1146
1146
1147
1147
// activate again and expect reset values
1148
1148
state = sensor_hw.configure ();
1149
- EXPECT_EQ (state_interfaces[0 ]. get_value (), 0.0 );
1149
+ EXPECT_EQ (state_interfaces[0 ]-> get_value (), 0.0 );
1150
1150
1151
1151
state = sensor_hw.activate ();
1152
1152
EXPECT_EQ (lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE, state.id ());
@@ -1277,32 +1277,32 @@ TEST(TestComponentInterfaces, dummy_actuator_default)
1277
1277
EXPECT_EQ (lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, state.id ());
1278
1278
EXPECT_EQ (hardware_interface::lifecycle_state_names::UNCONFIGURED, state.label ());
1279
1279
1280
- auto state_interfaces = actuator_hw.export_state_interfaces ();
1280
+ auto state_interfaces = actuator_hw.on_export_state_interfaces ();
1281
1281
ASSERT_EQ (2u , state_interfaces.size ());
1282
- EXPECT_EQ (" joint1/position" , state_interfaces[0 ]. get_name ());
1283
- EXPECT_EQ (hardware_interface::HW_IF_POSITION, state_interfaces[0 ]. get_interface_name ());
1284
- EXPECT_EQ (" joint1" , state_interfaces[0 ]. get_prefix_name ());
1285
- EXPECT_EQ (" joint1/velocity" , state_interfaces[1 ]. get_name ());
1286
- EXPECT_EQ (hardware_interface::HW_IF_VELOCITY, state_interfaces[1 ]. get_interface_name ());
1287
- EXPECT_EQ (" joint1" , state_interfaces[1 ]. get_prefix_name ());
1288
-
1289
- auto command_interfaces = actuator_hw.export_command_interfaces ();
1282
+ EXPECT_EQ (" joint1/position" , state_interfaces[0 ]-> get_name ());
1283
+ EXPECT_EQ (hardware_interface::HW_IF_POSITION, state_interfaces[0 ]-> get_interface_name ());
1284
+ EXPECT_EQ (" joint1" , state_interfaces[0 ]-> get_prefix_name ());
1285
+ EXPECT_EQ (" joint1/velocity" , state_interfaces[1 ]-> get_name ());
1286
+ EXPECT_EQ (hardware_interface::HW_IF_VELOCITY, state_interfaces[1 ]-> get_interface_name ());
1287
+ EXPECT_EQ (" joint1" , state_interfaces[1 ]-> get_prefix_name ());
1288
+
1289
+ auto command_interfaces = actuator_hw.on_export_command_interfaces ();
1290
1290
ASSERT_EQ (1u , command_interfaces.size ());
1291
- EXPECT_EQ (" joint1/velocity" , command_interfaces[0 ]. get_name ());
1292
- EXPECT_EQ (hardware_interface::HW_IF_VELOCITY, command_interfaces[0 ]. get_interface_name ());
1293
- EXPECT_EQ (" joint1" , command_interfaces[0 ]. get_prefix_name ());
1291
+ EXPECT_EQ (" joint1/velocity" , command_interfaces[0 ]-> get_name ());
1292
+ EXPECT_EQ (hardware_interface::HW_IF_VELOCITY, command_interfaces[0 ]-> get_interface_name ());
1293
+ EXPECT_EQ (" joint1" , command_interfaces[0 ]-> get_prefix_name ());
1294
1294
1295
1295
double velocity_value = 1.0 ;
1296
- command_interfaces[0 ]. set_value (velocity_value); // velocity
1296
+ command_interfaces[0 ]-> set_value (velocity_value); // velocity
1297
1297
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.write (TIME, PERIOD));
1298
1298
1299
1299
// Noting should change because it is UNCONFIGURED
1300
1300
for (auto step = 0u ; step < 10 ; ++step)
1301
1301
{
1302
1302
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.read (TIME, PERIOD));
1303
1303
1304
- ASSERT_TRUE (std::isnan (state_interfaces[0 ]. get_value ())); // position value
1305
- ASSERT_TRUE (std::isnan (state_interfaces[1 ]. get_value ())); // velocity
1304
+ ASSERT_TRUE (std::isnan (state_interfaces[0 ]-> get_value ())); // position value
1305
+ ASSERT_TRUE (std::isnan (state_interfaces[1 ]-> get_value ())); // velocity
1306
1306
1307
1307
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.write (TIME, PERIOD));
1308
1308
}
@@ -1316,8 +1316,8 @@ TEST(TestComponentInterfaces, dummy_actuator_default)
1316
1316
{
1317
1317
ASSERT_EQ (hardware_interface::return_type::OK, actuator_hw.read (TIME, PERIOD));
1318
1318
1319
- EXPECT_EQ (step * velocity_value, state_interfaces[0 ]. get_value ()); // position value
1320
- EXPECT_EQ (step ? velocity_value : 0 , state_interfaces[1 ]. get_value ()); // velocity
1319
+ EXPECT_EQ (step * velocity_value, state_interfaces[0 ]-> get_value ()); // position value
1320
+ EXPECT_EQ (step ? velocity_value : 0 , state_interfaces[1 ]-> get_value ()); // velocity
1321
1321
1322
1322
ASSERT_EQ (hardware_interface::return_type::OK, actuator_hw.write (TIME, PERIOD));
1323
1323
}
@@ -1331,8 +1331,8 @@ TEST(TestComponentInterfaces, dummy_actuator_default)
1331
1331
{
1332
1332
ASSERT_EQ (hardware_interface::return_type::OK, actuator_hw.read (TIME, PERIOD));
1333
1333
1334
- EXPECT_EQ ((10 + step) * velocity_value, state_interfaces[0 ]. get_value ()); // position value
1335
- EXPECT_EQ (velocity_value, state_interfaces[1 ]. get_value ()); // velocity
1334
+ EXPECT_EQ ((10 + step) * velocity_value, state_interfaces[0 ]-> get_value ()); // position value
1335
+ EXPECT_EQ (velocity_value, state_interfaces[1 ]-> get_value ()); // velocity
1336
1336
1337
1337
ASSERT_EQ (hardware_interface::return_type::OK, actuator_hw.write (TIME, PERIOD));
1338
1338
}
@@ -1346,8 +1346,8 @@ TEST(TestComponentInterfaces, dummy_actuator_default)
1346
1346
{
1347
1347
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.read (TIME, PERIOD));
1348
1348
1349
- EXPECT_EQ (20 * velocity_value, state_interfaces[0 ]. get_value ()); // position value
1350
- EXPECT_EQ (0 , state_interfaces[1 ]. get_value ()); // velocity
1349
+ EXPECT_EQ (20 * velocity_value, state_interfaces[0 ]-> get_value ()); // position value
1350
+ EXPECT_EQ (0 , state_interfaces[1 ]-> get_value ()); // velocity
1351
1351
1352
1352
ASSERT_EQ (hardware_interface::return_type::ERROR, actuator_hw.write (TIME, PERIOD));
1353
1353
}
0 commit comments