Go to the documentation of this file.
14 #include <boost/test/unit_test.hpp>
19 template<
typename Jo
intModel_>
22 template<
typename Jo
intModel_>
25 static JointModel_
run()
28 jmodel.setIndexes(0, 0, 0);
33 template<
typename Scalar,
int Options>
41 JointModel jmodel(Vector3::Random().normalized());
48 template<
typename Scalar,
int Options>
56 JointModel jmodel(Vector3::Random().normalized());
63 template<
typename Scalar,
int Options>
71 JointModel jmodel(Vector3::Random().normalized());
78 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollection>
93 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollection>
105 jmodel.setIndexes(0, 0, 0);
110 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollection>
122 jmodel.setIndexes(1, 0, 0, 0);
127 template<
typename Scalar,
int Options>
141 template<
typename Scalar,
int Options,
int axis>
155 template<
typename Scalar,
int Options>
163 JointModel jmodel(Vector3::Random().normalized());
170 BOOST_AUTO_TEST_SUITE(joint_model_base_test)
172 template<
typename TestDerived>
175 template<
typename Jo
intModel>
179 return TestDerived::test(jmodel);
185 template<
typename Jo
intModel>
189 BOOST_CHECK(jmodel_copy == jmodel.
derived());
192 BOOST_CHECK(jmodel_any != jmodel.
derived());
199 template<
typename Jo
intModel>
202 typedef typename JointModel::JointDataDerived
JointData;
204 Eigen::Matrix<typename JointModel::Scalar, 3, 1>
t = jdata.
M_accessor().translation();
206 Eigen::Matrix<typename JointModel::Scalar, 3, 3>
R = jdata.
M_accessor().rotation();
219 BOOST_CHECK(joint_revolutex != joint_revolutey);
226 BOOST_CHECK(jmodel_any != jmodelx);
239 template<
typename Jo
intModel>
243 BOOST_CHECK(jmodel == jmodel);
244 BOOST_CHECK(jmodel.template cast<Scalar>().
isEqual(jmodel));
245 BOOST_CHECK(jmodel.template cast<Scalar>() == jmodel);
247 jmodel.template cast<long double>().template cast<double>() == jmodel,
248 std::string(
"Error when casting " + jmodel.
shortname() +
" from long double to double."));
262 template<
typename Jo
intModel>
265 typedef typename JointModel::JointDataDerived
JointData;
267 std::cout <<
"shortname: " << jmodel.
shortname() << std::endl;
268 std::cout <<
"classname: " << jmodel.
classname() << std::endl;
269 std::cout <<
"disp:\n" << jmodel << std::endl;
273 std::cout <<
"shortname: " << jdata.
shortname() << std::endl;
274 std::cout <<
"classname: " << jdata.
classname() << std::endl;
275 std::cout <<
"disp:\n" << jdata << std::endl;
287 BOOST_AUTO_TEST_SUITE_END()
void setIndexes(JointIndex id, int q, int v)
JointDataDerived createData() const
pinocchio::JointModelPrismaticUnalignedTpl< Scalar, Options > JointModel
pinocchio::JointModelCompositeTpl< Scalar, Options, JointCollection > JointModel
void setIndexes(JointIndex id, int q, int v)
BOOST_AUTO_TEST_CASE(isEqual)
JointModelRevoluteTpl< context::Scalar, context::Options, 0 > JointModelRX
void setIndexes(JointIndex id, int q, int v)
pinocchio::JointModelMimicTpl< Scalar, Options, JointCollection > JointModel
bool isEqual(const JointModelBase< JointModelDerived > &other) const
NewScalar cast(const Scalar &value)
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
void setIndexes(JointIndex id, int nq, int nv)
static std::string classname()
void setIndexes(JointIndex id, int q, int v)
pinocchio::JointModelHelicalUnalignedTpl< Scalar, Options > JointModel
void operator()(const pinocchio::JointModelBase< JointModel > &) const
JointDataTpl< context::Scalar > JointData
static void test(const JointModelBase< JointModel > &jmodel)
Eigen::Matrix< Scalar, 3, 1, _Options > Vector3
static std::string classname()
JointCollectionDefault::JointModelVariant JointModelVariant
Eigen::Matrix< Scalar, 3, 1, Options > Vector3
std::string shortname() const
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
JointModelTpl< context::Scalar > JointModel
pinocchio::JointModelRevoluteUnalignedTpl< Scalar, Options > JointModel
void setIndexes(JointIndex id, int q, int v)
static void test(const JointModelBase< JointModel > &jmodel)
bool isEqual(const ConstraintDataTpl< Scalar, Options, ConstraintCollectionTpl > &cdata_generic, const ConstraintDataBase< ConstraintDataDerived > &cdata)
boost::variant< JointModelRX, JointModelRY, JointModelRZ, JointModelFreeFlyer, JointModelPlanar, JointModelRevoluteUnaligned, JointModelSpherical, JointModelSphericalZYX, JointModelPX, JointModelPY, JointModelPZ, JointModelPrismaticUnaligned, JointModelTranslation, JointModelRUBX, JointModelRUBY, JointModelRUBZ, JointModelRevoluteUnboundedUnaligned, JointModelHx, JointModelHy, JointModelHz, JointModelHelicalUnaligned, JointModelUniversal, boost::recursive_wrapper< JointModelComposite >, boost::recursive_wrapper< JointModelMimic > > JointModelVariant
static void test(const JointModelBase< JointModel > &jmodel)
Eigen::Matrix< Scalar, 3, 1, _Options > Vector3
void setIndexes(JointIndex id, int q, int v)
std::string shortname() const
bool isEqual(const JointModelBase< OtherDerived > &) const
JointModelDerived & derived()
Transformation_t M_accessor() const
Main pinocchio namespace.
#define PINOCCHIO_UNUSED_VARIABLE(var)
Helper to declare that a parameter is unused.
pinocchio
Author(s):
autogenerated on Wed Apr 16 2025 02:41:43