@@ -236,25 +236,25 @@ def test_setup_scene(self):
236
236
pose1 = self .bridge .spawned_entities [0 ].pose .pose
237
237
self .assertEqual (self .bridge .spawned_entities [0 ].name , "test_entity1" )
238
238
self .assertEqual (self .bridge .spawned_entities [0 ].prefab_name , "test_prefab1" )
239
- self . assertEqual (pose1 .position .x , 1.0 )
240
- self . assertEqual (pose1 .position .y , 2.0 )
241
- self . assertEqual (pose1 .position .z , 3.0 )
239
+ assert np . isclose (pose1 .position .x , 1.0 )
240
+ assert np . isclose (pose1 .position .y , 2.0 )
241
+ assert np . isclose (pose1 .position .z , 3.0 )
242
242
assert pose1 .orientation
243
- self . assertEqual (pose1 .orientation .x , 0.0 )
244
- self . assertEqual (pose1 .orientation .y , 0.0 )
245
- self . assertEqual (pose1 .orientation .z , 0.0 )
246
- self . assertEqual (pose1 .orientation .w , 1.0 )
243
+ assert np . isclose (pose1 .orientation .x , 0.0 )
244
+ assert np . isclose (pose1 .orientation .y , 0.0 )
245
+ assert np . isclose (pose1 .orientation .z , 0.0 )
246
+ assert np . isclose (pose1 .orientation .w , 1.0 )
247
247
248
248
pose2 = self .bridge .spawned_entities [1 ].pose .pose
249
249
self .assertEqual (self .bridge .spawned_entities [1 ].name , "test_entity2" )
250
250
self .assertEqual (self .bridge .spawned_entities [1 ].prefab_name , "test_prefab2" )
251
- self . assertEqual (pose2 .position .x , 4.0 )
252
- self . assertEqual (pose2 .position .y , 5.0 )
253
- self . assertEqual (pose2 .position .z , 6.0 )
254
- self . assertEqual (pose2 .orientation .x , 0.0 )
255
- self . assertEqual (pose2 .orientation .y , 0.0 )
256
- self . assertEqual (pose2 .orientation .z , 0.0 )
257
- self . assertEqual (pose2 .orientation .w , 1.0 )
251
+ assert np . isclose (pose2 .position .x , 4.0 )
252
+ assert np . isclose (pose2 .position .y , 5.0 )
253
+ assert np . isclose (pose2 .position .z , 6.0 )
254
+ assert np . isclose (pose2 .orientation .x , 0.0 )
255
+ assert np . isclose (pose2 .orientation .y , 0.0 )
256
+ assert np . isclose (pose2 .orientation .z , 0.0 )
257
+ assert np . isclose (pose2 .orientation .w , 1.0 )
258
258
259
259
def test_spawn_entity (self ):
260
260
self .bridge ._spawn_entity (self .test_entity1 ) # type: ignore
@@ -283,14 +283,14 @@ def test_get_object_pose(self):
283
283
284
284
# Check if the pose matches
285
285
pose = pose_stamped .pose
286
- self . assertEqual (pose .position .x , 1.0 )
287
- self . assertEqual (pose .position .y , 2.0 )
288
- self . assertEqual (pose .position .z , 3.0 )
286
+ assert np . isclose (pose .position .x , 1.0 )
287
+ assert np . isclose (pose .position .y , 2.0 )
288
+ assert np . isclose (pose .position .z , 3.0 )
289
289
assert pose .orientation
290
- self . assertEqual (pose .orientation .x , 0.0 )
291
- self . assertEqual (pose .orientation .y , 0.0 )
292
- self . assertEqual (pose .orientation .z , 0.0 )
293
- self . assertEqual (pose .orientation .w , 1.0 )
290
+ assert np . isclose (pose .orientation .x , 0.0 )
291
+ assert np . isclose (pose .orientation .y , 0.0 )
292
+ assert np . isclose (pose .orientation .z , 0.0 )
293
+ assert np . isclose (pose .orientation .w , 1.0 )
294
294
295
295
# Test for non-existent entity
296
296
non_existent_entity = SpawnedEntity (
0 commit comments