From 7c8abb688ce4840e6a0db9933abeb70922e0f668 Mon Sep 17 00:00:00 2001 From: jcarpent <jcarpent@laas.fr> Date: Wed, 7 Mar 2018 09:19:06 +0100 Subject: [PATCH] [Model] Change naming of rotor inertia --- bindings/python/multibody/model.hpp | 12 ++++++------ bindings/python/parsers/parsers.hpp | 10 ++++++---- src/multibody/model.hpp | 6 +++--- src/multibody/model.hxx | 6 +++--- src/parsers/srdf.cpp | 4 ++-- unittest/srdf.cpp | 4 ++-- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/bindings/python/multibody/model.hpp b/bindings/python/multibody/model.hpp index 20473bf2a..95e174014 100644 --- a/bindings/python/multibody/model.hpp +++ b/bindings/python/multibody/model.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2017 CNRS +// Copyright (c) 2015-2018 CNRS // Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France. // // This file is part of Pinocchio @@ -98,14 +98,14 @@ namespace se3 make_getter(&Model::neutralConfiguration, bp::return_value_policy<bp::return_by_value>()), make_setter(&Model::neutralConfiguration, bp::return_value_policy<bp::return_by_value>()), "Joint's neutral configurations.") - .add_property("rotorMass", - make_getter(&Model::rotorMass, bp::return_value_policy<bp::return_by_value>()), - make_setter(&Model::rotorMass, bp::return_value_policy<bp::return_by_value>()), - "Joint rotor masses.") + .add_property("rotorInertia", + make_getter(&Model::rotorInertia, bp::return_value_policy<bp::return_by_value>()), + make_setter(&Model::rotorInertia, bp::return_value_policy<bp::return_by_value>()), + "Vector of rotor inertia parameters.") .add_property("rotorGearRatio", make_getter(&Model::rotorGearRatio, bp::return_value_policy<bp::return_by_value>()), make_setter(&Model::rotorGearRatio, bp::return_value_policy<bp::return_by_value>()), - "Joint rotor gear ratios.") + "Vector of rotor gear ratio parameters.") .add_property("effortLimit", make_getter(&Model::effortLimit, bp::return_value_policy<bp::return_by_value>()), make_setter(&Model::effortLimit, bp::return_value_policy<bp::return_by_value>()), diff --git a/bindings/python/parsers/parsers.hpp b/bindings/python/parsers/parsers.hpp index edef44838..9b3e53294 100644 --- a/bindings/python/parsers/parsers.hpp +++ b/bindings/python/parsers/parsers.hpp @@ -1,5 +1,5 @@ - // -// Copyright (c) 2015-2016 CNRS +// +// Copyright (c) 2015-2018 CNRS // // This file is part of Pinocchio // Pinocchio is free software: you can redistribute it @@ -201,8 +201,10 @@ namespace se3 "Get the neutral configuration of a given model associated to a SRDF file"); bp::def("loadRotorParamsFromSrdf",loadRotorParamsFromSrdf, - bp::args("Model for which we are loading the rotor parameters","srdf filename (string)", "verbosity"), - "Load the rotor parameters of a given model from an SRDF file. Results are stored in model.rotorMass and model.rotorGearRatio."); + bp::args("Model for which we are loading the rotor parameters", + "srdf filename (string)", "verbosity"), + "Load the rotor parameters of a given model from an SRDF file.\n" + "Results are stored in model.rotorInertia and model.rotorGearRatio."); } } diff --git a/src/multibody/model.hpp b/src/multibody/model.hpp index 80fd32aae..b7eedbfed 100644 --- a/src/multibody/model.hpp +++ b/src/multibody/model.hpp @@ -78,10 +78,10 @@ namespace se3 /// \brief Vector of joint's neutral configurations Eigen::VectorXd neutralConfiguration; - /// \brief Vector of rotor masses - Eigen::VectorXd rotorMass; + /// \brief Vector of rotor inertia parameters + Eigen::VectorXd rotorInertia; - /// \brief Vector of rotor gear ratios + /// \brief Vector of rotor gear ratio parameters Eigen::VectorXd rotorGearRatio; /// \brief Vector of maximal joint torques diff --git a/src/multibody/model.hxx b/src/multibody/model.hxx index 398c4ba96..a533bc238 100644 --- a/src/multibody/model.hxx +++ b/src/multibody/model.hxx @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 CNRS +// Copyright (c) 2015-2018 CNRS // Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France. // // This file is part of Pinocchio @@ -95,10 +95,10 @@ namespace se3 neutralConfiguration.conservativeResize(nq); neutralConfiguration.tail(joint_model.nq()) = joint_model.neutralConfiguration(); - rotorMass.conservativeResize(nv); + rotorInertia.conservativeResize(nv); rotorGearRatio.conservativeResize(nv); - rotorMass.tail(joint_model.nv()).setZero(); + rotorInertia.tail(joint_model.nv()).setZero(); rotorGearRatio.tail(joint_model.nv()).setZero(); // Init and add joint index to its parent subtrees. diff --git a/src/parsers/srdf.cpp b/src/parsers/srdf.cpp index 42ef54215..22c7488db 100644 --- a/src/parsers/srdf.cpp +++ b/src/parsers/srdf.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 CNRS +// Copyright (c) 2017-2018 CNRS // // This file is part of Pinocchio // Pinocchio is free software: you can redistribute it @@ -192,7 +192,7 @@ namespace se3 { const JointModel & joint = model.joints[joint_id]; assert(joint.nv()==1); - model.rotorMass(joint.idx_v()) = rotor_mass; + model.rotorInertia(joint.idx_v()) = rotor_mass; model.rotorGearRatio(joint.idx_v()) = rotor_gr; // joint with 1 dof } else diff --git a/unittest/srdf.cpp b/unittest/srdf.cpp index b6524f4c1..060aa0fea 100644 --- a/unittest/srdf.cpp +++ b/unittest/srdf.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2016 CNRS +// Copyright (c) 2016-2018 CNRS // // This file is part of Pinocchio // Pinocchio is free software: you can redistribute it @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(readRotorParams) loadRotorParamsFromSrdf(model,srdf_filename,false); - BOOST_CHECK(model.rotorMass(model.joints[model.getJointId("HeadPitch")].idx_v())==1.0); + BOOST_CHECK(model.rotorInertia(model.joints[model.getJointId("HeadPitch")].idx_v())==1.0); BOOST_CHECK(model.rotorGearRatio(model.joints[model.getJointId("HeadRoll")].idx_v())==1.0); } -- GitLab