From 46aa32cc4425762dc5e9227b12d12fd3aa2cbfe3 Mon Sep 17 00:00:00 2001 From: Arnaud TANGUY Date: Thu, 1 Feb 2024 18:20:13 +0100 Subject: [PATCH] [visual] Remove Geometry.scale --- src/parsers/RBDyn/parsers/common.h | 3 +-- src/parsers/urdf.cpp | 4 +--- tests/ParsersTestUtils.h | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/parsers/RBDyn/parsers/common.h b/src/parsers/RBDyn/parsers/common.h index efdda313..d5387123 100644 --- a/src/parsers/RBDyn/parsers/common.h +++ b/src/parsers/RBDyn/parsers/common.h @@ -43,10 +43,9 @@ struct RBDYN_PARSERS_DLLAPI Geometry public: struct Mesh { - Mesh() : scaleV(Eigen::Vector3d::Ones()), scale(1) {} + Mesh() : scaleV(Eigen::Vector3d::Ones()) {} std::string filename; Eigen::Vector3d scaleV; - double scale; }; struct Box { diff --git a/src/parsers/urdf.cpp b/src/parsers/urdf.cpp index 61733e11..7212a5d6 100644 --- a/src/parsers/urdf.cpp +++ b/src/parsers/urdf.cpp @@ -238,13 +238,11 @@ Geometry::Data geometryFromMesh(const tinyxml2::XMLElement & meshDom) if(maybeScaleV.size() == 3) { mesh.scaleV = Eigen::Map(maybeScaleV.data(), 3); - mesh.scale = mesh.scaleV[2]; } else { assert(maybeScaleV.size() == 1); - mesh.scale = maybeScaleV[0]; - mesh.scaleV.setConstant(mesh.scale); + mesh.scaleV.setConstant(maybeScaleV[0]); } return mesh; } diff --git a/tests/ParsersTestUtils.h b/tests/ParsersTestUtils.h index dcba25cf..f6a56651 100644 --- a/tests/ParsersTestUtils.h +++ b/tests/ParsersTestUtils.h @@ -77,14 +77,12 @@ inline rbd::parsers::ParserResult createRobot() rbd::parsers::Geometry::Mesh mesh; v1.origin = create_ptransform(0.1, 0.2, 0.3, 0, 0, 0); mesh.filename = "file://test_mesh1.dae"; - mesh.scale = 1.0; mesh.scaleV = Eigen::Vector3d::Ones(); v1.geometry.type = rbd::parsers::Geometry::Type::MESH; v1.geometry.data = mesh; v2.origin = create_ptransform(0, 0, 0, 0, 0, 0); mesh.filename = "file://test_mesh2.dae"; - mesh.scale = 0.1; mesh.scaleV = Eigen::Vector3d(0.1, -0.1, 0.1); v2.geometry.type = rbd::parsers::Geometry::Type::MESH; v2.geometry.data = mesh; @@ -168,7 +166,7 @@ namespace parsers inline bool operator==(const Geometry::Mesh & m1, const Geometry::Mesh & m2) { - return m1.scaleV == m2.scaleV && m1.scale == m2.scale && m1.filename == m2.filename; + return m1.scaleV == m2.scaleV && m1.filename == m2.filename; } inline bool operator==(const Geometry::Box & b1, const Geometry::Box & b2)