Skip to content

Commit

Permalink
[visual] Remove Geometry.scale
Browse files Browse the repository at this point in the history
  • Loading branch information
arntanguy committed Feb 2, 2024
1 parent 4959b96 commit 46aa32c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/parsers/RBDyn/parsers/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 1 addition & 3 deletions src/parsers/urdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,11 @@ Geometry::Data geometryFromMesh(const tinyxml2::XMLElement & meshDom)
if(maybeScaleV.size() == 3)
{
mesh.scaleV = Eigen::Map<Eigen::Vector3d>(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;
}
Expand Down
4 changes: 1 addition & 3 deletions tests/ParsersTestUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 46aa32c

Please sign in to comment.