34 #include <armarx/navigation/core/aron/Location.aron.generated.h>
48 return aron.locationID.providerSegmentName +
"/" +
aron.locationID.entityName;
54 return not(
aron.locationID.providerSegmentName.empty() and
55 aron.locationID.entityName.empty());
61 return _pose.has_value();
82 <<
"Pose for vertex '" <<
getName() <<
"' must be in the global frame. Agent is '"
83 << _pose->agent <<
"'.";
85 <<
"Pose for vertex '" <<
getName() <<
"' must be in the global frame. Frame is '"
86 << _pose->frame <<
"'.";
87 return Pose(_pose->toEigen());
94 ss << semrel::RelationGraph<VertexAttribs, EdgeAttribs, GraphAttribs>::strEdge(edge);
96 ss <<
" cost " << edge.attrib().cost()
97 <<
", type: " <<
static_cast<int>(edge.attrib().strategy) <<
" , has traj "
98 << edge.attrib().trajectory.has_value();
112 std::vector<core::GraphPath>
115 std::set<core::Graph::VertexDescriptor> visited)
117 using namespace core;
120 if (visited.count(vertex.descriptor()) > 0)
125 visited.insert(vertex.descriptor());
127 std::vector<GraphPath> paths;
129 paths.push_back({vertex});
138 for (
const auto edge : vertex.inEdges())
140 std::vector<GraphPath> pathsToSource =
findPathsTo(edge.source(), graph, visited);
141 for (
auto path : pathsToSource)
145 ARMARX_CHECK(std::find(path.begin(), path.end(), vertex) == path.end());
148 path.push_back(vertex);
150 paths.push_back(path);
158 std::vector<core::GraphPath>
161 std::set<Graph::VertexDescriptor> visited;
169 for (
auto vertex :
bo.vertices())
171 auto&
v = dto.vertices.emplace_back(vertex.attrib().aron);
172 v.vertexID =
static_cast<long>(vertex.objectID());
176 for (
auto edge :
bo.edges())
178 auto& e = dto.edges.emplace_back(edge.attrib().aron);
179 e.sourceVertexID =
static_cast<long>(edge.sourceObjectID());
180 e.targetVertexID =
static_cast<long>(edge.targetObjectID());
185 core::Graph::ConstVertex
188 auto vertices = graph.vertices();
189 const auto vertexIt =
190 std::find_if(vertices.begin(),
192 [&vertexName](
const core::Graph::ConstVertex& vertex) ->
bool
193 { return vertex.attrib().getName() == vertexName; });
196 <<
"No vertex found with id `" << vertexName <<
"`";
203 auto vertices = graph.vertices();
204 return std::any_of(vertices.begin(),
206 [&vertexName](
const core::Graph::ConstVertex& vertex) ->
bool
207 { return vertex.attrib().getName() == vertexName; });
213 auto graphIt = std::find_if(graphs.begin(),
216 { return hasVertex(vertexName, graph); });
219 <<
"No subgraph found for vertex `" << vertexName <<
"`";
227 for (
const arondto::Vertex& vertex : dto.vertices)
229 auto v =
bo.addVertex(semrel::ShapeID(vertex.vertexID));
230 v.attrib().aron = vertex;
234 for (
const arondto::Edge& edge : dto.edges)
236 auto e =
bo.addEdge(semrel::ShapeID(edge.sourceVertexID),
237 semrel::ShapeID(edge.targetVertexID));
238 e.attrib().aron = edge;
246 navigation::location::arondto::Location dto;
247 dto.fromAron(locationData);
251 vertex.attrib().setPose(pose);