Verified Commit 089f46b7 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

model: use JointModel as input for addJoint method

parent ae5d9ced
...@@ -350,9 +350,8 @@ namespace pinocchio ...@@ -350,9 +350,8 @@ namespace pinocchio
/// ///
/// \sa Model::appendBodyToJoint, Model::addJointFrame /// \sa Model::appendBodyToJoint, Model::addJointFrame
/// ///
template<typename JointModelDerived>
JointIndex addJoint(const JointIndex parent, JointIndex addJoint(const JointIndex parent,
const JointModelBase<JointModelDerived> & joint_model, const JointModel & joint_model,
const SE3 & joint_placement, const SE3 & joint_placement,
const std::string & joint_name, const std::string & joint_name,
const VectorXs & max_effort, const VectorXs & max_effort,
...@@ -378,12 +377,10 @@ namespace pinocchio ...@@ -378,12 +377,10 @@ namespace pinocchio
/// ///
/// \sa Model::appendBodyToJoint /// \sa Model::appendBodyToJoint
/// ///
template<typename JointModelDerived>
JointIndex addJoint(const JointIndex parent, JointIndex addJoint(const JointIndex parent,
const JointModelBase<JointModelDerived> & joint_model, const JointModel & joint_model,
const SE3 & joint_placement, const SE3 & joint_placement,
const std::string & joint_name const std::string & joint_name);
);
/// ///
/// \brief Add a joint to the frame tree. /// \brief Add a joint to the frame tree.
......
...@@ -55,10 +55,9 @@ namespace pinocchio ...@@ -55,10 +55,9 @@ namespace pinocchio
} }
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl> template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
template<typename JointModelDerived>
typename ModelTpl<Scalar,Options,JointCollectionTpl>::JointIndex typename ModelTpl<Scalar,Options,JointCollectionTpl>::JointIndex
ModelTpl<Scalar,Options,JointCollectionTpl>::addJoint(const JointIndex parent, ModelTpl<Scalar,Options,JointCollectionTpl>::addJoint(const JointIndex parent,
const JointModelBase<JointModelDerived> & joint_model, const JointModel & joint_model,
const SE3 & joint_placement, const SE3 & joint_placement,
const std::string & joint_name, const std::string & joint_name,
const VectorXs & max_effort, const VectorXs & max_effort,
...@@ -80,7 +79,8 @@ namespace pinocchio ...@@ -80,7 +79,8 @@ namespace pinocchio
JointIndex idx = (JointIndex)(njoints++); JointIndex idx = (JointIndex)(njoints++);
joints .push_back(JointModel(joint_model.derived())); joints .push_back(JointModel(joint_model.derived()));
JointModelDerived & jmodel = boost::get<JointModelDerived>(joints.back()); // JointModelDerived & jmodel = boost::get<JointModelDerived>(joints.back());
JointModel & jmodel = joints.back();
jmodel.setIndexes(idx,nq,nv); jmodel.setIndexes(idx,nq,nv);
const int joint_nq = jmodel.nq(); const int joint_nq = jmodel.nq();
...@@ -129,10 +129,9 @@ namespace pinocchio ...@@ -129,10 +129,9 @@ namespace pinocchio
} }
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl> template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
template<typename JointModelDerived>
typename ModelTpl<Scalar,Options,JointCollectionTpl>::JointIndex typename ModelTpl<Scalar,Options,JointCollectionTpl>::JointIndex
ModelTpl<Scalar,Options,JointCollectionTpl>::addJoint(const JointIndex parent, ModelTpl<Scalar,Options,JointCollectionTpl>::addJoint(const JointIndex parent,
const JointModelBase<JointModelDerived> & joint_model, const JointModel & joint_model,
const SE3 & joint_placement, const SE3 & joint_placement,
const std::string & joint_name) const std::string & joint_name)
{ {
......
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