Verified Commit be18ca50 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

multibody/joints: remove finiteDifferenceIncrement methods

parent c98a2a40
......@@ -410,15 +410,6 @@ struct CastType< NewScalar, JointModelTpl<Scalar,Options> > \
derived().calc_aba(data, PINOCCHIO_EIGEN_CONST_CAST(Matrix6Type,I), update_I);
}
///
/// \brief Return the resolution of the finite differerence increment according to the Scalar type
/// \remark Ideally, this function must depend on the value of q
///
/// \returns The finite difference increment.
///
Scalar finiteDifferenceIncrement() const
{ return derived().finiteDifferenceIncrement(); }
JointIndex i_id; // ID of the joint in the multibody list.
int i_q; // Index of the joint configuration in the joint configuration vector.
int i_v; // Index of the joint velocity in the joint velocity vector.
......
......@@ -76,17 +76,6 @@ namespace pinocchio
const Eigen::MatrixBase<Matrix6Type> & I,
const bool update_I);
///
/// \brief Returns the finite difference increment of the joint model.
///
/// \param[in] jmodel The model of the joint.
///
/// \returns The finite diffrence increment.
///
template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
inline Scalar
finiteDifferenceIncrement(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
/**
* @brief Visit a JointModelTpl through JointNvVisitor to get the dimension of
* the joint tangent space
......
......@@ -139,28 +139,6 @@ namespace pinocchio
Algo::run(jmodel, jdata, typename Algo::ArgsType(I_, update_I) );
}
template<typename OutScalar>
struct JointEpsVisitor
: boost::static_visitor<OutScalar>
{
template<typename JointModelDerived>
OutScalar operator()(const JointModelBase<JointModelDerived> & jmodel) const
{ return jmodel.finiteDifferenceIncrement(); }
template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
static OutScalar run(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel)
{ return boost::apply_visitor(JointEpsVisitor(),jmodel); }
}; // struct JointEpsVisitor
template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
inline Scalar
finiteDifferenceIncrement(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel)
{
return JointEpsVisitor<Scalar>::run(jmodel);
}
/**
* @brief JointNvVisitor visitor
*/
......
......@@ -282,17 +282,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
}
Scalar finiteDifferenceIncrement() const
{
using std::max;
Scalar eps = 0;
for(typename JointModelVector::const_iterator it = joints.begin();
it != joints.end(); ++it)
eps = max((Scalar)::pinocchio::finiteDifferenceIncrement(*it),eps);
return eps;
}
int nv_impl() const { return m_nv; }
int nq_impl() const { return m_nq; }
......
......@@ -298,12 +298,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I).setZero();
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
}
static std::string classname() { return std::string("JointModelFreeFlyer"); }
std::string shortname() const { return classname(); }
......
......@@ -515,12 +515,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
}
static std::string classname() { return std::string("JointModelPlanar");}
std::string shortname() const { return classname(); }
......
......@@ -499,12 +499,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return sqrt(Eigen::NumTraits<Scalar>::epsilon());
}
static std::string classname() { return std::string("JointModelPrismaticUnaligned"); }
std::string shortname() const { return classname(); }
......
......@@ -544,12 +544,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return sqrt(Eigen::NumTraits<Scalar>::epsilon());
}
static std::string classname()
{
return std::string("JointModelP") + axisLabel<axis>();
......
......@@ -516,12 +516,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
}
static std::string classname() { return std::string("JointModelRevoluteUnaligned"); }
std::string shortname() const { return classname(); }
......
......@@ -136,12 +136,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
}
static std::string classname()
{
return std::string("JointModelRUB") + axisLabel<axis>();
......
......@@ -623,12 +623,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
}
static std::string classname()
{
return std::string("JointModelR") + axisLabel<axis>();
......
......@@ -397,12 +397,6 @@ namespace pinocchio
PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
}
static std::string classname() { return std::string("JointModelSphericalZYX"); }
std::string shortname() const { return classname(); }
......
......@@ -488,12 +488,6 @@ namespace pinocchio
}
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
}
static std::string classname() { return std::string("JointModelSpherical"); }
std::string shortname() const { return classname(); }
......
......@@ -530,12 +530,6 @@ namespace pinocchio
}
}
Scalar finiteDifferenceIncrement() const
{
using math::sqrt;
return sqrt(Eigen::NumTraits<Scalar>::epsilon());
}
static std::string classname() { return std::string("JointModelTranslation"); }
std::string shortname() const { return classname(); }
......
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