dynamic-python-module-py.cc 861 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
15
  bp::import("pinocchio");

  dg::python::exposeEntity<dgs::DynamicPinocchio>()
Joseph Mirabel's avatar
Joseph Mirabel committed
16
17
18
19
20
21
22
23
24
    .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)
    .def("setData", &dgs::DynamicPinocchio::setData)
    ;
Joseph Mirabel's avatar
Joseph Mirabel committed
25
}