@@ -203,9 +203,9 @@ def main(
203
203
204
204
if filter_config is None :
205
205
filter_config = {
206
- "strategy" : "dbscan " ,
207
- "dbscan_eps " : 0.02 ,
208
- "dbscan_min_samples " : 5 ,
206
+ "strategy" : "isolation_forest " ,
207
+ "if_max_samples " : "auto" ,
208
+ "if_contamination " : 0.05 ,
209
209
}
210
210
211
211
services = ["/grounded_sam_segment" , "/grounding_dino_classify" ]
@@ -240,21 +240,21 @@ def main(
240
240
241
241
start_time = time .time ()
242
242
243
+ print (
244
+ f"\n Testing GetGrippingPointTool with object '{ test_object } ', strategy '{ strategy } '"
245
+ )
246
+
243
247
# Create the tool with algorithm configurations
244
248
gripping_tool = GetGrippingPointTool (
245
249
connector = connector ,
246
250
segmentation_config = PointCloudFromSegmentationConfig (),
247
251
estimator_config = GrippingPointEstimatorConfig (** estimator_config ),
248
252
filter_config = PointCloudFilterConfig (** filter_config ),
249
253
)
250
- print (f"elapsed time: { time .time () - start_time } seconds" )
251
-
252
- # Test the tool directly
253
- print (
254
- f"\n Testing GetGrippingPointTool with object '{ test_object } ', strategy '{ strategy } '"
255
- )
256
254
257
255
result = gripping_tool ._run (test_object )
256
+ print (f"elapsed time: { time .time () - start_time } seconds" )
257
+
258
258
gripping_points = extract_gripping_points (result )
259
259
print (f"\n Found { len (gripping_points )} gripping points in target frame:" )
260
260
@@ -268,11 +268,13 @@ def main(
268
268
segmented_clouds = gripping_tool .point_cloud_from_segmentation .run (
269
269
test_object
270
270
)
271
+ filtered_clouds = gripping_tool .point_cloud_filter .run (segmented_clouds )
272
+
271
273
print (
272
274
"\n Publishing debug data to /debug_gripping_points_pointcloud and /debug_gripping_points_markerarray"
273
275
)
274
276
_publish_gripping_point_debug_data (
275
- connector , segmented_clouds , gripping_points , frames ["target" ]
277
+ connector , filtered_clouds , gripping_points , frames ["target" ]
276
278
)
277
279
print ("✅ Debug data published" )
278
280
@@ -327,8 +329,8 @@ def test_gripping_points_maciej_demo(strategy):
327
329
"distance_threshold_m" : 0.008 ,
328
330
},
329
331
filter_config = {
330
- "strategy" : "dbscan " ,
331
- "dbscan_eps " : 0.02 ,
332
- "dbscan_min_samples " : 10 ,
332
+ "strategy" : "isolation_forest " ,
333
+ "if_max_samples " : "auto" ,
334
+ "if_contamination " : 0.05 ,
333
335
},
334
336
)
0 commit comments