Skip to content

Commit 4b62754

Browse files
authored
Merge pull request #66 from ethz-asl/fix/meshing_without_visualization
move meshing into tracking to guarantee tracks work also without visu…
2 parents 5f84816 + aac3496 commit 4b62754

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

panoptic_mapping/src/tracking/projective_id_tracker.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,16 @@ bool ProjectiveIDTracker::classesMatch(int input_id, int submap_class_id) {
238238
TrackingInfoAggregator ProjectiveIDTracker::computeTrackingData(
239239
SubmapCollection* submaps, InputData* input) {
240240
// Render each active submap in parallel to collect overlap statistics.
241-
SubmapIndexGetter index_getter(
242-
globals_->camera()->findVisibleSubmapIDs(*submaps, input->T_M_C()));
241+
const std::vector<int> visible_submaps =
242+
globals_->camera()->findVisibleSubmapIDs(*submaps, input->T_M_C());
243+
244+
// Make sure the meshes of all submaps are update for tracking.
245+
for (int submap_id : visible_submaps) {
246+
submaps->getSubmapPtr(submap_id)->updateMesh();
247+
}
248+
249+
// Render each submap in parallel.
250+
SubmapIndexGetter index_getter(visible_submaps);
243251
std::vector<std::future<std::vector<TrackingInfo>>> threads;
244252
TrackingInfoAggregator tracking_data;
245253
for (int i = 0; i < config_.rendering_threads; ++i) {

panoptic_mapping_ros/src/visualization/submap_visualizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ std::vector<voxblox_msgs::MultiMesh> SubmapVisualizer::generateMeshMsgs(
185185
msg.header.frame_id = submap.getFrameName();
186186
msg.name_space = info.name_space;
187187

188-
// Update the mesh.
188+
// NOTE(schmluk): The mesh should already be updated. Since only changed
189+
// blocks will be re-meshed this double check should be cheap.
189190
submap.updateMesh();
190191

191192
// Mark the whole mesh for re-publishing if requested.

0 commit comments

Comments
 (0)