expose-regressor.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018-2020 CNRS INRIA
3 //
4 
6 #include "pinocchio/algorithm/regressor.hpp"
7 
8 namespace pinocchio
9 {
10  namespace python
11  {
12 
13  Eigen::MatrixXd bodyRegressor_proxy(const Motion & v, const Motion & a)
14  {
15  return bodyRegressor(v,a);
16  }
17 
18  Eigen::MatrixXd jointBodyRegressor_proxy(const Model & model, Data & data, const JointIndex jointId)
19  {
20  return jointBodyRegressor(model,data,jointId);
21  }
22 
23  Eigen::MatrixXd frameBodyRegressor_proxy(const Model & model, Data & data, const FrameIndex frameId)
24  {
25  return frameBodyRegressor(model,data,frameId);
26  }
27 
29  {
30  using namespace Eigen;
31 
32  bp::def("computeStaticRegressor",
33  &computeStaticRegressor<double,0,JointCollectionDefaultTpl,VectorXd>,
34  bp::args("model","data","q"),
35  "Compute the static regressor that links the inertia parameters of the system to its center of mass position,\n"
36  "store the result in Data and return it.\n\n"
37  "Parameters:\n"
38  "\tmodel: model of the kinematic tree\n"
39  "\tdata: data related to the model\n"
40  "\tq: the joint configuration vector (size model.nq)\n",
41  bp::return_value_policy<bp::return_by_value>());
42 
43  bp::def("bodyRegressor",
45  bp::args("velocity","acceleration"),
46  "Computes the regressor for the dynamic parameters of a single rigid body.\n"
47  "The result is such that "
48  "Ia + v x Iv = bodyRegressor(v,a) * I.toDynamicParameters()\n\n"
49  "Parameters:\n"
50  "\tvelocity: spatial velocity of the rigid body\n"
51  "\tacceleration: spatial acceleration of the rigid body\n");
52 
53  bp::def("jointBodyRegressor",
55  bp::args("model","data","joint_id"),
56  "Compute the regressor for the dynamic parameters of a rigid body attached to a given joint.\n"
57  "This algorithm assumes RNEA has been run to compute the acceleration and gravitational effects.\n\n"
58  "Parameters:\n"
59  "\tmodel: model of the kinematic tree\n"
60  "\tdata: data related to the model\n"
61  "\tjoint_id: index of the joint\n");
62 
63  bp::def("frameBodyRegressor",
65  bp::args("model","data","frame_id"),
66  "Computes the regressor for the dynamic parameters of a rigid body attached to a given frame.\n"
67  "This algorithm assumes RNEA has been run to compute the acceleration and gravitational effects.\n\n"
68  "Parameters:\n"
69  "\tmodel: model of the kinematic tree\n"
70  "\tdata: data related to the model\n"
71  "\tframe_id: index of the frame\n");
72 
73  bp::def("computeJointTorqueRegressor",
74  &computeJointTorqueRegressor<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd,VectorXd>,
75  bp::args("model","data","q","v","a"),
76  "Compute the joint torque regressor that links the joint torque "
77  "to the dynamic parameters of each link according to the current the robot motion,\n"
78  "store the result in Data and return it.\n\n"
79  "Parameters:\n"
80  "\tmodel: model of the kinematic tree\n"
81  "\tdata: data related to the model\n"
82  "\tq: the joint configuration vector (size model.nq)\n"
83  "\tv: the joint velocity vector (size model.nv)\n"
84  "\ta: the joint acceleration vector (size model.nv)\n",
85  bp::return_value_policy<bp::return_by_value>());
86  }
87 
88  } // namespace python
89 } // namespace pinocchio
Eigen::MatrixXd bodyRegressor_proxy(const Motion &v, const Motion &a)
DataTpl< Scalar, Options, JointCollectionTpl >::BodyRegressorType & jointBodyRegressor(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, JointIndex jointId)
Computes the regressor for the dynamic parameters of a rigid body attached to a given joint...
DataTpl< Scalar, Options, JointCollectionTpl >::BodyRegressorType & frameBodyRegressor(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, FrameIndex frameId)
Computes the regressor for the dynamic parameters of a rigid body attached to a given frame...
void bodyRegressor(const MotionDense< MotionVelocity > &v, const MotionDense< MotionAcceleration > &a, const Eigen::MatrixBase< OutputType > &regressor)
Computes the regressor for the dynamic parameters of a single rigid body.
Eigen::MatrixXd frameBodyRegressor_proxy(const Model &model, Data &data, const FrameIndex frameId)
Eigen::MatrixXd jointBodyRegressor_proxy(const Model &model, Data &data, const JointIndex jointId)
Vec3f a
Main pinocchio namespace.
Definition: timings.cpp:28
JointCollectionTpl & model


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