Skip to content
Snippets Groups Projects
Commit a67e9370 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Handle removed toJSON()

parent 13b783fa
No related branches found
No related tags found
1 merge request!6Armem/dev
......@@ -15,6 +15,7 @@ armarx_add_library(core
types.cpp
Graph.cpp
aron_conversions.cpp
json_conversions.cpp
time/ChronoMonotonicTimeServer.cpp
HEADERS
types.h
......@@ -27,6 +28,7 @@ armarx_add_library(core
Graph.h
TopologicScene.h
aron_conversions.h
json_conversions.h
time/ChronoMonotonicTimeServer.h
time/TimeServerInterface.h
DEPENDENCIES
......
......@@ -31,6 +31,7 @@
#include <RobotAPI/libraries/armem/core/wm/memory_definitions.h>
#include <armarx/navigation/location/aron/Location.aron.generated.h>
#include <armarx/navigation/core/json_conversions.h>
namespace armarx::navigation::core
......@@ -80,7 +81,7 @@ namespace armarx::navigation::core
ss << " cost " << edge.attrib().cost()
<< ", type: " << static_cast<int>(edge.attrib().strategy) << " , has traj "
<< edge.attrib().trajectory.has_value() << ", aron: " << edge.attrib().aron.toJSON();
<< edge.attrib().trajectory.has_value() << ", aron: " << nlohmann::json(edge.attrib().aron);
return ss.str();
}
......
/**
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2021
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include "json_conversions.h"
#include <RobotAPI/libraries/aron/core/data/rw/writer/nlohmannJSON/NlohmannJSONWriter.h>
#include <RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReader.h>
namespace armarx::navigation::core
{
void arondto::to_json(nlohmann::json& j, const Edge& bo)
{
armarx::aron::data::writer::NlohmannJSONWriter writer;
j = bo.write(writer);
}
void arondto::from_json(const nlohmann::json& j, Edge& bo)
{
armarx::aron::data::reader::NlohmannJSONReader reader;
bo.read<armarx::aron::data::reader::NlohmannJSONReader::InputType>(reader, j);
}
} // namespace armarx::navigation::core
/**
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2021
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
#include <SimoxUtility/json/json.hpp>
#include <armarx/navigation/core/aron/Graph.aron.generated.h>
namespace armarx::navigation::core::arondto
{
void to_json(nlohmann::json& j, const arondto::Edge& bo);
void from_json(const nlohmann::json& j, arondto::Edge& bo);
} // namespace armarx::navigation::graph
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment