parent
b383f18365
commit
57d53b6d53
|
@ -126,22 +126,5 @@ proto::ConnectedComponents ToProto(
|
||||||
return proto;
|
return proto;
|
||||||
}
|
}
|
||||||
|
|
||||||
proto::ConnectedComponents::ConnectedComponent FindConnectedComponent(
|
|
||||||
const proto::ConnectedComponents& connected_components,
|
|
||||||
const int trajectory_id) {
|
|
||||||
for (const auto& connected_component :
|
|
||||||
connected_components.connected_component()) {
|
|
||||||
if (std::find(connected_component.trajectory_id().begin(),
|
|
||||||
connected_component.trajectory_id().end(),
|
|
||||||
trajectory_id) != connected_component.trajectory_id().end()) {
|
|
||||||
return connected_component;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
proto::ConnectedComponents::ConnectedComponent connected_component;
|
|
||||||
connected_component.add_trajectory_id(trajectory_id);
|
|
||||||
return connected_component;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace mapping
|
} // namespace mapping
|
||||||
} // namespace cartographer
|
} // namespace cartographer
|
||||||
|
|
|
@ -84,12 +84,6 @@ class ConnectedComponents {
|
||||||
proto::ConnectedComponents ToProto(
|
proto::ConnectedComponents ToProto(
|
||||||
std::vector<std::vector<int>> connected_components);
|
std::vector<std::vector<int>> connected_components);
|
||||||
|
|
||||||
// Returns the connected component containing 'trajectory_id'.
|
|
||||||
proto::ConnectedComponents::ConnectedComponent FindConnectedComponent(
|
|
||||||
const cartographer::mapping::proto::ConnectedComponents&
|
|
||||||
connected_components,
|
|
||||||
int trajectory_id);
|
|
||||||
|
|
||||||
} // namespace mapping
|
} // namespace mapping
|
||||||
} // namespace cartographer
|
} // namespace cartographer
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue