Skip to content
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
38 changes: 20 additions & 18 deletions flowstate_ros_bridge/src/bridges/world_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,26 +191,28 @@ absl::Status WorldBridge::Data::SendObjectVisualizationMessages(
"gltf/%s_%s.glb",
geometry.geometry_storage_refs().geometry_ref().substr(9),
geometry.geometry_storage_refs().renderable_ref().substr(9));
if (renderables_.contains(std::string("/") + gltf_path)) {
continue;
}

const absl::StatusOr<std::string> gltf = world_->GetGltf(
geometry.geometry_storage_refs().geometry_ref(),
geometry.geometry_storage_refs().renderable_ref());
if (!gltf.ok()) {
LOG(ERROR) << "Unable to fetch renderable for " << tf_frame_name
<< ": " << gltf.status();
continue;
const auto renderable_name = std::string("/") + gltf_path;
auto renderables_it = renderables_.find(renderable_name);

if (renderables_it == renderables_.end()) {
const absl::StatusOr<std::string> gltf = world_->GetGltf(
geometry.geometry_storage_refs().geometry_ref(),
geometry.geometry_storage_refs().renderable_ref());
if (!gltf.ok()) {
LOG(ERROR) << "Unable to fetch renderable for " << tf_frame_name
<< ": " << gltf.status();
continue;
}
total_gltf_size += gltf->size();
std::vector<uint8_t> gltf_data;
gltf_data.resize(gltf->size());
memcpy(&gltf_data[0], gltf->data(), gltf->size());

LOG(INFO) << "Fetched " << gltf->size() << " bytes for "
<< tf_frame_name;
renderables_it = renderables_.emplace(renderable_name, std::move(gltf_data)).first;
}
total_gltf_size += gltf->size();
std::vector<uint8_t> gltf_data;
gltf_data.resize(gltf->size());
memcpy(&gltf_data[0], gltf->data(), gltf->size());

renderables_[std::string("/") + gltf_path] = std::move(gltf_data);
LOG(INFO) << "Fetched " << gltf->size() << " bytes for "
<< tf_frame_name;

const absl::StatusOr<intrinsic::eigenmath::MatrixXd> transform_xd =
intrinsic_proto::FromProto(geometry.ref_t_shape_aff());
Expand Down
Loading