@@ -57,12 +57,12 @@ BT_JSON_CONVERTER(Pose3D, v)
5757}
5858
5959// specialized functions
60- void jsonFromTime (const Time & t, nlohmann::json & j)
60+ void jsonFromTime (const Time& t, nlohmann::json& j)
6161{
6262 j[" stamp" ] = double (t.sec ) + 1e-9 * double (t.nsec );
6363}
6464
65- void jsonToTime (const nlohmann::json & j, Time & t)
65+ void jsonToTime (const nlohmann::json& j, Time& t)
6666{
6767 double sec = j[" stamp" ];
6868 t.sec = int (sec);
@@ -78,7 +78,7 @@ class JsonTest : public testing::Test
7878protected:
7979 JsonTest ()
8080 {
81- BT::JsonExporter & exporter = BT::JsonExporter::get ();
81+ BT::JsonExporter& exporter = BT::JsonExporter::get ();
8282 exporter.addConverter <TestTypes::Pose3D>();
8383 exporter.addConverter <std::vector<TestTypes::Pose3D>>();
8484 exporter.addConverter <TestTypes::Vector3D>();
@@ -91,9 +91,9 @@ class JsonTest : public testing::Test
9191
9292TEST_F (JsonTest, TwoWaysConversion)
9393{
94- BT::JsonExporter & exporter = BT::JsonExporter::get ();
94+ BT::JsonExporter& exporter = BT::JsonExporter::get ();
9595
96- TestTypes::Pose3D pose = {{ 1 , 2 , 3 }, {4 , 5 , 6 , 7 } };
96+ TestTypes::Pose3D pose = { { 1 , 2 , 3 }, { 4 , 5 , 6 , 7 } };
9797
9898 nlohmann::json json;
9999 exporter.toJson (BT::Any (69 ), json[" int" ]);
@@ -135,9 +135,9 @@ TEST_F(JsonTest, TwoWaysConversion)
135135
136136TEST_F (JsonTest, CustomTime)
137137{
138- BT::JsonExporter & exporter = BT::JsonExporter::get ();
138+ BT::JsonExporter& exporter = BT::JsonExporter::get ();
139139
140- TestTypes::Time stamp = {3 , 8000000 };
140+ TestTypes::Time stamp = { 3 , 8000000 };
141141 nlohmann::json json;
142142 exporter.toJson (BT::Any (stamp), json);
143143 std::cout << json.dump () << std::endl;
@@ -180,7 +180,7 @@ TEST_F(JsonTest, BlackboardInOut)
180180 auto bb_in = BT::Blackboard::create ();
181181 bb_in->set (" int" , 42 );
182182 bb_in->set (" real" , 3.14 );
183- bb_in->set (" vect" , TestTypes::Vector3D{1.1 , 2.2 , 3.3 });
183+ bb_in->set (" vect" , TestTypes::Vector3D{ 1.1 , 2.2 , 3.3 });
184184
185185 auto json = ExportBlackboardToJSON (*bb_in);
186186 std::cout << json.dump (2 ) << std::endl;
@@ -199,7 +199,7 @@ TEST_F(JsonTest, BlackboardInOut)
199199
200200TEST_F (JsonTest, VectorOfCustomTypes)
201201{
202- BT::JsonExporter & exporter = BT::JsonExporter::get ();
202+ BT::JsonExporter& exporter = BT::JsonExporter::get ();
203203
204204 std::vector<TestTypes::Pose3D> poses (2 );
205205 poses[0 ].pos .x = 1 ;
@@ -241,7 +241,7 @@ TEST_F(JsonTest, VectorOfCustomTypes)
241241
242242 // check the two-ways transform, i.e. "from_json"
243243 auto poses2 =
244- exporter.fromJson (json[" poses" ])->first .cast <std::vector<TestTypes::Pose3D>>();
244+ exporter.fromJson (json[" poses" ])->first .cast <std::vector<TestTypes::Pose3D>>();
245245 ASSERT_EQ (poses.size (), poses2.size ());
246246 ASSERT_EQ (poses[0 ].pos .x , poses2[0 ].pos .x );
247247 ASSERT_EQ (poses[0 ].pos .y , poses2[0 ].pos .y );
0 commit comments