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."))
37 .def(bp::init<std::string,
JointIndex,CollisionGeometryPtr,
SE3,
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"),
50 "Scaling parameter of the mesh.")
51 .add_property(
"meshColor",
53 bp::return_value_policy<bp::return_by_value>()),
55 "Color rgba of the mesh.")
56 .def_readwrite(
"geometry", &GeometryObject::geometry,
57 "The FCL CollisionGeometry associated to the given GeometryObject.")
59 "Name associated to the given GeometryObject.")
60 .def_readwrite(
"parentJoint", &GeometryObject::parentJoint,
61 "Index of the parent joint.")
62 .def_readwrite(
"parentFrame", &GeometryObject::parentFrame,
63 "Index of the parent frame.")
65 "Position of geometry object in parent joint's frame.")
66 .def_readwrite(
"meshPath", &GeometryObject::meshPath,
67 "Path to the mesh file.")
68 .def_readwrite(
"overrideMaterial", &GeometryObject::overrideMaterial,
69 "Boolean that tells whether material information is stored inside the given GeometryObject.")
70 .def_readwrite(
"meshTexturePath", &GeometryObject::meshTexturePath,
71 "Path to the mesh texture file.")
72 .def_readwrite(
"disableCollision", &GeometryObject::disableCollision,
73 "If true, no collision or distance check will be done between the Geometry and any other geometry.")
75 .def(bp::self == bp::self)
76 .def(bp::self != bp::self)
78 #ifdef PINOCCHIO_WITH_HPP_FCL 79 .def(
"CreateCapsule", &GeometryObjectPythonVisitor::maker_capsule)
80 .staticmethod(
"CreateCapsule")
81 #endif // PINOCCHIO_WITH_HPP_FCL 85 #ifdef PINOCCHIO_WITH_HPP_FCL 86 static GeometryObject maker_capsule(
const double radius,
const double length)
89 boost::shared_ptr<fcl::CollisionGeometry>(
new fcl::Capsule(radius, length)),
93 #endif // PINOCCHIO_WITH_HPP_FCL 97 bp::class_<GeometryObject>(
"GeometryObject",
98 "A wrapper on a collision geometry including its parent joint, parent frame, placement in parent joint's frame.\n\n",
104 bp::enum_<GeometryType>(
"GeometryType")
117 #endif // ifndef __pinocchio_python_geometry_object_hpp__
void visit(PyClass &cl) const
GeometryObject::CollisionGeometryPtr CollisionGeometryPtr
Main pinocchio namespace.
#define EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(...)