11
22#include " software/ai/hl/stp/tactic/vis_proto_deduper.h"
33#include " software/ai/navigator/obstacle/obstacle.hpp"
4+ #include " software/ai/navigator/obstacle/robot_navigation_obstacle_factory.h"
45#include " software/geom/polygon.h"
56#include " software/geom/point.h"
67
78#include < gtest/gtest.h>
89#include < memory>
910#include < vector>
1011
11- // Helper to create a unique obstacle based on a position offset
12- // This ensures we have distinct geometries to hash.
13- ObstaclePtr createTestObstacle (double x, double y)
14- {
15- auto polygon = Polygon ({Point (x, y), Point (x + 1.0 , y + 1.0 ), Point (x - 1.0 , y - 1.0 )});
16- return std::make_shared<Obstacle>(polygon);
17- }
12+
1813
1914class VisProtoDeduperTest : public ::testing::Test
2015{
2116protected:
17+ RobotNavigationObstacleFactory obstacle_factory =
18+ RobotNavigationObstacleFactory (TbotsProto::RobotNavigationObstacleConfig());
19+
2220 // Helper to extract the list of obstacles from the proto message for easy verification
2321 std::vector<TbotsProto::Obstacle> getObstaclesFromProto (const TbotsProto::ObstacleList& msg)
2422 {
@@ -27,7 +25,15 @@ class VisProtoDeduperTest : public ::testing::Test
2725 {
2826 obstacles.push_back (obs);
2927 }
30- return obstacles;
28+ return obstacles;;
29+ }
30+
31+ // Helper to create a unique obstacle based on a position offset
32+ // This ensures we have distinct geometries to hash.
33+ ObstaclePtr createTestObstacle (double x, double y)
34+ {
35+ auto polygon = Polygon ({Point (x, y), Point (x + 1.0 , y), Point (x, y + 1.0 )});
36+ return obstacle_factory.createFromShape (polygon);
3137 }
3238};
3339
0 commit comments