Commit 6b438a5c authored by Justin Carpentier's avatar Justin Carpentier

python/algo: expose new signatures of buildReducedModel

parent 64a202f4
......@@ -38,7 +38,40 @@ namespace pinocchio
return bp::make_tuple(model,geom_model);
}
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
bp::tuple
buildReducedModel(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
const GeometryModel & geom_model,
const std::vector<JointIndex> & list_of_joints_to_lock,
const Eigen::MatrixBase<ConfigVectorType> & reference_configuration)
{
typedef ModelTpl<Scalar,Options,JointCollectionTpl> Model;
Model reduced_model; GeometryModel reduced_geom_model;
buildReducedModel(model,geom_model,list_of_joints_to_lock,
reference_configuration,reduced_model,reduced_geom_model);
return bp::make_tuple(reduced_model,reduced_geom_model);
}
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
bp::tuple
buildReducedModel(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
const GeometryModel & geom_model,
const bp::list & list_of_joints_to_lock,
const Eigen::MatrixBase<ConfigVectorType> & reference_configuration)
{
typedef ModelTpl<Scalar,Options,JointCollectionTpl> Model;
Model reduced_model; GeometryModel reduced_geom_model;
const std::vector<JointIndex> vec_of_joints_to_lock = extract<JointIndex>(list_of_joints_to_lock);
buildReducedModel(model,geom_model,vec_of_joints_to_lock,
reference_configuration,reduced_model,reduced_geom_model);
return bp::make_tuple(reduced_model,reduced_geom_model);
}
void exposeModelAlgo()
{
using namespace Eigen;
......@@ -64,18 +97,54 @@ namespace pinocchio
" aMb: pose of modelB universe joint (index 0) in frameInModelA\n");
bp::def("buildReducedModel",
buildReducedModel_list<double,0,JointCollectionDefaultTpl,VectorXd>,
bp::args("model: input kinematic model",
"list_of_joints_to_lock: list of joint indexes to lock",
"reference_configuration: reference configuration to compute the placement of the lock joints"),
"Build a reduce model from a given input model and a list of joint to lock.");
(Model (*)(const Model &, const bp::list &, const Eigen::MatrixBase<VectorXd> &))
buildReducedModel<double,0,JointCollectionDefaultTpl,VectorXd>,
bp::args("model",
"list_of_joints_to_lock",
"reference_configuration"),
"Build a reduce model from a given input model and a list of joint to lock.\n\n"
" model: input kinematic modell to reduce\n"
" list_of_joints_to_lock: list of joint indexes to lock\n"
" reference_configuration: reference configuration to compute the placement of the lock joints\n");
bp::def("buildReducedModel",
(Model (*)(const Model &, const std::vector<JointIndex> &, const Eigen::MatrixBase<VectorXd> &))
&pinocchio::buildReducedModel<double,0,JointCollectionDefaultTpl,VectorXd>,
bp::args("model",
"list_of_joints_to_lock",
"reference_configuration"),
"Build a reduce model from a given input model and a list of joint to lock.\n\n"
" model: input kinematic modell to reduce\n"
" list_of_joints_to_lock: list of joint indexes to lock\n"
" reference_configuration: reference configuration to compute the placement of the lock joints\n");
bp::def("buildReducedModel",
(bp::tuple (*)(const Model &, const GeometryModel &, const std::vector<JointIndex> &, const Eigen::MatrixBase<VectorXd> &))
&buildReducedModel<double,0,JointCollectionDefaultTpl,VectorXd>,
bp::args("model",
"geom_model",
"list_of_joints_to_lock",
"reference_configuration"),
"Build a reduced model and a rededuced geometry model from a given input model,"
"a given input geometry model and a list of joint to lock.\n\n"
" model: input kinematic modell to reduce\n"
" geom_model: input geometry model to reduce\n"
" list_of_joints_to_lock: list of joint indexes to lock\n"
" reference_configuration: reference configuration to compute the placement of the lock joints\n");
bp::def("buildReducedModel",
(Model (*)(const Model &, const std::vector<JointIndex> &, const Eigen::MatrixBase<VectorXd> &))&buildReducedModel<double,0,JointCollectionDefaultTpl,VectorXd>,
bp::args("model: input kinematic model",
"list_of_joints_to_lock: list of joint indexes to lock",
"reference_configuration: reference configuration to compute the placement of the lock joints"),
"Build a reduce model from a given input model and a list of joint to lock.");
(bp::tuple (*)(const Model &, const GeometryModel &, const bp::list &, const Eigen::MatrixBase<VectorXd> &))
&buildReducedModel<double,0,JointCollectionDefaultTpl,VectorXd>,
bp::args("model",
"geom_model",
"list_of_joints_to_lock",
"reference_configuration"),
"Build a reduced model and a rededuced geometry model from a given input model,"
"a given input geometry model and a list of joint to lock.\n\n"
" model: input kinematic modell to reduce\n"
" geom_model: input geometry model to reduce\n"
" list_of_joints_to_lock: list of joint indexes to lock\n"
" reference_configuration: reference configuration to compute the placement of the lock joints\n");
}
......
Markdown is supported
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