Go to the documentation of this file.
16 int main(
int argc,
const char ** argv)
18 using namespace Eigen;
23 const int NBT = 1000 * 100;
26 std::cout <<
"(the time score in debug mode is not relevant) " << std::endl;
39 const std::string ff_option = argv[2];
40 if (ff_option ==
"-no-ff")
52 const std::string RA =
"RARM_LINK6";
53 const std::string LA =
"LARM_LINK6";
54 const std::string RF =
"RLEG_LINK6";
55 const std::string LF =
"LLEG_LINK6";
71 contact_infos_6D.push_back(ci_RF_6D);
72 contact_datas_6D.push_back(cd_RF_6D);
78 contact_infos_6D6D.push_back(ci_RF_6D);
79 contact_datas_6D6D.push_back(cd_RF_6D);
80 contact_infos_6D6D.push_back(ci_LF_6D);
81 contact_datas_6D6D.push_back(cd_LF_6D);
85 std::cout <<
"nq = " <<
model.nq << std::endl;
86 std::cout <<
"nv = " <<
model.nv << std::endl;
87 std::cout <<
"--" << std::endl;
90 VectorXd qmax = Eigen::VectorXd::Ones(
model.nq);
97 for (
size_t i = 0;
i < NBT; ++
i)
100 qdots[
i] = Eigen::VectorXd::Random(
model.nv);
101 qddots[
i] = Eigen::VectorXd::Random(
model.nv);
102 taus[
i] = Eigen::VectorXd::Random(
model.nv);
105 double total_time = 0;
110 model,
data,
qs[_smooth], qdots[_smooth], contact_infos_empty, contact_datas_empty);
115 std::cout <<
"impulseDynamicsDerivs {} = \t\t" << (total_time / NBT) << std::endl;
126 std::cout <<
"impulseDynamicsDerivs {6D} = \t\t" << (total_time / NBT) << std::endl;
133 model,
data,
qs[_smooth], qdots[_smooth], contact_infos_6D6D, contact_datas_6D6D);
138 std::cout <<
"impulseDynamicsDerivs {6D,6D} = \t" << (total_time / NBT) << std::endl;
ContactCholeskyDecompositionTpl< context::Scalar, context::Options > ContactCholeskyDecomposition
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
JointModelFreeFlyerTpl< Scalar > JointModelFreeFlyer
void randomConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &lowerLimits, const Eigen::MatrixBase< ConfigVectorIn2 > &upperLimits, const Eigen::MatrixBase< ReturnType > &qout)
Generate a configuration vector uniformly sampled among provided limits.
@ CONTACT_6D
Point contact model.
int main(int argc, const char **argv)
void initConstraintDynamics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const std::vector< RigidConstraintModelTpl< Scalar, Options >, Allocator > &contact_models)
Init the forward dynamics data according to the contact information contained in contact_models.
void computeImpulseDynamicsDerivatives(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const std::vector< RigidConstraintModelTpl< Scalar, Options >, ConstraintModelAllocator > &contact_models, std::vector< RigidConstraintDataTpl< Scalar, Options >, ConstraintDataAllocator > &contact_data, const Scalar r_coeff, const ProximalSettingsTpl< Scalar > &settings, const Eigen::MatrixBase< MatrixType1 > &dvimpulse_partial_dq, const Eigen::MatrixBase< MatrixType2 > &dvimpulse_partial_dv, const Eigen::MatrixBase< MatrixType3 > &impulse_partial_dq, const Eigen::MatrixBase< MatrixType4 > &impulse_partial_dv)
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModel(const std::string &filename, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, const std::string &rootJointName, ModelTpl< Scalar, Options, JointCollectionTpl > &model, const bool verbose=false)
Build the model from a URDF file with a particular joint as root of the model tree inside the model g...
#define PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(T)
const PINOCCHIO_DEPRECATED DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & impulseDynamics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v_before, const Eigen::MatrixBase< ConstraintMatrixType > &J, const Scalar r_coeff=0., const Scalar inv_damping=0.)
Compute the impulse dynamics with contact constraints. Internally, pinocchio::crba is called.
Main pinocchio namespace.
#define PINOCCHIO_MODEL_DIR
pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:12