diff --git a/src/FrameSemantics.cc b/src/FrameSemantics.cc index e4d0aedad..40df3c4c4 100644 --- a/src/FrameSemantics.cc +++ b/src/FrameSemantics.cc @@ -77,6 +77,8 @@ FindSourceVertex(const ScopedGraph &_graph, using DirectedEdge = typename ScopedGraph::Edge; using Vertex = typename ScopedGraph::Vertex; using VertexId = gz::math::graph::VertexId; + using VertexType = typename ScopedGraph::VertexType; + using gz::math::graph::NullVertex; using EdgesType = std::vector; using PairType = std::pair; EdgesType edges; @@ -86,7 +88,7 @@ FindSourceVertex(const ScopedGraph &_graph, _errors.push_back({ErrorCode::POSE_RELATIVE_TO_INVALID, "Unable to resolve pose, invalid vertex[" + std::to_string(_id) + "] " "in PoseRelativeToGraph."}); - return PairType(Vertex::NullVertex, EdgesType()); + return PairType(NullVertex(), EdgesType()); } if (_id == _graph.ScopeVertexId()) @@ -106,7 +108,7 @@ FindSourceVertex(const ScopedGraph &_graph, _errors.push_back({ErrorCode::POSE_RELATIVE_TO_GRAPH_ERROR, "PoseRelativeToGraph error: multiple incoming edges to " "current vertex [" + vertex.get().Name() + "]."}); - return PairType(Vertex::NullVertex, EdgesType()); + return PairType(NullVertex(), EdgesType()); } auto const &edge = incidentsTo.begin()->second; vertex = _graph.Graph().VertexFromId(edge.get().Vertices().first); @@ -116,7 +118,7 @@ FindSourceVertex(const ScopedGraph &_graph, _errors.push_back({ErrorCode::POSE_RELATIVE_TO_CYCLE, "PoseRelativeToGraph cycle detected, already visited vertex [" + vertex.get().Name() + "]."}); - return PairType(Vertex::NullVertex, EdgesType()); + return PairType(NullVertex(), EdgesType()); } if (vertex.get().Id() == _graph.ScopeVertexId()) { @@ -129,7 +131,7 @@ FindSourceVertex(const ScopedGraph &_graph, if (vertex.get().Id() != _graph.ScopeVertexId()) { // Error, the root vertex is not the same as the the source - return PairType(Vertex::NullVertex, EdgesType()); + return PairType(NullVertex(), EdgesType()); } return PairType(vertex, edges); @@ -157,6 +159,8 @@ FindSinkVertex( using DirectedEdge = typename ScopedGraph::Edge; using Vertex = typename ScopedGraph::Vertex; using VertexId = gz::math::graph::VertexId; + using VertexType = typename ScopedGraph::VertexType; + using gz::math::graph::NullVertex; using EdgesType = std::vector; using PairType = std::pair; EdgesType edges; @@ -166,7 +170,7 @@ FindSinkVertex( _errors.push_back({ErrorCode::FRAME_ATTACHED_TO_INVALID, "Invalid vertex[" + std::to_string(_id) + "] " "in FrameAttachedToGraph."}); - return PairType(Vertex::NullVertex, EdgesType()); + return PairType(NullVertex(), EdgesType()); } std::set visited; @@ -180,7 +184,7 @@ FindSinkVertex( _errors.push_back({ErrorCode::FRAME_ATTACHED_TO_GRAPH_ERROR, "FrameAttachedToGraph error: multiple outgoing edges from " "current vertex [" + vertex.get().Name() + "]."}); - return PairType(Vertex::NullVertex, EdgesType()); + return PairType(NullVertex(), EdgesType()); } auto const &edge = incidentsFrom.begin()->second; vertex = _graph.Graph().VertexFromId(edge.get().Vertices().second); @@ -190,7 +194,7 @@ FindSinkVertex( _errors.push_back({ErrorCode::FRAME_ATTACHED_TO_CYCLE, "FrameAttachedToGraph cycle detected, already visited vertex [" + vertex.get().Name() + "]."}); - return PairType(Vertex::NullVertex, EdgesType()); + return PairType(NullVertex(), EdgesType()); } visited.insert(vertex.get().Id()); incidentsFrom = _graph.Graph().IncidentsFrom(vertex);