Directory: | ./ |
---|---|
File: | bindings/python/algorithm/expose-kinematics.cpp |
Date: | 2025-02-12 21:03:38 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 19 | 19 | 100.0% |
Branches: | 28 | 56 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2015-2021 CNRS INRIA | ||
3 | // | ||
4 | |||
5 | #include "pinocchio/bindings/python/algorithm/algorithms.hpp" | ||
6 | #include "pinocchio/algorithm/kinematics.hpp" | ||
7 | |||
8 | namespace pinocchio | ||
9 | { | ||
10 | namespace python | ||
11 | { | ||
12 | |||
13 | 69 | void exposeKinematics() | |
14 | { | ||
15 | typedef context::Scalar Scalar; | ||
16 | typedef context::VectorXs VectorXs; | ||
17 | enum | ||
18 | { | ||
19 | Options = context::Options | ||
20 | }; | ||
21 | |||
22 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
23 | "updateGlobalPlacements", | ||
24 | &updateGlobalPlacements<Scalar, Options, JointCollectionDefaultTpl>, | ||
25 | 138 | bp::args("model", "data"), | |
26 | "Updates the global placements of all joint frames of the kinematic " | ||
27 | "tree and store the results in data according to the relative placements of the joints.\n\n" | ||
28 | "Parameters:\n" | ||
29 | "\tmodel: model of the kinematic tree\n" | ||
30 | "\tdata: data related to the model\n"); | ||
31 | |||
32 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
33 | "getVelocity", &getVelocity<Scalar, Options, JointCollectionDefaultTpl>, | ||
34 |
4/8✓ Branch 2 taken 69 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 69 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 69 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 69 times.
✗ Branch 12 not taken.
|
207 | (bp::arg("model"), bp::arg("data"), bp::arg("joint_id"), |
35 |
3/6✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 69 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 69 times.
✗ Branch 8 not taken.
|
138 | bp::arg("reference_frame") = LOCAL), |
36 | "Returns the spatial velocity of the joint expressed in the coordinate system given " | ||
37 | "by reference_frame.\n" | ||
38 | "forwardKinematics(model,data,q,v[,a]) should be called first to compute the joint " | ||
39 | "spatial velocity stored in data.v"); | ||
40 | |||
41 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
42 | "getAcceleration", &getAcceleration<Scalar, Options, JointCollectionDefaultTpl>, | ||
43 |
4/8✓ Branch 2 taken 69 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 69 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 69 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 69 times.
✗ Branch 12 not taken.
|
207 | (bp::arg("model"), bp::arg("data"), bp::arg("joint_id"), |
44 |
3/6✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 69 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 69 times.
✗ Branch 8 not taken.
|
138 | bp::arg("reference_frame") = LOCAL), |
45 | "Returns the spatial acceleration of the joint expressed in the coordinate system " | ||
46 | "given by reference_frame.\n" | ||
47 | "forwardKinematics(model,data,q,v,a) should be called first to compute the joint " | ||
48 | "spatial acceleration stored in data.a ."); | ||
49 | |||
50 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
51 | "getClassicalAcceleration", | ||
52 | &getClassicalAcceleration<Scalar, Options, JointCollectionDefaultTpl>, | ||
53 |
4/8✓ Branch 2 taken 69 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 69 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 69 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 69 times.
✗ Branch 12 not taken.
|
207 | (bp::arg("model"), bp::arg("data"), bp::arg("joint_id"), |
54 |
3/6✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 69 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 69 times.
✗ Branch 8 not taken.
|
138 | bp::arg("reference_frame") = LOCAL), |
55 | "Returns the \"classical\" acceleration of the joint expressed in the coordinate " | ||
56 | "system given by reference_frame.\n" | ||
57 | "forwardKinematics(model,data,q,v,a) should be called first to compute the joint " | ||
58 | "spatial acceleration stored in data.a ."); | ||
59 | |||
60 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
61 | "forwardKinematics", | ||
62 | &forwardKinematics<Scalar, Options, JointCollectionDefaultTpl, VectorXs>, | ||
63 | 138 | bp::args("model", "data", "q"), | |
64 | "Compute the global placements of all the joints of the kinematic " | ||
65 | "tree and store the results in data.\n\n" | ||
66 | "Parameters:\n" | ||
67 | "\tmodel: model of the kinematic tree\n" | ||
68 | "\tdata: data related to the model\n" | ||
69 | "\tq: the joint configuration vector (size model.nq)\n"); | ||
70 | |||
71 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
72 | "forwardKinematics", | ||
73 | &forwardKinematics<Scalar, Options, JointCollectionDefaultTpl, VectorXs, VectorXs>, | ||
74 | 138 | bp::args("model", "data", "q", "v"), | |
75 | "Compute the global placements and local spatial velocities of all the joints of the " | ||
76 | "kinematic " | ||
77 | "tree and store the results in data.\n\n" | ||
78 | "Parameters:\n" | ||
79 | "\tmodel: model of the kinematic tree\n" | ||
80 | "\tdata: data related to the model\n" | ||
81 | "\tq: the joint configuration vector (size model.nq)\n" | ||
82 | "\tv: the joint velocity vector (size model.nv)\n"); | ||
83 | |||
84 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
85 | "forwardKinematics", | ||
86 | &forwardKinematics< | ||
87 | Scalar, Options, JointCollectionDefaultTpl, VectorXs, VectorXs, VectorXs>, | ||
88 | 138 | bp::args("model", "data", "q", "v", "a"), | |
89 | "Compute the global placements, local spatial velocities and spatial accelerations " | ||
90 | "of all the joints of the kinematic " | ||
91 | "tree and store the results in data.\n\n" | ||
92 | "Parameters:\n" | ||
93 | "\tmodel: model of the kinematic tree\n" | ||
94 | "\tdata: data related to the model\n" | ||
95 | "\tq: the joint configuration vector (size model.nq)\n" | ||
96 | "\tv: the joint velocity vector (size model.nv)\n" | ||
97 | "\ta: the joint acceleration vector (size model.nv)\n"); | ||
98 | 69 | } | |
99 | |||
100 | } // namespace python | ||
101 | } // namespace pinocchio | ||
102 |