Commit 79c938f5 authored by Justin Carpentier's avatar Justin Carpentier

joints: add default value for JointData constructors

parent 6aab7e0f
......@@ -77,9 +77,12 @@ namespace pinocchio
JointDataCompositeTpl()
: joints()
, iMlast(0), pjMi(0)
, iMlast(0)
, pjMi(0)
, S(0)
, M(),v(),c()
, M(Transformation_t::Identity())
, v(Motion_t::Zero())
, c(Motion_t::Zero())
, U(6,0), Dinv(0,0), UDinv(6,0)
, StU(0,0)
{}
......@@ -87,10 +90,14 @@ namespace pinocchio
JointDataCompositeTpl(const JointDataVector & joint_data, const int /*nq*/, const int nv)
: joints(joint_data), iMlast(joint_data.size()), pjMi(joint_data.size())
, S(nv)
, M(), v(), c()
, U(6,nv), Dinv(nv,nv), UDinv(6,nv)
, StU(nv,nv)
, S(Constraint_t::Zero(nv))
, M(Transformation_t::Identity())
, v(Motion_t::Zero())
, c(Motion_t::Zero())
, U(U_t::Zero(6,nv))
, Dinv(D_t::Zero(nv,nv))
, UDinv(UD_t::Zero(6,nv))
, StU(D_t::Zero(nv,nv))
{}
/// \brief Vector of joints
......
......@@ -189,7 +189,8 @@ namespace pinocchio
UD_t UDinv;
JointDataFreeFlyerTpl()
: M(1)
: M(Transformation_t::Identity())
, v(Motion_t::Zero())
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Identity())
......
......@@ -101,7 +101,9 @@ namespace pinocchio
D_t Dinv() const { return dinv_inertia(*this); }
UD_t UDinv() const { return udinv_inertia(*this); }
JointDataTpl() : JointDataVariant() {}
JointDataTpl()
: JointDataVariant()
{}
JointDataTpl(const JointDataVariant & jdata_variant)
: JointDataVariant(jdata_variant)
......
......@@ -71,6 +71,10 @@ namespace pinocchio
ScaledConstraint() {}
explicit ScaledConstraint(const Scalar & scaling_factor)
: m_scaling_factor(scaling_factor)
{}
ScaledConstraint(const Constraint & constraint,
const Scalar & scaling_factor)
: m_constraint(constraint)
......@@ -280,7 +284,12 @@ namespace pinocchio
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
JointDataMimic() {}
JointDataMimic()
: m_scaling((Scalar)0)
, m_q_transform(ConfigVector_t::Zero())
, m_v_transform(TangentVector_t::Zero())
, S((Scalar)0)
{}
JointDataMimic(const JointDataBase<JointData> & jdata,
const Scalar & scaling)
......
......@@ -449,7 +449,8 @@ namespace pinocchio
D_t StU;
JointDataPlanarTpl ()
: M(1)
: M(Transformation_t::Identity())
, v(Motion_t::Vector3::Zero())
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
......
......@@ -452,7 +452,10 @@ namespace pinocchio
UD_t UDinv;
JointDataPrismaticUnalignedTpl()
: U(U_t::Zero())
: M(Transformation_t::Vector3::Zero())
, S(Constraint_t::Vector3::Zero())
, v(Constraint_t::Vector3::Zero(),(Scalar)0)
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
......
......@@ -550,7 +550,9 @@ namespace pinocchio
UD_t UDinv;
JointDataPrismaticTpl()
: U(U_t::Zero())
: M((Scalar)0)
, v((Scalar)0)
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
......
......@@ -478,17 +478,22 @@ namespace pinocchio
UD_t UDinv;
JointDataRevoluteUnalignedTpl()
: U(U_t::Zero())
: M(Transformation_t::Identity())
, S(Constraint_t::Vector3::Zero())
, v(Constraint_t::Vector3::Zero(),(Scalar)0)
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
template<typename Vector3Like>
JointDataRevoluteUnalignedTpl(const Eigen::MatrixBase<Vector3Like> & axis)
: M(1)
: M(Transformation_t::Identity())
, S(axis)
, v(axis,(Scalar)NAN)
, U(), Dinv(), UDinv()
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
static std::string classname() { return std::string("JointDataRevoluteUnaligned"); }
......
......@@ -74,17 +74,22 @@ namespace pinocchio
UD_t UDinv;
JointDataRevoluteUnboundedUnalignedTpl()
: U(U_t::Zero())
: M(Transformation_t::Identity())
, S(Constraint_t::Vector3::Zero())
, v(Constraint_t::Vector3::Zero(),(Scalar)0)
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
template<typename Vector3Like>
JointDataRevoluteUnboundedUnalignedTpl(const Eigen::MatrixBase<Vector3Like> & axis)
: M(1)
: M(Transformation_t::Identity())
, S(axis)
, v(axis,(Scalar)NAN)
, U(), Dinv(), UDinv()
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
static std::string classname() { return std::string("JointDataRevoluteUnboundedUnalignedTpl"); }
......
......@@ -70,7 +70,9 @@ namespace pinocchio
UD_t UDinv;
JointDataRevoluteUnboundedTpl()
: U(U_t::Zero())
: M((Scalar)0,(Scalar)1)
, v((Scalar)0)
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
......
......@@ -647,7 +647,9 @@ namespace pinocchio
UD_t UDinv;
JointDataRevoluteTpl()
: U(U_t::Zero())
: M((Scalar)0,(Scalar)1)
, v((Scalar)0)
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
......
......@@ -280,7 +280,10 @@ namespace pinocchio
D_t StU;
JointDataSphericalZYXTpl ()
: M(1)
: S(Constraint_t::Matrix3::Zero())
, M(Transformation_t::Identity())
, v(Motion_t::Vector3::Zero())
, c(Bias_t::Vector3::Zero())
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
......
......@@ -384,7 +384,8 @@ namespace pinocchio
UD_t UDinv;
JointDataSphericalTpl ()
: M(1)
: M(Transformation_t::Identity())
, v(Motion_t::Vector3::Zero())
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
......
......@@ -207,6 +207,7 @@ namespace pinocchio
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
PINOCCHIO_SE3_TYPEDEF_TPL(TransformTranslationTpl);
typedef typename traits<TransformTranslationTpl>::PlainType PlainType;
typedef typename traits<TransformTranslationTpl>::Vector3 Vector3;
TransformTranslationTpl() {}
......@@ -463,7 +464,9 @@ namespace pinocchio
UD_t UDinv;
JointDataTranslationTpl()
: U(U_t::Zero())
: M(Transformation_t::Vector3::Zero())
, v(Motion_t::Vector3::Zero())
, U(U_t::Zero())
, Dinv(D_t::Zero())
, UDinv(UD_t::Zero())
{}
......
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