Skip to content
Snippets Groups Projects
Commit 08e51ccc authored by Your Name's avatar Your Name
Browse files

Merge remote-tracking branch 'origin/master' into...

Merge remote-tracking branch 'origin/master' into feature/move-laser-scanner-feature-extraction-to-navigation
parents 163a912c f0f746d5
No related branches found
No related tags found
1 merge request!327Remove laser scanner features memory
This commit is part of merge request !327. Comments created here will be created in the context of that merge request.
......@@ -31,6 +31,7 @@ namespace armarx::aron::codegenerator::cpp::generator
{
const std::map<type::matrix::ElementType, std::tuple<std::string, int, std::string>> ElementType2Cpp =
{
// TODO: rename to float32 etc. but keep backward compability
{type::matrix::INT16, {"short", 2, "::armarx::aron::type::matrix::INT16"}},
{type::matrix::INT32, {"int", 4, "::armarx::aron::type::matrix::INT32"}},
{type::matrix::INT64, {"long", 8, "::armarx::aron::type::matrix::INT64"}},
......
......@@ -102,7 +102,19 @@ namespace armarx::aron::codegenerator::cpp::generator
block_if_data->addLine("std::vector<int> " + dims + ";");
block_if_data->addLine("std::vector<unsigned char> " + data + ";");
block_if_data->addLine("" + ARON_READER_ACCESSOR + ".readNDArray("+variantAccessor+", "+dims+", "+type+", "+data+"); // of " + cppAccessor);
block_if_data->addLine(cppAccessor + " = " + getInstantiatedCppTypename() + "(" + dims + "[0], " + dims + "[1]);");
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+"'.\"));");
// 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