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

refactor bounding box indices for flatbuffer point clouds #195

Open
jarkenau opened this issue Oct 12, 2022 · 0 comments
Open

refactor bounding box indices for flatbuffer point clouds #195

jarkenau opened this issue Oct 12, 2022 · 0 comments
Labels

Comments

@jarkenau
Copy link
Member

Refactor adding of the bounding box indices. The indies are computed during write of the x,y,z point in writePoints(...) of writePointClouds(...). But since the CoreFb conversion needs to happen first to get the dataUUID of the point cloud, we can only add the bounding box as below. Usually the bounding Box should be set in the `CoreFb conversion as the other indices.

boost::uuids::uuid CoreFbPointCloud::addData(const seerep::fb::PointCloud2& pc)
{
  std::vector<float> boundingBox;

  seerep_core_msgs::DatasetIndexable dataForIndices = CoreFbConversion::fromFb(pc);

  auto hdf5io = CoreFbGeneral::getHdf5(dataForIndices.header.uuidProject, m_seerepCore, m_hdf5IoMap);
  hdf5io->writePointCloud2(boost::lexical_cast<std::string>(dataForIndices.header.uuidData), pc, boundingBox);

  dataForIndices.boundingbox.min_corner().set<0>(boundingBox[0]);
  dataForIndices.boundingbox.min_corner().set<1>(boundingBox[1]);
  dataForIndices.boundingbox.min_corner().set<2>(boundingBox[2]);
  dataForIndices.boundingbox.max_corner().set<0>(boundingBox[3]);
  dataForIndices.boundingbox.max_corner().set<1>(boundingBox[4]);
  dataForIndices.boundingbox.max_corner().set<2>(boundingBox[5]);

  m_seerepCore->addDataset(dataForIndices);

  return dataForIndices.header.uuidData;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant