From 14de679dd03f4d494e2f757cddb0223aff561c7b Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Mon, 12 Aug 2024 20:58:37 +0000 Subject: [PATCH] add nested array --- src/tmx/Messages/CMakeLists.txt | 15 +++ src/tmx/Messages/include/Covariance.h | 8 +- .../Messages/include/SensorDetectedObject.h | 28 ++--- .../test/SensorDetectedObjectTest.cpp | 108 ++++++++++++++++++ src/tmx/Messages/test/TestTimeSyncMessage.cpp | 2 +- src/tmx/TmxApi/tmx/messages/message.hpp | 64 +++++++++++ .../test/SensorDetectedObjectTest.cpp | 79 ------------- 7 files changed, 206 insertions(+), 98 deletions(-) create mode 100644 src/tmx/Messages/test/SensorDetectedObjectTest.cpp delete mode 100644 src/tmx/TmxUtils/test/SensorDetectedObjectTest.cpp diff --git a/src/tmx/Messages/CMakeLists.txt b/src/tmx/Messages/CMakeLists.txt index 3b866ee13..89d08688d 100644 --- a/src/tmx/Messages/CMakeLists.txt +++ b/src/tmx/Messages/CMakeLists.txt @@ -5,3 +5,18 @@ SET (TMXMESSAGES_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) INSTALL (DIRECTORY include DESTINATION . COMPONENT ${PROJECT_NAME} FILES_MATCHING PATTERN "*.h*") + +############# +## Testing ## +############# +enable_testing() + +set(BINARY ${PROJECT_NAME}_test) + +file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES false test/*.h test/*.cpp) + +add_executable(${BINARY} ${TEST_SOURCES}) + +add_test(NAME ${BINARY} COMMAND ${BINARY}) + +target_link_libraries(${BINARY} PUBLIC ${TMXAPI_LIBRARIES} gtest) \ No newline at end of file diff --git a/src/tmx/Messages/include/Covariance.h b/src/tmx/Messages/include/Covariance.h index 711548d85..1259824a3 100644 --- a/src/tmx/Messages/include/Covariance.h +++ b/src/tmx/Messages/include/Covariance.h @@ -5,17 +5,17 @@ namespace tmx namespace messages { typedef struct Covariance{ - std::string value; + double value; Covariance(){}; - Covariance( std::string value):value(value){}; + Covariance(double value):value(value){}; static message_tree_type to_tree(const Covariance& cov){ message_tree_type tree; - tree.put("", cov.value); + tree.put("",cov.value); return tree; } static Covariance from_tree(const message_tree_type& tree){ Covariance cov; - cov.value = tree.get(""); + cov.value = tree.get(""); return cov; } } Covariance; diff --git a/src/tmx/Messages/include/SensorDetectedObject.h b/src/tmx/Messages/include/SensorDetectedObject.h index a564e6bc6..504eb910d 100644 --- a/src/tmx/Messages/include/SensorDetectedObject.h +++ b/src/tmx/Messages/include/SensorDetectedObject.h @@ -33,34 +33,34 @@ namespace tmx // TODO: Convert this member variable to std::attributes and handle nested object and arrays. (see [CloudHeartbeatMessage.h](./CloudHearbeatMessage.h) array_attribute ) //Flag to indicate whether sensor detected object is simulated. - std_attribute(this->msg, bool, ISSimulated, false,); + std_attribute(this->msg, bool, isSimulated, false,); // Classification of detected object. - std_attribute(this->msg, std::string, Type, "",); + std_attribute(this->msg, std::string, type, "",); // Confidence of type classification - std_attribute(this->msg, double, Confidence, 0.0,); + std_attribute(this->msg, double, confidence, 0.0,); // Unique indentifier of sensor reporting detection. - std_attribute(this->msg, std::string, SensorId, "", ); + std_attribute(this->msg, std::string, sensorId, "", ); // String describing projection used to convert cartesian data to WGS84 data. - std_attribute(this->msg, std::string, ProjString, "", ); + std_attribute(this->msg, std::string, projString, "", ); // Unique identifier of detected object. - std_attribute(this->msg, int, ObjectId, 0, ); + std_attribute(this->msg, int, objectId, 0, ); - object_attribute(Position, Position); - array_attribute(Covariance, PositionCovariance); + object_attribute(Position, position); + two_dimension_array_attribute(Covariance, positionCovariance); //Linear velocity in meter per second - object_attribute(Velocity, Velocity); + object_attribute(Velocity, velocity); //Covariance associated with linear velocity. - array_attribute(Covariance, VelocityCovariance); + two_dimension_array_attribute(Covariance, velocityCovariance); //Angular velocity in radians per second. - object_attribute(Velocity, AngularVelocity); + object_attribute(Velocity, angularVelocity); //Covariance associated with angular velocity. - array_attribute(Covariance, AngularVelocityCovariance); + two_dimension_array_attribute(Covariance, angularVelocityCovariance); // Epoch time in milliseconds. // long timestamp = 0; - std_attribute(this->msg, long, Timestamp, 0, ); - object_attribute(Size, Size); + std_attribute(this->msg, long, timestamp, 0, ); + object_attribute(Size, size); }; diff --git a/src/tmx/Messages/test/SensorDetectedObjectTest.cpp b/src/tmx/Messages/test/SensorDetectedObjectTest.cpp new file mode 100644 index 000000000..279cbcf26 --- /dev/null +++ b/src/tmx/Messages/test/SensorDetectedObjectTest.cpp @@ -0,0 +1,108 @@ +#include +#include "SensorDetectedObject.h" + +namespace tmx::messages{ + class SensorDetectedObjectTest : public testing::Test{ + protected: + std::shared_ptr tmxSdsmPtr; + SensorDetectedObjectTest(){ + tmxSdsmPtr = std::make_shared(); + } + void SetUp() override { + tmxSdsmPtr->set_isSimulated(false); + Position pos(1.0, 2.3, 2.0); + tmxSdsmPtr->set_position(pos); + tmxSdsmPtr->set_projString("+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"); + tmxSdsmPtr->set_timestamp(12222222222); + tmxSdsmPtr->set_sensorId("SomeID"); + tmxSdsmPtr->set_type("Car"); + tmxSdsmPtr->set_confidence(0.7); + tmxSdsmPtr->set_objectId(123); + + Velocity vel(1.0, 0.3, 2.0); + tmxSdsmPtr->set_velocity(vel); + tmxSdsmPtr->set_angularVelocity(vel); + + std::vector covs { + Covariance(12), + Covariance(11), + Covariance(13), + Covariance(14), + Covariance(15) + }; + int covarianceSize = 3; + std::vector> covs2d; + for(int i=0; iset_positionCovariance(covs2d); + tmxSdsmPtr->set_velocityCovariance(covs2d); + tmxSdsmPtr->set_angularVelocityCovariance(covs2d); + } + }; + + TEST_F(SensorDetectedObjectTest, attributes){ + EXPECT_EQ(false, tmxSdsmPtr->get_isSimulated()); + EXPECT_EQ(0.7, tmxSdsmPtr->get_confidence()); + EXPECT_EQ("SomeID", tmxSdsmPtr->get_sensorId()); + EXPECT_EQ(12222222222, tmxSdsmPtr->get_timestamp()); + EXPECT_EQ(123, tmxSdsmPtr->get_objectId()); + EXPECT_EQ("+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", tmxSdsmPtr->get_projString()); + EXPECT_EQ(1.0, tmxSdsmPtr->get_position().x); + EXPECT_NEAR(2.3, tmxSdsmPtr->get_position().y, 0.01); + EXPECT_EQ(2.0, tmxSdsmPtr->get_position().z); + EXPECT_EQ(1.0, tmxSdsmPtr->get_velocity().x); + EXPECT_NEAR(0.3, tmxSdsmPtr->get_velocity().y, 0.01); + EXPECT_EQ(2.0, tmxSdsmPtr->get_velocity().z); + EXPECT_EQ(1.0, tmxSdsmPtr->get_angularVelocity().x); + EXPECT_NEAR(0.3, tmxSdsmPtr->get_angularVelocity().y, 0.01); + EXPECT_EQ(2.0, tmxSdsmPtr->get_angularVelocity().z); + EXPECT_EQ(3, tmxSdsmPtr->get_positionCovariance().size()); + EXPECT_EQ(3, tmxSdsmPtr->get_angularVelocityCovariance().size()); + EXPECT_EQ(3, tmxSdsmPtr->get_velocityCovariance().size()); + } + + TEST_F(SensorDetectedObjectTest, to_string){ + std::string expectedStr = "{\"isSimulated\":\"0\",\"position\":{\"x\":\"1\",\"y\":\"2.2999999999999998\",\"z\":\"2\"},\"projString\":\"+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\",\"timestamp\":\"12222222222\",\"sensorId\":\"SomeID\",\"type\":\"Car\",\"confidence\":\"0.69999999999999996\",\"objectId\":\"123\",\"velocity\":{\"x\":\"1\",\"y\":\"0.29999999999999999\",\"z\":\"2\"},\"angularVelocity\":{\"x\":\"1\",\"y\":\"0.29999999999999999\",\"z\":\"2\"},\"positionCovariance\":[[\"12\",\"11\",\"13\",\"14\",\"15\"],[\"12\",\"11\",\"13\",\"14\",\"15\"],[\"12\",\"11\",\"13\",\"14\",\"15\"]],\"velocityCovariance\":[[\"12\",\"11\",\"13\",\"14\",\"15\"],[\"12\",\"11\",\"13\",\"14\",\"15\"],[\"12\",\"11\",\"13\",\"14\",\"15\"]],\"angularVelocityCovariance\":[[\"12\",\"11\",\"13\",\"14\",\"15\"],[\"12\",\"11\",\"13\",\"14\",\"15\"],[\"12\",\"11\",\"13\",\"14\",\"15\"]]}\n"; + EXPECT_EQ(expectedStr, tmxSdsmPtr->to_string()); + } + + TEST_F(SensorDetectedObjectTest, deserialize){ + auto tmxSdsmPtr2 = std::make_shared(); + std::string expectedStr = "{\"isSimulated\":1,\"type\":\"CAR\",\"confidence\":1.0,\"sensorId\":\"IntersectionLidar\",\"projString\":\"+proj=tmerc +lat_0=0 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_15.gtx +vunits=m +no_defs\",\"objectId\":207,\"position\":{\"x\":-5.021,\"y\":64.234,\"z\":-10.297},\"positionCovariance\":[[0.04000000000000001,0.0,0.0],[0.0,0.04000000000000001,0.0],[0.0,0.0,0.04000000000000001]],\"velocity\":{\"x\":0.0,\"y\":0.0,\"z\":0.0},\"velocityCovariance\":[[0.04000000000000001,0.0,0.0],[0.0,0.04000000000000001,0.0],[0.0,0.0,0.04000000000000001]],\"angularVelocity\":{\"x\":0.0,\"y\":-0.0,\"z\":-0.0},\"angularVelocityCovariance\":[[0.010000000000000002,0.0,0.0],[0.0,0.010000000000000002,0.0],[0.0,0.0,0.010000000000000002]],\"size\":{\"length\":2.257,\"height\":1.003,\"width\":0.762},\"timestamp\":110200}"; + tmxSdsmPtr2->set_contents(expectedStr); + EXPECT_EQ(expectedStr, tmxSdsmPtr2->to_string()); + EXPECT_EQ(true, tmxSdsmPtr2->get_isSimulated()); + EXPECT_EQ(-5.021, tmxSdsmPtr2->get_position().x); + EXPECT_NEAR(64.234, tmxSdsmPtr2->get_position().y, 0.01); + EXPECT_EQ(-10.297, tmxSdsmPtr2->get_position().z); + EXPECT_EQ("CAR", tmxSdsmPtr2->get_type()); + EXPECT_EQ(1.0, tmxSdsmPtr2->get_confidence()); + EXPECT_EQ("IntersectionLidar", tmxSdsmPtr2->get_sensorId()); + EXPECT_EQ("+proj=tmerc +lat_0=0 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_15.gtx +vunits=m +no_defs", tmxSdsmPtr2->get_projString()); + EXPECT_EQ(207, tmxSdsmPtr2->get_objectId()); + EXPECT_EQ(0.0, tmxSdsmPtr2->get_velocity().x); + EXPECT_EQ(0.0, tmxSdsmPtr2->get_velocity().y); + EXPECT_EQ(0.0, tmxSdsmPtr2->get_velocity().z); + EXPECT_EQ(0.0, tmxSdsmPtr2->get_angularVelocity().x); + EXPECT_EQ(-0.0, tmxSdsmPtr2->get_angularVelocity().y); + EXPECT_EQ(-0.0, tmxSdsmPtr2->get_angularVelocity().z); + EXPECT_EQ(2.257, tmxSdsmPtr2->get_size().length); + EXPECT_EQ(1.003, tmxSdsmPtr2->get_size().height); + EXPECT_EQ(0.762, tmxSdsmPtr2->get_size().width); + EXPECT_EQ(110200, tmxSdsmPtr2->get_timestamp()); + + EXPECT_EQ(3, tmxSdsmPtr2->get_positionCovariance().size()); + EXPECT_EQ(3, tmxSdsmPtr2->get_angularVelocityCovariance().size()); + EXPECT_EQ(3, tmxSdsmPtr2->get_velocityCovariance().size()); + + EXPECT_NEAR(0.04,tmxSdsmPtr2->get_positionCovariance().begin()->begin()->value, 0.0001); + EXPECT_EQ(0.0, tmxSdsmPtr2->get_positionCovariance().begin()->back().value); + + EXPECT_NEAR(0.04, tmxSdsmPtr2->get_velocityCovariance().begin()->begin()->value, 0.0001); + EXPECT_EQ(0.0, tmxSdsmPtr2->get_velocityCovariance().begin()->back().value); + + EXPECT_NEAR(0.01, tmxSdsmPtr2->get_angularVelocityCovariance().begin()->begin()->value, 0.0001); + EXPECT_EQ(0.0, tmxSdsmPtr2->get_angularVelocityCovariance().begin()->back().value); + } +} \ No newline at end of file diff --git a/src/tmx/Messages/test/TestTimeSyncMessage.cpp b/src/tmx/Messages/test/TestTimeSyncMessage.cpp index a853ed2b2..13b27c69d 100644 --- a/src/tmx/Messages/test/TestTimeSyncMessage.cpp +++ b/src/tmx/Messages/test/TestTimeSyncMessage.cpp @@ -4,7 +4,7 @@ namespace tmx::messages { TEST(TestTimeSyncMessage, to_string) { TimeSyncMessage msg(20, 30); - std::string json = "{ \"timestep\":20, \"seq\":30}"; + std::string json = "{\"timestep\":\"20\",\"seq\":\"30\"}\n"; EXPECT_EQ( json, msg.to_string()); } } \ No newline at end of file diff --git a/src/tmx/TmxApi/tmx/messages/message.hpp b/src/tmx/TmxApi/tmx/messages/message.hpp index 3ac3960cf..94d26a88d 100644 --- a/src/tmx/TmxApi/tmx/messages/message.hpp +++ b/src/tmx/TmxApi/tmx/messages/message.hpp @@ -22,6 +22,11 @@ void add_to_##NAME(ELEMENT element) { add_array_element(#NAME, element); } \ void erase_##NAME() { erase_array(#NAME); } + +#define two_dimension_array_attribute(ELEMENT, NAME) \ + std::vector> get_##NAME () { return get_two_dimension_array(#NAME); } \ + void set_##NAME(std::vector> array) { return set_two_dimension_array(#NAME, array); } + #define object_attribute(ELEMENT, NAME) \ ELEMENT get_##NAME() {return get_object(#NAME); } \ void set_##NAME(ELEMENT obj) {return set_object(#NAME, obj); } \ @@ -407,6 +412,65 @@ class tmx_message { tree.get().push_back(typename message_tree_type::value_type("", Element::to_tree(element))); } + /** + * Get the entire contents of a two dimension array field as a vector. + * Note that the template Element type must contain methods with the following signatures: + * - static Element from_tree(message_tree_type&) + * - static message_tree_type to_tree(Element element) + * @param The name of the array field. + * @returns A two dimension array of all array elements. + */ + template + std::vector> get_two_dimension_array(std::string arrayName) + { + std::vector> ret; + boost::optional tree = this->as_tree(arrayName); + if(tree) + { + for(auto& outer_pair: tree.get()){ + std::vector temp; + for(auto& inner_pair: outer_pair.second){ + Element element = Element::from_tree(inner_pair.second); + temp.push_back(element); + } + ret.push_back(temp); + } + } + return ret; + } + + /** + * Set the entire contents of a two dimension array field. + * Note that the template Element type must contain methods with the following signatures: + * - static Element from_tree(message_tree_type&) + * - static message_tree_type to_tree(Element element) + * @param The name of the array field. + * @param array A two dimenstion array containing all elements to set. + */ + template + void set_two_dimension_array(std::string arrayName, std::vector> array) + { + erase_array(arrayName); + boost::optional tree = this->as_tree(arrayName); + if (!tree) + { + // Add the empty array + message_tree_type emptyTree; + this->as_tree().get().add_child(arrayName, emptyTree); + tree = this->as_tree(arrayName); + } + + for(auto& nested_array: array){ + boost::property_tree::ptree subtree; + //Populate nested array + for(auto& element: nested_array){ + subtree.push_back(typename message_tree_type::value_type("", Element::to_tree(element))); + } + //Add nested array + tree.get().push_back(typename message_tree_type::value_type("", subtree)); + } + } + /*** * @brief Get the content of an object fields * @param Name of the object diff --git a/src/tmx/TmxUtils/test/SensorDetectedObjectTest.cpp b/src/tmx/TmxUtils/test/SensorDetectedObjectTest.cpp deleted file mode 100644 index e2875396e..000000000 --- a/src/tmx/TmxUtils/test/SensorDetectedObjectTest.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include -#include "SensorDetectedObject.h" - -namespace tmx::messages{ - class SensorDetectedObjectTest : public testing::Test{ - protected: - std::shared_ptr tmxSdsmPtr; - SensorDetectedObjectTest(){ - tmxSdsmPtr = std::make_shared(); - } - void SetUp() override { - tmxSdsmPtr->set_ISSimulated(false); - Position pos(1.0, 2.3, 2.0); - tmxSdsmPtr->set_Position(pos); - tmxSdsmPtr->set_ProjString("+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"); - tmxSdsmPtr->set_Timestamp(12222222222); - tmxSdsmPtr->set_SensorId("SomeID"); - tmxSdsmPtr->set_Type("Car"); - tmxSdsmPtr->set_Confidence(0.7); - tmxSdsmPtr->set_ObjectId(123); - - Velocity vel(1.0, 0.3, 2.0); - tmxSdsmPtr->set_Velocity(vel); - tmxSdsmPtr->set_AngularVelocity(vel); - - std::vector covs { - Covariance("a11"), - Covariance("a12"), - Covariance("a13"), - Covariance("a21"), - Covariance("a22"), - Covariance("a23"), - Covariance("a31"), - Covariance("a32"), - Covariance("a33"), - Covariance("a41")}; - tmxSdsmPtr->set_PositionCovariance(covs); - tmxSdsmPtr->set_VelocityCovariance(covs); - tmxSdsmPtr->set_AngularVelocityCovariance(covs); - } - }; - - TEST_F(SensorDetectedObjectTest, attributes){ - EXPECT_EQ(false, tmxSdsmPtr->get_ISSimulated()); - EXPECT_EQ(0.7, tmxSdsmPtr->get_Confidence()); - EXPECT_EQ("SomeID", tmxSdsmPtr->get_SensorId()); - EXPECT_EQ(12222222222, tmxSdsmPtr->get_Timestamp()); - EXPECT_EQ(123, tmxSdsmPtr->get_ObjectId()); - EXPECT_EQ("+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", tmxSdsmPtr->get_ProjString()); - EXPECT_EQ(1.0, tmxSdsmPtr->get_Position().x); - EXPECT_NEAR(2.3, tmxSdsmPtr->get_Position().y, 0.01); - EXPECT_EQ(2.0, tmxSdsmPtr->get_Position().z); - EXPECT_EQ(1.0, tmxSdsmPtr->get_Velocity().x); - EXPECT_NEAR(0.3, tmxSdsmPtr->get_Velocity().y, 0.01); - EXPECT_EQ(2.0, tmxSdsmPtr->get_Velocity().z); - EXPECT_EQ(1.0, tmxSdsmPtr->get_AngularVelocity().x); - EXPECT_NEAR(0.3, tmxSdsmPtr->get_AngularVelocity().y, 0.01); - EXPECT_EQ(2.0, tmxSdsmPtr->get_AngularVelocity().z); - EXPECT_EQ(10, tmxSdsmPtr->get_PositionCovariance().size()); - EXPECT_EQ(10, tmxSdsmPtr->get_AngularVelocityCovariance().size()); - EXPECT_EQ(10, tmxSdsmPtr->get_VelocityCovariance().size()); - } - - TEST_F(SensorDetectedObjectTest, to_string){ - std::string expectedStr = "{\"ISSimulated\":\"0\",\"Position\":{\"x\":\"1\",\"y\":\"2.2999999999999998\",\"z\":\"2\"},\"ProjString\":\"+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\",\"Timestamp\":\"12222222222\",\"SensorId\":\"SomeID\",\"Type\":\"Car\",\"Confidence\":\"0.69999999999999996\",\"ObjectId\":\"123\",\"Velocity\":{\"x\":\"1\",\"y\":\"0.29999999999999999\",\"z\":\"2\"},\"AngularVelocity\":{\"x\":\"1\",\"y\":\"0.29999999999999999\",\"z\":\"2\"},\"PositionCovariance\":[\"a11\",\"a12\",\"a13\",\"a21\",\"a22\",\"a23\",\"a31\",\"a32\",\"a33\",\"a41\"],\"VelocityCovariance\":[\"a11\",\"a12\",\"a13\",\"a21\",\"a22\",\"a23\",\"a31\",\"a32\",\"a33\",\"a41\"],\"AngularVelocityCovariance\":[\"a11\",\"a12\",\"a13\",\"a21\",\"a22\",\"a23\",\"a31\",\"a32\",\"a33\",\"a41\"]}\n"; - EXPECT_EQ(expectedStr, tmxSdsmPtr->to_string()); - } - - TEST_F(SensorDetectedObjectTest, deserialize){ - auto tmxSdsmPtr2 = std::make_shared(); - std::string expectedStr = "{\"ISSimulated\":\"1\",\"Position\":{\"x\":\"1\",\"y\":\"2.5\",\"z\":\"2\"},\"ProjString\":\"+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\",\"Timestamp\":\"12222222222\",\"SensorId\":\"SomeID\",\"Type\":\"Car\",\"Confidence\":\"0.7\",\"ObjectId\":\"123\",\"Velocity\":{\"x\":\"1\",\"y\":\"0.5\",\"z\":\"2\"},\"AngularVelocity\":{\"x\":\"1\",\"y\":\"0.3\",\"z\":\"2\"},\"PositionCovariance\":[\"a11\",\"a12\",\"a13\",\"a21\",\"a22\",\"a23\",\"a31\",\"a32\",\"a33\",\"a41\"],\"VelocityCovariance\":[\"a11\",\"a12\",\"a13\",\"a21\",\"a22\",\"a23\",\"a31\",\"a32\",\"a33\",\"a41\"],\"AngularVelocityCovariance\":[\"a11\",\"a12\",\"a13\",\"a21\",\"a22\",\"a23\",\"a31\",\"a32\",\"a33\",\"a41\"]}\n"; - tmxSdsmPtr2->set_contents(expectedStr); - EXPECT_EQ(expectedStr, tmxSdsmPtr2->to_string()); - EXPECT_EQ(true, tmxSdsmPtr2->get_ISSimulated()); - EXPECT_EQ(1.0, tmxSdsmPtr2->get_Position().x); - EXPECT_NEAR(2.5, tmxSdsmPtr2->get_Position().y, 0.01); - EXPECT_EQ(2.0, tmxSdsmPtr2->get_Position().z); - } -} \ No newline at end of file