Go to the documentation of this file.
13 #include <boost/test/unit_test.hpp>
14 #include <boost/utility/binary.hpp>
17 using namespace Eigen;
25 VectorXd q_integrate(
model.nq);
26 VectorXd v_integrate(
model.nv);
27 v_integrate.setZero();
33 for (
int k = 0; k <
model.nv; ++k)
45 res.col(k) = oMi_ref.act(
log6(oMi_ref.
inverse() * oMi)).toVector();
55 template<
typename Matrix>
58 for (
int k = 0; k <
mat.size(); ++k)
59 mat.derived().data()[k] =
60 math::fabs(
mat.derived().data()[k]) <=
value ? 0 :
mat.derived().data()[k];
63 template<
typename Jo
intModel_>
66 template<
typename Jo
intModel_>
69 static JointModel_
run()
72 jmodel.setIndexes(0, 0, 0);
77 template<
typename Scalar,
int Options>
85 JointModel jmodel(Vector3::Random().normalized());
92 template<
typename Scalar,
int Options>
100 JointModel jmodel(Vector3::Random().normalized());
107 template<
typename Scalar,
int Options>
115 JointModel jmodel(Vector3::Random().normalized());
122 template<
typename Scalar,
int Options>
130 JointModel jmodel(Vector3::Random().normalized());
137 template<
typename Scalar,
int Options>
152 template<
typename Scalar,
int Options,
int axis>
166 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollection>
181 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollection>
193 jmodel.setIndexes(0, 0, 0);
198 template<
typename Jo
intModel_>
220 template<
typename Jo
intModel>
223 typedef typename JointModel::ConfigVector_t CV;
224 typedef typename JointModel::TangentVector_t TV;
228 std::cout <<
"name: " << jmodel.
classname() << std::endl;
230 typename JointModel::JointDataDerived jdata_ = jmodel.
createData();
232 DataBaseType & jdata =
static_cast<DataBaseType &
>(jdata_);
234 CV
q = LieGroupType().random();
235 jmodel.
calc(jdata.derived(),
q);
236 SE3 M_ref(jdata.M());
239 const Eigen::DenseIndex
nv = jdata.S().nv();
244 Eigen::Matrix<double, 6, JointModel::NV>
S(6,
nv), S_ref(jdata.S().matrix());
246 for (
int k = 0; k <
nv; ++k)
249 q_int = LieGroupType().integrate(
q,
v);
250 jmodel.
calc(jdata.derived(), q_int);
251 SE3 M_int = jdata.M();
259 BOOST_CHECK(
S.isApprox(S_ref,
eps * 1e1));
260 std::cout <<
"S_ref:\n" << S_ref << std::endl;
261 std::cout <<
"S:\n" <<
S << std::endl;
265 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
278 VectorXd
q = VectorXd::Ones(
model.nq);
289 BOOST_CHECK(Jrh_finite_diff.isApprox(Jrh, sqrt(1e-8)));
292 Jrh_finite_diff = finiteDiffJacobian<true>(
model,
data,
q, idx);
293 BOOST_CHECK(Jrh_finite_diff.isApprox(Jrh, sqrt(1e-8)));
296 BOOST_AUTO_TEST_SUITE_END()
void setIndexes(JointIndex id, int q, int v)
pinocchio::JointModelPrismaticUnalignedTpl< Scalar, Options > JointModel
pinocchio::JointModelCompositeTpl< Scalar, Options, JointCollection > JointModel
SE3Tpl inverse() const
aXb = bXa.inverse()
void forwardKinematics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q)
Update the joint placements according to the current joint configuration.
void setIndexes(JointIndex id, int q, int v)
void operator()(JointModelBase< JointModel > &) const
pinocchio::JointModelMimic< JointModel_ > JointModel
void filterValue(MatrixBase< Matrix > &mat, typename Matrix::Scalar value)
int nv(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointNvVisitor to get the dimension of the joint tangent space.
static std::string classname()
JointModelRevoluteTpl< context::Scalar, context::Options, 0 > JointModelRX
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
void setIndexes(JointIndex id, int q, int v)
const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix6x & computeJointJacobians(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q)
Computes the full model Jacobian, i.e. the stack of all motion subspace expressed in the world frame....
JointModelDerived & addJoint(const JointModelBase< JointModel > &jmodel, const SE3 &placement=SE3::Identity())
Add a joint to the vector of joints.
static Eigen::Matrix< Scalar, 3, 1 > vector()
JointModelRevoluteTpl< context::Scalar, context::Options, 1 > JointModelRY
pinocchio::JointIndex JointIndex
void setIndexes(JointIndex id, int nq, int nv)
void operator()(JointModelComposite &) const
void setIndexes(JointIndex id, int q, int v)
pinocchio::JointModelHelicalUnalignedTpl< Scalar, Options > JointModel
void integrate(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< ReturnType > &qout)
Integrate a configuration vector for the specified model for a tangent vector during one unit time.
Eigen::Matrix< Scalar, 3, 1, _Options > Vector3
void getJointJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const JointIndex joint_id, const ReferenceFrame reference_frame, const Eigen::MatrixBase< Matrix6Like > &J)
Computes the Jacobian of a specific joint frame expressed in one of the pinocchio::ReferenceFrame opt...
JointDataDerived createData() const
Eigen::Matrix< Scalar, 3, 1, Options > Vector3
pinocchio::JointModelRevoluteUnboundedUnalignedTpl< Scalar, Options > JointModel
pinocchio::JointModelHelicalTpl< Scalar, Options, axis > JointModel
Eigen::Matrix< Scalar, 3, 1, _Options > Vector3
pinocchio::JointModelTpl< Scalar, Options, JointCollection > JointModel
pinocchio::JointModelUniversalTpl< Scalar, Options > JointModel
Eigen::Matrix< Scalar, 3, 1, Options > Vector3
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
pinocchio::JointModelRevoluteUnalignedTpl< Scalar, Options > JointModel
void setIndexes(JointIndex id, int q, int v)
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
MotionTpl< Scalar, Options > log6(const SE3Tpl< Scalar, Options > &M)
Log: SE3 -> se3.
Eigen::Matrix< Scalar, 3, 1, _Options > Vector3
void setIndexes(JointIndex id, int q, int v)
Eigen::Matrix< Scalar, 6, Eigen::Dynamic, Options > Matrix6x
The 6d jacobian type (temporary)
BOOST_AUTO_TEST_CASE(test_S_finit_diff)
Data::Matrix6x finiteDiffJacobian(const Model &model, Data &data, const Eigen::VectorXd &q, const Model::JointIndex joint_id)
void setIndexes(JointIndex id, int q, int v)
Eigen::Matrix< Scalar, 3, 1, _Options > Vector3
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
JointCollectionTpl & model
Main pinocchio namespace.
void calc(JointDataDerived &data, const Eigen::MatrixBase< ConfigVector > &q) const
pinocchio
Author(s):
autogenerated on Fri Nov 1 2024 02:41:44