Merge remote-tracking branch 'origin/main' into ObjectPerception
This commit is contained in:
commit
16b45a40d3
@ -57,7 +57,7 @@ enable_testing()
|
||||
|
||||
add_executable(
|
||||
RoboidControlTest
|
||||
"test/Dummy_test.cc"
|
||||
"test/BB2B_test.cc"
|
||||
)
|
||||
target_link_libraries(
|
||||
RoboidControlTest
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "DistanceSensor.h"
|
||||
#include "Roboid.h"
|
||||
|
||||
TEST(Dummy, Foo) {
|
||||
TEST(BB2B, Basics) {
|
||||
Motor motorLeft = Motor();
|
||||
Motor motorRight = Motor();
|
||||
|
||||
@ -21,5 +21,19 @@ 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;
|
||||
|
||||
DifferentialDrive *diffDrive = (DifferentialDrive *)&roboid->propulsion;
|
||||
diffDrive->SetTargetSpeeds(leftMotorSpeed, rightMotorSpeed);
|
||||
|
||||
// cannot chek verlocity in this branch?
|
||||
}
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user