Verified Commit 79c938f5 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

joints: add default value for JointData constructors

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