Commit 35f86f22 authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

[sample models] Using joint composite in random humanoid

parent 4afcb422
......@@ -41,10 +41,10 @@ namespace se3
if(setRandomLimits)
idx = model.addJoint(model.getJointId(parent_name),joint,
placement, name + "_joint",
TV::Random() + TV::Constant(1), // effort
TV::Random() + TV::Constant(1), // vel
CV::Random() - CV::Constant(1), // qmin
CV::Random() + CV::Constant(1) // qmax
TV::Random(joint.nv(),1) + TV::Constant(joint.nv(),1,1), // effort
TV::Random(joint.nv(),1) + TV::Constant(joint.nv(),1,1), // vel
CV::Random(joint.nq(),1) - CV::Constant(joint.nq(),1,1), // qmin
CV::Random(joint.nq(),1) + CV::Constant(joint.nq(),1,1) // qmax
);
else
idx = model.addJoint(model.getJointId(parent_name),joint,
......@@ -89,12 +89,9 @@ namespace se3
// root
if(! usingFF )
{
addJointAndBody(model, JointModelPX(), "universe", "ff1", Id);
addJointAndBody(model, JointModelPY(), "ff1_joint", "ff2", Id);
addJointAndBody(model, JointModelPZ(), "ff2_joint", "ff3", Id);
addJointAndBody(model, JointModelRZ(), "ff3_joint", "ff4", Id);
addJointAndBody(model, JointModelRY(), "ff4_joint", "ff5", Id);
addJointAndBody(model, JointModelRX(), "ff5_joint", "root", Id);
JointModelComposite jff((JointModelTranslation()));
jff.addJoint(JointModelSphericalZYX());
addJointAndBody(model, jff, "universe", "root", Id);
}
else
addJointAndBody(model, JointModelFreeFlyer(), "universe", "root", Id);
......
......@@ -68,7 +68,8 @@ namespace se3
* rather define a plain and non-random model.
* \param model: model, typically given empty, where the kinematic chain is added.
* \param usingFF: if True, implement the chain with a plain JointModelFreeFloating; if False,
* uses 3 prismatic + 3 revolute joints. This changes the size of the configuration space (33 vs 32).
* uses a composite joint translation + roll-pitch-yaw.
* This changes the size of the configuration space (33 vs 32).
*/
void humanoidRandom(Model& model, bool usingFF = true);
......
......@@ -31,7 +31,7 @@
BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
BOOST_AUTO_TEST_CASE ( build_model_sample_humanoid_simple )
BOOST_AUTO_TEST_CASE ( build_model_sample_humanoid_random )
{
se3::Model model;
se3::buildModels::humanoidRandom(model,true);
......
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