From 950a211992eb15233116b419b875b3e4eb9ee4d0 Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Tue, 25 Jul 2023 20:01:05 +0000 Subject: [PATCH] add sensor json --- src/v2i-hub/CDASimAdapter/sensors.json | 32 +++++++++++++++++++ .../test/TestCARMASimulationConnection.cpp | 4 +-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100755 src/v2i-hub/CDASimAdapter/sensors.json diff --git a/src/v2i-hub/CDASimAdapter/sensors.json b/src/v2i-hub/CDASimAdapter/sensors.json new file mode 100755 index 000000000..0299b6734 --- /dev/null +++ b/src/v2i-hub/CDASimAdapter/sensors.json @@ -0,0 +1,32 @@ +[ + { + "id": "SomeID", + "type": "SematicLidar", + "location": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "orientation": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "proj_string": "+proj=tmerc +lat_0=38.95197911150576 +lon_0=-77.14835128349988 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_15.gtx +vunits=m +no_defs" + }, + { + "id": "SomeID2", + "type": "LIDAR", + "location": { + "x": 1.0, + "y": 2.0, + "z": 0.0 + }, + "orientation": { + "x": 23.0, + "y": 0.0, + "z": 0.0 + }, + "proj_string": "+proj=tmerc +lat_0=38.95197911150576 +lon_0=-77.14835128349988 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_15.gtx +vunits=m +no_defs" + } +] \ No newline at end of file diff --git a/src/v2i-hub/CDASimAdapter/test/TestCARMASimulationConnection.cpp b/src/v2i-hub/CDASimAdapter/test/TestCARMASimulationConnection.cpp index 74b69dc52..5cfc97b59 100644 --- a/src/v2i-hub/CDASimAdapter/test/TestCARMASimulationConnection.cpp +++ b/src/v2i-hub/CDASimAdapter/test/TestCARMASimulationConnection.cpp @@ -31,7 +31,7 @@ namespace CDASimAdapter { } public: std::shared_ptr connection; - std::string sensors_file_path = "/var/www/plugins/MAP/sensors.json"; + std::string sensors_file_path = "../CDASimAdapter/sensors.json"; }; @@ -89,7 +89,7 @@ namespace CDASimAdapter { location.Z = -77.149; Json::Value sensorsJsonV; ASSERT_EQ(connection->get_handshake_json("4566", "127.0.0.1", 4567, 4568, location, sensorsJsonV), - "{\n \"infrastructureId\" : 4566,\n \"location\" : {\n \"x\" : 1000.0,\n \"y\" : 38.954999999999998,\n \"z\" : -77.149000000000001\n },\n \"rxMessageIpAddress\" : \"127.0.0.1\",\n \"rxMessagePort\" : 4568,\n \"sensors\" : null,\n \"timeSyncPort\" : 4567\n}\n"); + "{\n \"infrastructureId\" : \"4566\",\n \"location\" : {\n \"x\" : 1000.0,\n \"y\" : 38.954999999999998,\n \"z\" : -77.149000000000001\n },\n \"rxMessageIpAddress\" : \"127.0.0.1\",\n \"rxMessagePort\" : 4568,\n \"sensors\" : null,\n \"timeSyncPort\" : 4567\n}\n"); } TEST_F( TestCARMASimulationConnection, carma_simulation_handshake) {