algorithm/expose-geometry.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2021 CNRS INRIA
3 //
4 
6 #include "pinocchio/algorithm/geometry.hpp"
7 
8 namespace pinocchio
9 {
10  namespace python
11  {
12 
14  {
15  using namespace Eigen;
16 
17  bp::def("updateGeometryPlacements",
18  &updateGeometryPlacements<double,0,JointCollectionDefaultTpl,VectorXd>,
19  bp::args("model", "data", "geometry_model", "geometry_data", "q"),
20  "Update the placement of the collision objects according to the current configuration.\n"
21  "The algorithm also updates the current placement of the joint in Data."
22  );
23 
24  bp::def("updateGeometryPlacements",
25  &updateGeometryPlacements<double,0,JointCollectionDefaultTpl>,
26  bp::args("model", "data", "geometry_model", "geometry_data"),
27  "Update the placement of the collision objects according to the current joint placement stored in data."
28  );
29 
30 #ifdef PINOCCHIO_WITH_HPP_FCL
31  bp::def("computeCollision",computeCollision,
32  bp::args("geometry_model", "geometry_data", "pair_index"),
33  "Check if the collision objects of a collision pair for a given Geometry Model and Data are in collision.\n"
34  "The collision pair is given by the two index of the collision objects."
35  );
36 
37  bp::def("computeCollisions",
38  (bool (*)(const GeometryModel &, GeometryData &, const bool))&computeCollisions,
39  bp::args("geometry_model","geometry_data","stop_at_first_collision"),
40  "Determine if collision pairs are effectively in collision."
41  );
42 
43  bp::def("computeCollisions",
44  &computeCollisions<double,0,JointCollectionDefaultTpl,VectorXd>,
45  bp::args("model","data","geometry_model","geometry_data","q","stop_at_first_collision"),
46  "Update the geometry for a given configuration and "
47  "determine if all collision pairs are effectively in collision or not."
48  );
49 
50  bp::def("computeDistance",&computeDistance,
51  bp::args("geometry_model", "geometry_data", "pair_index"),
52  "Compute the distance between the two geometry objects of a given collision pair for a GeometryModel and associated GeometryData.",
53  bp::with_custodian_and_ward_postcall<0,2,bp::return_value_policy<bp::reference_existing_object> >()
54  );
55 
56  bp::def("computeDistances",
57  (std::size_t (*)(const GeometryModel &, GeometryData &))&computeDistances,
58  bp::args("geometry_model","geometry_data"),
59  "Compute the distance between each collision pair for a given GeometryModel and associated GeometryData."
60  );
61 
62  bp::def("computeDistances",
63  &computeDistances<double,0,JointCollectionDefaultTpl,VectorXd>,
64  bp::args("model","data","geometry_model","geometry_data","q"),
65  "Update the geometry for a given configuration and "
66  "compute the distance between each collision pair"
67  );
68 
69  bp::def("computeBodyRadius",
70  &computeBodyRadius<double,0,JointCollectionDefaultTpl>,
71  bp::args("model","geometry_model","geometry_data"),
72  "Compute the radius of the geometry volumes attached to every joints.");
73 #endif // PINOCCHIO_WITH_HPP_FCL
74 
75  }
76  } // namespace python
77 } // namespace pinocchio
bool computeCollisions(const int num_threads, const GeometryModel &geom_model, GeometryData &geom_data, const bool stopAtFirstCollision=false)
Main pinocchio namespace.
Definition: timings.cpp:28


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