Skip to content
Snippets Groups Projects

Make point cloud in ARON work for PCL 1.8

Merged Rainer Kartmann requested to merge fix/point-cloud-aron into master
1 file
+ 9
1
Compare changes
  • Side-by-side
  • Inline
@@ -106,7 +106,15 @@ namespace armarx::aron::codegenerator::cpp::generator
block_if_data->addLine("ARMARX_CHECK_AND_THROW(" + dims + ".size() == 3, ::armarx::aron::error::AronException(__PRETTY_FUNCTION__, \"Received wrong dimensions for member '"+cppAccessor+"'.\"));");
block_if_data->addLine("ARMARX_CHECK_AND_THROW(" + type + " == \"" + std::get<0>(VoxelType2Cpp.at(this->type.getVoxelType())) + "\", ::armarx::aron::error::AronException(__PRETTY_FUNCTION__, \"Received wrong type for member '"+cppAccessor+"'.\"));");
block_if_data->addLine(cppAccessor + nextEl() + "assign(" + dims + "[0], " + dims + "[1], " + std::get<0>(VoxelType2Cpp.at(this->type.getVoxelType())) + "());");
// assign is not availablePCL for PCL 1.8
// block_if_data->addLine(cppAccessor + nextEl() + "assign(" + dims + "[0], " + dims + "[1], " + std::get<0>(VoxelType2Cpp.at(this->type.getVoxelType())) + "());");
block_if_data->addLine(cppAccessor + nextEl() + "clear();");
// resize(width, height , value) is not available either
// block_if_data->addLine(cppAccessor + nextEl() + "resize(" + dims + "[0], " + dims + "[1], " + std::get<0>(VoxelType2Cpp.at(this->type.getVoxelType())) + "()));");
block_if_data->addLine(cppAccessor + nextEl() + "resize(" + dims + "[0] * " + dims + "[1]);");
block_if_data->addLine(cppAccessor + nextEl() + "width = " + dims + "[0];");
block_if_data->addLine(cppAccessor + nextEl() + "height = " + dims + "[1];");
block_if_data->addLine("std::memcpy(reinterpret_cast<unsigned char*>(" + cppAccessor + nextEl() + "points.data()), "+data+".data(), "+data+".size());");
return resolveMaybeReadBlock(block_if_data, cppAccessor, variantAccessor);
}
Loading