bindings/python/algorithm/parallel/rnea.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021-2022 INRIA
3 //
4 
7 
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14 
15  static void rnea_proxy_res(
16  const int num_thread,
17  ModelPool & pool,
18  const Eigen::MatrixXd & q,
19  const Eigen::MatrixXd & v,
20  const Eigen::MatrixXd & a,
21  Eigen::Ref<Eigen::MatrixXd> tau)
22  {
23  rneaInParallel(num_thread, pool, q, v, a, tau);
24  }
25 
26  static Eigen::MatrixXd rnea_proxy(
27  const int num_thread,
28  ModelPool & pool,
29  const Eigen::MatrixXd & q,
30  const Eigen::MatrixXd & v,
31  const Eigen::MatrixXd & a)
32  {
33  Eigen::MatrixXd tau(v.rows(), v.cols());
34  rneaInParallel(num_thread, pool, q, v, a, tau);
35  return tau;
36  }
37 
39  {
40  namespace bp = boost::python;
41 
42  using namespace Eigen;
43 
44  bp::def(
45  "rneaInParallel", rnea_proxy, bp::args("num_thread", "pool", "q", "v", "a"),
46  "Computes in parallel the RNEA and returns the result.\n\n"
47  "Parameters:\n"
48  "\tnum_thread: number of threads used for the computation\n"
49  "\tpool: pool of model/data\n"
50  "\tq: the joint configuration vector (size model.nq x batch_size)\n"
51  "\tv: the joint velocity vector (size model.nv x batch_size)\n"
52  "\ta: the joint acceleration vector (size model.nv x batch_size)\n");
53 
54  bp::def(
55  "rneaInParallel", rnea_proxy_res, bp::args("num_thread", "pool", "q", "v", "a", "tau"),
56  "Computes in parallel the RNEA and stores the result in tau.\n\n"
57  "Parameters:\n"
58  "\tnum_thread: number of threads used for the computation\n"
59  "\tpool: pool of model/data\n"
60  "\tq: the joint configuration vector (size model.nq x batch_size)\n"
61  "\tv: the joint velocity vector (size model.nv x batch_size)\n"
62  "\ta: the joint acceleration vector (size model.nv x batch_size)\n"
63  "\ttau: the resulting joint torque vectors (size model.nv x batch_size)\n");
64  }
65 
66  } // namespace python
67 } // namespace pinocchio
boost::python
Eigen
pinocchio::python::exposeParallelRNEA
void exposeParallelRNEA()
Definition: bindings/python/algorithm/parallel/rnea.cpp:38
rnea.hpp
eigen-from-python.hpp
pinocchio::python::rnea_proxy
static Eigen::MatrixXd rnea_proxy(const int num_thread, ModelPool &pool, const Eigen::MatrixXd &q, const Eigen::MatrixXd &v, const Eigen::MatrixXd &a)
Definition: bindings/python/algorithm/parallel/rnea.cpp:26
forward-dynamics-derivatives.tau
tau
Definition: forward-dynamics-derivatives.py:25
algorithms.hpp
python
pinocchio::python::v
const Vector3Like & v
Definition: bindings/python/spatial/explog.hpp:66
pinocchio::ModelPoolTpl
Definition: multibody/pool/fwd.hpp:17
run-algo-in-parallel.pool
pool
Definition: run-algo-in-parallel.py:8
pinocchio::python::rnea_proxy_res
static void rnea_proxy_res(const int num_thread, ModelPool &pool, const Eigen::MatrixXd &q, const Eigen::MatrixXd &v, const Eigen::MatrixXd &a, Eigen::Ref< Eigen::MatrixXd > tau)
Definition: bindings/python/algorithm/parallel/rnea.cpp:15
pinocchio::rneaInParallel
void rneaInParallel(const size_t num_threads, ModelPoolTpl< Scalar, Options, JointCollectionTpl > &pool, const Eigen::MatrixBase< ConfigVectorPool > &q, const Eigen::MatrixBase< TangentVectorPool1 > &v, const Eigen::MatrixBase< TangentVectorPool2 > &a, const Eigen::MatrixBase< TangentVectorPool3 > &tau)
The Recursive Newton-Euler algorithm. It computes the inverse dynamics, aka the joint torques accordi...
Definition: parallel/rnea.hpp:39
pinocchio::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:1083
a
Vec3f a
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:12