Commit 7c8abb68 authored by jcarpent's avatar jcarpent
Browse files

[Model] Change naming of rotor inertia

parent 47b34cac
//
// 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>()),
......
//
// 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.");
}
}
......
......@@ -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
......
//
// 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.
......
//
// 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
......
//
// 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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment