From 90d186806e38fb485db3f3c2dc9c58e8b9438247 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Sun, 31 Dec 2023 16:29:39 +0100 Subject: [PATCH] Extend dummy test --- test/Dummy_test.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/Dummy_test.cc b/test/Dummy_test.cc index abba183..7608aeb 100644 --- a/test/Dummy_test.cc +++ b/test/Dummy_test.cc @@ -21,5 +21,14 @@ TEST(Dummy, Foo) { Placement(&motorRight, Vector3(1, 0, 0))); Roboid *roboid = new Roboid(perception, propulsion); + + bool obstacleLeft = roboid->perception->ObjectNearby(-30); + bool obstacleRight = roboid->perception->ObjectNearby(30); + + EXPECT_FALSE(obstacleLeft); + EXPECT_FALSE(obstacleRight); + + float leftMotorSpeed = obstacleRight ? -1.0F : 1.0F; + float rightMotorSpeed = obstacleLeft ? -1.0F : 1.0F; } #endif