dynamic-python-module-py.cc 968 Bytes
Newer Older
Joseph Mirabel's avatar
Joseph Mirabel committed
1
2
3
4
5
6
7
#include <dynamic-graph/python/module.hh>

#include <sot/dynamic-pinocchio/dynamic-pinocchio.h>

namespace dg = dynamicgraph;
namespace dgs = dynamicgraph::sot;

Joseph Mirabel's avatar
Joseph Mirabel committed
8
9
typedef bp::return_value_policy<bp::reference_existing_object> reference_existing_object;

Joseph Mirabel's avatar
Joseph Mirabel committed
10
11
BOOST_PYTHON_MODULE(wrap)
{
Joseph Mirabel's avatar
Joseph Mirabel committed
12
  bp::import("dynamic_graph");
Joseph Mirabel's avatar
Joseph Mirabel committed
13
14
  bp::import("pinocchio");

15
  dg::python::exposeEntity<dgs::DynamicPinocchio, bp::bases<dg::Entity>, dg::python::AddCommands>()
Joseph Mirabel's avatar
Joseph Mirabel committed
16
17
18
19
20
21
22
    .add_property("model",
        bp::make_function(&dgs::DynamicPinocchio::getModel, reference_existing_object()),
        bp::make_function(&dgs::DynamicPinocchio::setModel))
    .add_property("data",
        bp::make_function(&dgs::DynamicPinocchio::getData, reference_existing_object()),
        bp::make_function(&dgs::DynamicPinocchio::setData))
    .def("setModel", &dgs::DynamicPinocchio::setModel)
23
    .def("createData", &dgs::DynamicPinocchio::createData)
Joseph Mirabel's avatar
Joseph Mirabel committed
24
25
    .def("setData", &dgs::DynamicPinocchio::setData)
    ;
Joseph Mirabel's avatar
Joseph Mirabel committed
26
}