Skip to content

Commit 5f73cab

Browse files
committed
add coments in module 3 test so it's easier to understand
1 parent bc296aa commit 5f73cab

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules/module_3/test/test_laser_detector_node.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@ TEST_F(TestLaserDetectorNode, ObstacleDetectionIsTrue) {
237237
// when enough points fall within the configured footprint and ROI. It ensures that
238238
// the detection logic in the node produces the expected Boolean output.
239239

240+
// ROI angles are set higher (e.g. +-0.6) than the scan limits (+-0.5) so
241+
// there is no ROI filter being applied.
242+
//
243+
// min_points is set to 3 and footprint_radius to 1.3
244+
//
245+
// To detect an obstacle we need 3 or more ranges to be <= 1.3
246+
240247
// Create LaserScan message
241248
auto scan = make_scan({1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6}, // ranges
242249
-0.6, // angle_min
@@ -265,6 +272,13 @@ TEST_F(TestLaserDetectorNode, ObstacleDetectionIsFalse) {
265272
// Use make_scan() to build the message, publish it, and wait for
266273
// latest_detection_ to be received. Then, expect that it is false.
267274

275+
// Suggestion: define ROI angles higher (e.g. +-0.6) than the scan
276+
// limits (+-0.5) so there is no ROI filter and logic is easier to test
277+
//
278+
// min_points is set to 3 and footprint_radius to 1.3
279+
//
280+
// To NOT detect an obstacle we can't have less than 3 ranges <= 1.3
281+
268282
EXPECT_FALSE(true) << "Intentional failure: logic not implemented yet.";
269283

270284
/// END EDIT --------------------------------------------------------

0 commit comments

Comments
 (0)