bindings/python/algorithm/parallel/aba.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 INRIA
3 //
4 
7 
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14 
15  static void aba_proxy_res(
16  const int num_thread,
17  ModelPool & pool,
18  const Eigen::MatrixXd & q,
19  const Eigen::MatrixXd & v,
20  const Eigen::MatrixXd & tau,
21  Eigen::Ref<Eigen::MatrixXd> a)
22  {
23  abaInParallel(num_thread, pool, q, v, tau, a);
24  }
25 
26  static Eigen::MatrixXd aba_proxy(
27  const int num_thread,
28  ModelPool & pool,
29  const Eigen::MatrixXd & q,
30  const Eigen::MatrixXd & v,
31  const Eigen::MatrixXd & tau)
32  {
33  Eigen::MatrixXd a(v.rows(), v.cols());
34  abaInParallel(num_thread, pool, q, v, tau, a);
35  return a;
36  }
37 
39  {
40  namespace bp = boost::python;
41 
42  using namespace Eigen;
43 
44  bp::def(
45  "abaInParallel", aba_proxy, bp::args("num_thread", "pool", "q", "v", "tau"),
46  "Computes in parallel the ABA 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  "\ttau: the joint torque vector (size model.nv x batch_size)\n");
53 
54  bp::def(
55  "abaInParallel", aba_proxy_res, bp::args("num_thread", "pool", "q", "v", "tau", "a"),
56  "Computes in parallel the ABA, store the result in a.\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  "\ttau: the joint torque vector (size model.nv x batch_size)\n"
63  "\ta: the resulting joint acceleration vectors (size model.nv x batch_size)\n");
64  }
65 
66  } // namespace python
67 } // namespace pinocchio
boost::python
Eigen
eigen-from-python.hpp
aba.hpp
pinocchio::python::aba_proxy
static Eigen::MatrixXd aba_proxy(const int num_thread, ModelPool &pool, const Eigen::MatrixXd &q, const Eigen::MatrixXd &v, const Eigen::MatrixXd &tau)
Definition: bindings/python/algorithm/parallel/aba.cpp:26
pinocchio::abaInParallel
void abaInParallel(const size_t num_threads, ModelPoolTpl< Scalar, Options, JointCollectionTpl > &pool, const Eigen::MatrixBase< ConfigVectorPool > &q, const Eigen::MatrixBase< TangentVectorPool1 > &v, const Eigen::MatrixBase< TangentVectorPool2 > &tau, const Eigen::MatrixBase< TangentVectorPool3 > &a)
A parallel version of the Articulated Body algorithm. It computes the forward dynamics,...
Definition: algorithm/parallel/aba.hpp:40
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::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:1083
a
Vec3f a
pinocchio::python::aba_proxy_res
static void aba_proxy_res(const int num_thread, ModelPool &pool, const Eigen::MatrixXd &q, const Eigen::MatrixXd &v, const Eigen::MatrixXd &tau, Eigen::Ref< Eigen::MatrixXd > a)
Definition: bindings/python/algorithm/parallel/aba.cpp:15
pinocchio::python::exposeParallelABA
void exposeParallelABA()
Definition: bindings/python/algorithm/parallel/aba.cpp:38
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


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