32 #include <boost/python.hpp>
33 #include <boost/python/exception_translator.hpp>
34 #include <boost/python/stl_iterator.hpp>
38 #include <boost/shared_ptr.hpp>
39 #include <boost/format.hpp>
40 #include <boost/assert.hpp>
46 using namespace OpenRAVE;
49 namespace cppexamples {
70 boost::shared_ptr<FunctionUserData> p = boost::dynamic_pointer_cast<
FunctionUserData>(GetUserData());
73 PyGILState_STATE gstate = PyGILState_Ensure();
75 ret = p->simulationfn(fElapsedTime);
78 RAVELOG_WARN(
"unknown exception in python callback, please register again:\n");
82 PyGILState_Release(gstate);
84 GetEnv()->Remove(shared_from_this());
102 boost::shared_ptr<FunctionUserData> p = boost::dynamic_pointer_cast<
FunctionUserData>(module->GetUserData());
104 module->GetEnv()->Add(module,
true,
"");
121 boost::python::def(
"Init",
cppexamples::Init, boost::python::args(
"globalstate"),
"initializes the python bindings with the openrave global state");