Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "FrameSemantics: fix NullVertex warnings (#1458)" #1459

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading