5 #ifndef __pinocchio_python_geometry_object_hpp__ 6 #define __pinocchio_python_geometry_object_hpp__ 8 #include <boost/python.hpp> 12 #include "pinocchio/multibody/geometry.hpp" 23 :
public boost::python::def_visitor< GeometryObjectPythonVisitor >
27 template<
class PyClass>
32 bp::optional<std::string,Eigen::Vector3d,bool,Eigen::Vector4d,std::string> >
34 bp::args(
"self",
"name",
"parent_frame",
"parent_joint",
"collision_geometry",
35 "placement",
"mesh_path",
"mesh_scale",
"override_material",
"mesh_color",
"mesh_texture_path"),
36 "Full constructor of a GeometryObject."))
38 bp::optional<std::string,Eigen::Vector3d,bool,Eigen::Vector4d,std::string> >
40 bp::args(
"self",
"name",
"parent_joint",
"collision_geometry",
41 "placement",
"mesh_path",
"mesh_scale",
"override_material",
"mesh_color",
"mesh_texture_path"),
42 "Reduced constructor of a GeometryObject. This constructor does not require to specify the parent frame index." 44 .def(bp::init<const GeometryObject&>
46 bp::args(
"self",
"otherGeometryObject"),
49 .add_property(
"meshScale",
51 bp::return_internal_reference<>()),
53 "Scaling parameter of the mesh.")
54 .add_property(
"meshColor",
56 bp::return_internal_reference<>()),
58 "Color rgba of the mesh.")
60 "The FCL CollisionGeometry associated to the given GeometryObject.")
62 "Name associated to the given GeometryObject.")
63 .def_readwrite(
"parentJoint", &GeometryObject::parentJoint,
64 "Index of the parent joint.")
65 .def_readwrite(
"parentFrame", &GeometryObject::parentFrame,
66 "Index of the parent frame.")
68 "Position of geometry object in parent joint's frame.")
69 .def_readwrite(
"meshPath", &GeometryObject::meshPath,
70 "Path to the mesh file.")
71 .def_readwrite(
"overrideMaterial", &GeometryObject::overrideMaterial,
72 "Boolean that tells whether material information is stored inside the given GeometryObject.")
73 .def_readwrite(
"meshTexturePath", &GeometryObject::meshTexturePath,
74 "Path to the mesh texture file.")
75 .def_readwrite(
"disableCollision", &GeometryObject::disableCollision,
76 "If true, no collision or distance check will be done between the Geometry and any other geometry.")
78 .def(bp::self == bp::self)
79 .def(bp::self != bp::self)
81 #ifdef PINOCCHIO_WITH_HPP_FCL 82 .def(
"CreateCapsule", &GeometryObjectPythonVisitor::maker_capsule)
83 .staticmethod(
"CreateCapsule")
84 #endif // PINOCCHIO_WITH_HPP_FCL 89 const bp::type_info
info = bp::type_id<CollisionGeometryPtr>();
90 const bp::converter::registration* reg = bp::converter::registry::query(info);
93 bp::register_ptr_to_python<CollisionGeometryPtr>();
97 #ifdef PINOCCHIO_WITH_HPP_FCL 101 pinocchio::shared_ptr<fcl::CollisionGeometry>(
new fcl::Capsule(radius, length)),
105 #endif // PINOCCHIO_WITH_HPP_FCL 109 bp::class_<GeometryObject>(
"GeometryObject",
110 "A wrapper on a collision geometry including its parent joint, parent frame, placement in parent joint's frame.\n\n",
116 bp::enum_<GeometryType>(
"GeometryType")
129 #endif // ifndef __pinocchio_python_geometry_object_hpp__
void def(const char *name, Func func)
GeometryObject::CollisionGeometryPtr CollisionGeometryPtr
void init(bool compute_local_aabb=true)
Main pinocchio namespace.
void visit(PyClass &cl) const
#define EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(...)