Skip to content
Snippets Groups Projects
Commit f0f746d5 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Merge branch 'fix/point-cloud-aron' into 'master'

Make point cloud in ARON work for PCL 1.8

See merge request sw/armarx/robot-api!341
parents 147feea3 9080882e
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment