Skip to content

Commit

Permalink
fix: use 'ament_index' in 'simulator_2d' tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apmilko committed Jun 2, 2024
1 parent 6e64dfc commit a1a8498
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/simulator_2d/test/simulation_map_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

#include <gtest/gtest.h>

#include <ament_index_cpp/get_package_share_directory.hpp>

using namespace truck::simulator;

const std::string MAP_PKG_PATH = ament_index_cpp::get_package_share_directory("map");

TEST(SimulationMap, hasCollision) {
constexpr double precision = 1e-9;

{
// Arrange.
SimulationMap map;
map.resetMap("/truck/packages/map/data/map_6.geojson");
map.resetMap(MAP_PKG_PATH + "/data/map_6.geojson");
const auto shape = truck::geom::Polygon{{20, 38}, {19, 38}, {20, 37}, {19, 37}};

// Act.
Expand All @@ -23,7 +27,7 @@ TEST(SimulationMap, hasCollision) {
{
// Arrange.
SimulationMap map;
map.resetMap("/truck/packages/map/data/map_6.geojson");
map.resetMap(MAP_PKG_PATH + "/data/map_6.geojson");
const auto shape = truck::geom::Polygon{{25, 32}, {27, 32}, {27, 29}, {25, 29}};

// Act.
Expand All @@ -36,7 +40,7 @@ TEST(SimulationMap, hasCollision) {
{
// Arrange.
SimulationMap map;
map.resetMap("/truck/packages/map/data/map_6.geojson");
map.resetMap(MAP_PKG_PATH + "/data/map_6.geojson");
const auto shape = truck::geom::Polygon{
{22.133002182962517, 31.000984165385418}, {22, 30}, {21, 31}, {21, 30}};

Expand Down

0 comments on commit a1a8498

Please sign in to comment.