Skip to content

Commit 5585175

Browse files
authored
Fix hash map check to prevent fetching duplicate meshes (#59)
* Fix hash map check to prevent fetching duplicate meshes 1. Fix check for existing mesh file key so as to avoid fetching duplicate meshes 2. Added check to avoid publishing empty array messages, which is can result from how we need to check for new scene objects using the Zenoh pubsub "/tf" topic Signed-off-by: John TGZ <[email protected]> * fix check on wrong field --------- Signed-off-by: John TGZ <[email protected]>
1 parent 0d2f469 commit 5585175

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

flowstate_ros_bridge/src/bridges/world_bridge.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ absl::Status WorldBridge::Data::SendObjectVisualizationMessages(
191191
"gltf/%s_%s.glb",
192192
geometry.geometry_storage_refs().geometry_ref().substr(9),
193193
geometry.geometry_storage_refs().renderable_ref().substr(9));
194-
if (renderables_.contains(gltf_path)) {
194+
if (renderables_.contains(std::string("/") + gltf_path)) {
195195
continue;
196196
}
197197

@@ -265,7 +265,10 @@ absl::Status WorldBridge::Data::SendObjectVisualizationMessages(
265265
}
266266
LOG(INFO) << "Total gltf size: " << total_gltf_size << " bytes";
267267

268-
workcell_markers_pub_->publish(array_msg);
268+
if (!array_msg.markers.empty()){
269+
workcell_markers_pub_->publish(array_msg);
270+
}
271+
269272
return absl::OkStatus();
270273
}
271274

0 commit comments

Comments
 (0)