@@ -961,15 +961,15 @@ TEST_F(ResourceManagerTest, resource_availability_and_claiming_in_lifecycle)
961
961
TEST_SYSTEM_HARDWARE_STATE_INTERFACES, TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES, false );
962
962
}
963
963
964
- // When actuator is configured all interfaces become available
964
+ // When actuator is configured state interfaces become available
965
965
configure_components (rm, {TEST_ACTUATOR_HARDWARE_NAME});
966
966
{
967
967
check_interfaces (
968
968
{" joint1/position" },
969
- std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
969
+ std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
970
970
check_interfaces (
971
971
{" joint1/max_velocity" },
972
- std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
972
+ std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
973
973
check_interfaces (
974
974
TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES,
975
975
std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
@@ -987,9 +987,8 @@ TEST_F(ResourceManagerTest, resource_availability_and_claiming_in_lifecycle)
987
987
988
988
// Can claim Actuator's interfaces
989
989
{
990
- check_interface_claiming ({}, {" joint1/position" }, true );
991
- check_interface_claiming (
992
- TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, {" joint1/max_velocity" }, true );
990
+ check_interface_claiming ({}, {" joint1/position" }, false );
991
+ check_interface_claiming (TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, {}, true );
993
992
check_interface_claiming (TEST_SENSOR_HARDWARE_STATE_INTERFACES, {}, false );
994
993
check_interface_claiming (
995
994
TEST_SYSTEM_HARDWARE_STATE_INTERFACES, TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES, false );
@@ -1045,19 +1044,18 @@ TEST_F(ResourceManagerTest, resource_availability_and_claiming_in_lifecycle)
1045
1044
std::bind (&TestableResourceManager::state_interface_exists, &rm, _1), true );
1046
1045
}
1047
1046
1048
- // When Sensor and System are configured their state-
1049
- // and command- interfaces are available
1047
+ // When Sensor and System are configured their state-interfaces are available
1050
1048
configure_components (rm, {TEST_SENSOR_HARDWARE_NAME, TEST_SYSTEM_HARDWARE_NAME});
1051
1049
{
1052
1050
check_interfaces (
1053
1051
TEST_ACTUATOR_HARDWARE_COMMAND_INTERFACES,
1054
1052
std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
1055
1053
check_interfaces (
1056
1054
{" joint2/velocity" , " joint3/velocity" },
1057
- std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
1055
+ std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
1058
1056
check_interfaces (
1059
1057
{" joint2/max_acceleration" , " configuration/max_tcp_jerk" },
1060
- std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
1058
+ std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
1061
1059
1062
1060
check_interfaces (
1063
1061
TEST_ACTUATOR_HARDWARE_STATE_INTERFACES,
@@ -1073,15 +1071,15 @@ TEST_F(ResourceManagerTest, resource_availability_and_claiming_in_lifecycle)
1073
1071
// Can claim:
1074
1072
// - all Actuator's state interfaces and command interfaces
1075
1073
// - sensor's state interfaces
1076
- // - system's state and command interfaces
1074
+ // - system's state interfaces
1075
+ // Cannot claim:
1076
+ // - system's command interfaces
1077
1077
{
1078
1078
check_interface_claiming (
1079
1079
TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, TEST_ACTUATOR_HARDWARE_COMMAND_INTERFACES, true );
1080
1080
check_interface_claiming (TEST_SENSOR_HARDWARE_STATE_INTERFACES, {}, true );
1081
- check_interface_claiming ({}, {" joint2/velocity" , " joint3/velocity" }, true );
1082
- check_interface_claiming (
1083
- TEST_SYSTEM_HARDWARE_STATE_INTERFACES,
1084
- {" joint2/max_acceleration" , " configuration/max_tcp_jerk" }, true );
1081
+ check_interface_claiming (TEST_SYSTEM_HARDWARE_STATE_INTERFACES, {}, true );
1082
+ check_interface_claiming ({}, {" joint2/velocity" , " joint3/velocity" }, false );
1085
1083
}
1086
1084
1087
1085
// All active - everything available
@@ -1122,10 +1120,10 @@ TEST_F(ResourceManagerTest, resource_availability_and_claiming_in_lifecycle)
1122
1120
{
1123
1121
check_interfaces (
1124
1122
{" joint1/position" },
1125
- std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
1123
+ std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
1126
1124
check_interfaces (
1127
1125
{" joint1/max_velocity" },
1128
- std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
1126
+ std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
1129
1127
check_interfaces (
1130
1128
TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES,
1131
1129
std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
@@ -1142,27 +1140,32 @@ TEST_F(ResourceManagerTest, resource_availability_and_claiming_in_lifecycle)
1142
1140
}
1143
1141
1144
1142
// Can claim everything
1145
- // - actuator's state and command interfaces
1143
+ // - actuator's state interfaces
1146
1144
// - sensor's state interfaces
1147
1145
// - system's state and command interfaces
1146
+ // Cannot claim:
1147
+ // - actuator's command interface
1148
1148
{
1149
- check_interface_claiming ({}, {" joint1/position" }, true );
1150
- check_interface_claiming (
1151
- TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, {" joint1/max_velocity" }, true );
1149
+ check_interface_claiming (TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, {}, true );
1152
1150
check_interface_claiming (TEST_SENSOR_HARDWARE_STATE_INTERFACES, {}, true );
1153
1151
check_interface_claiming (
1154
1152
TEST_SYSTEM_HARDWARE_STATE_INTERFACES, TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES, true );
1153
+ check_interface_claiming ({}, {" joint1/position" }, false );
1154
+ // check_interface_claiming(
1155
+ // TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, {"joint1/max_velocity"}, true);
1156
+ // TODO(fmauch): Claiming the state interfaces should work but the check function expects both
1157
+ // to fail.
1155
1158
}
1156
1159
1157
1160
// When sensor is cleaned up the interfaces are not available anymore
1158
1161
cleanup_components (rm, {TEST_SENSOR_HARDWARE_NAME});
1159
1162
{
1160
1163
check_interfaces (
1161
1164
{" joint1/position" },
1162
- std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
1165
+ std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
1163
1166
check_interfaces (
1164
1167
{" joint1/max_velocity" },
1165
- std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
1168
+ std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), false );
1166
1169
check_interfaces (
1167
1170
TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES,
1168
1171
std::bind (&TestableResourceManager::command_interface_is_available, &rm, _1), true );
@@ -1178,17 +1181,24 @@ TEST_F(ResourceManagerTest, resource_availability_and_claiming_in_lifecycle)
1178
1181
std::bind (&TestableResourceManager::state_interface_is_available, &rm, _1), true );
1179
1182
}
1180
1183
1181
- // Can claim everything
1182
- // - actuator's state and command interfaces
1183
- // - no sensor's interface
1184
+ // Can claim:
1185
+ // - actuator's state interfaces
1184
1186
// - system's state and command interfaces
1187
+ // Cannot claim:
1188
+ // - actuator's command interfaces
1189
+ // - sensor's interface
1185
1190
{
1186
- check_interface_claiming ({}, {" joint1/position" }, true );
1187
- check_interface_claiming (
1188
- TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, {" joint1/max_velocity" }, true );
1189
- check_interface_claiming (TEST_SENSOR_HARDWARE_STATE_INTERFACES, {}, false );
1191
+ check_interface_claiming (TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, {}, true );
1190
1192
check_interface_claiming (
1191
1193
TEST_SYSTEM_HARDWARE_STATE_INTERFACES, TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES, true );
1194
+
1195
+ check_interface_claiming (TEST_SENSOR_HARDWARE_STATE_INTERFACES, {}, false );
1196
+ check_interface_claiming ({}, {" joint1/position" }, false );
1197
+
1198
+ // check_interface_claiming(
1199
+ // TEST_ACTUATOR_HARDWARE_STATE_INTERFACES, {"joint1/max_velocity"}, true);
1200
+ // TODO(fmauch): Claiming the state interfaces should work but the check function expects both
1201
+ // to fail.
1192
1202
}
1193
1203
1194
1204
// Check if all interfaces still exits
0 commit comments