Skip to content

Commit

Permalink
Revert "FrameSemantics: fix NullVertex warnings (#1458)"
Browse files Browse the repository at this point in the history
This reverts commit e40331e.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Jul 17, 2024
1 parent e40331e commit 94a9c30
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/FrameSemantics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ FindSourceVertex(const ScopedGraph<T> &_graph,
using DirectedEdge = typename ScopedGraph<T>::Edge;
using Vertex = typename ScopedGraph<T>::Vertex;
using VertexId = gz::math::graph::VertexId;
using VertexType = typename ScopedGraph<T>::VertexType;
using gz::math::graph::NullVertex;
using EdgesType = std::vector<DirectedEdge>;
using PairType = std::pair<const Vertex &, EdgesType>;
EdgesType edges;
Expand All @@ -88,7 +86,7 @@ FindSourceVertex(const ScopedGraph<T> &_graph,
_errors.push_back({ErrorCode::POSE_RELATIVE_TO_INVALID,
"Unable to resolve pose, invalid vertex[" + std::to_string(_id) + "] "
"in PoseRelativeToGraph."});
return PairType(NullVertex<VertexType>(), EdgesType());
return PairType(Vertex::NullVertex, EdgesType());
}

if (_id == _graph.ScopeVertexId())
Expand All @@ -108,7 +106,7 @@ FindSourceVertex(const ScopedGraph<T> &_graph,
_errors.push_back({ErrorCode::POSE_RELATIVE_TO_GRAPH_ERROR,
"PoseRelativeToGraph error: multiple incoming edges to "
"current vertex [" + vertex.get().Name() + "]."});
return PairType(NullVertex<VertexType>(), EdgesType());
return PairType(Vertex::NullVertex, EdgesType());
}
auto const &edge = incidentsTo.begin()->second;
vertex = _graph.Graph().VertexFromId(edge.get().Vertices().first);
Expand All @@ -118,7 +116,7 @@ FindSourceVertex(const ScopedGraph<T> &_graph,
_errors.push_back({ErrorCode::POSE_RELATIVE_TO_CYCLE,
"PoseRelativeToGraph cycle detected, already visited vertex [" +
vertex.get().Name() + "]."});
return PairType(NullVertex<VertexType>(), EdgesType());
return PairType(Vertex::NullVertex, EdgesType());
}
if (vertex.get().Id() == _graph.ScopeVertexId())
{
Expand All @@ -131,7 +129,7 @@ FindSourceVertex(const ScopedGraph<T> &_graph,
if (vertex.get().Id() != _graph.ScopeVertexId())
{
// Error, the root vertex is not the same as the the source
return PairType(NullVertex<VertexType>(), EdgesType());
return PairType(Vertex::NullVertex, EdgesType());
}

return PairType(vertex, edges);
Expand Down Expand Up @@ -159,8 +157,6 @@ FindSinkVertex(
using DirectedEdge = typename ScopedGraph<T>::Edge;
using Vertex = typename ScopedGraph<T>::Vertex;
using VertexId = gz::math::graph::VertexId;
using VertexType = typename ScopedGraph<T>::VertexType;
using gz::math::graph::NullVertex;
using EdgesType = std::vector<DirectedEdge>;
using PairType = std::pair<const Vertex &, EdgesType>;
EdgesType edges;
Expand All @@ -170,7 +166,7 @@ FindSinkVertex(
_errors.push_back({ErrorCode::FRAME_ATTACHED_TO_INVALID,
"Invalid vertex[" + std::to_string(_id) + "] "
"in FrameAttachedToGraph."});
return PairType(NullVertex<VertexType>(), EdgesType());
return PairType(Vertex::NullVertex, EdgesType());
}

std::set<VertexId> visited;
Expand All @@ -184,7 +180,7 @@ FindSinkVertex(
_errors.push_back({ErrorCode::FRAME_ATTACHED_TO_GRAPH_ERROR,
"FrameAttachedToGraph error: multiple outgoing edges from "
"current vertex [" + vertex.get().Name() + "]."});
return PairType(NullVertex<VertexType>(), EdgesType());
return PairType(Vertex::NullVertex, EdgesType());
}
auto const &edge = incidentsFrom.begin()->second;
vertex = _graph.Graph().VertexFromId(edge.get().Vertices().second);
Expand All @@ -194,7 +190,7 @@ FindSinkVertex(
_errors.push_back({ErrorCode::FRAME_ATTACHED_TO_CYCLE,
"FrameAttachedToGraph cycle detected, already visited vertex [" +
vertex.get().Name() + "]."});
return PairType(NullVertex<VertexType>(), EdgesType());
return PairType(Vertex::NullVertex, EdgesType());
}
visited.insert(vertex.get().Id());
incidentsFrom = _graph.Graph().IncidentsFrom(vertex);
Expand Down

0 comments on commit 94a9c30

Please sign in to comment.