run_fk.cpp
Go to the documentation of this file.
1 #include "pinocchio/parsers/sample-models.hpp"
2 
3 #include "pinocchio/algorithm/joint-configuration.hpp"
4 #include "pinocchio/algorithm/aba.hpp"
5 
6 #include <iostream>
7 
8 int main(int /*argc*/, char ** /*argv*/)
9 {
10  using namespace pinocchio;
11 
14 
15  // Build data related to model
16  Data data(model);
17 
18  // Sample a random joint configuration as well as random joint velocity and torque
20  Eigen::VectorXd v = Eigen::VectorXd::Random(model.nv);
21  Eigen::VectorXd tau = Eigen::VectorXd::Random(model.nv);
22 
23  // Computes the forward dynamics (ABA)
24  aba(model, data, q, v, tau);
25 
26  // Get access to the joint acceleration
27  std::cout << "Joint acceleration: " << data.ddq << std::endl;
28  return 0;
29 }
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
const DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & aba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType1 > &v, const Eigen::MatrixBase< TangentVectorType2 > &tau)
The Articulated-Body algorithm. It computes the forward dynamics, aka the joint accelerations given t...
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.
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
TangentVectorType ddq
The joint accelerations computed from ABA.
int main(int, char **)
Definition: run_fk.cpp:8
Main pinocchio namespace.
Definition: timings.cpp:28
int nv
Dimension of the velocity vector space.
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorXd
Definition: conversions.cpp:14
JointCollectionTpl & model


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:32