1 #include <boost/python.hpp> 2 #include <boost/foreach.hpp> 3 #include <boost/range/value_type.hpp> 11 "implementation_id",
"PyBody",
12 "type_name",
"PyBody",
13 "description",
"PyBody component",
16 "category",
"Generic",
17 "activity_type",
"DataFlowComponent",
20 "lang_type",
"compile",
47 if (PySequence_Size(v) !=
numJoints())
return;
50 if (j) j->
q = boost::python::extract<double>(PySequence_GetItem(v,
i));
67 boost::python::list retval;
70 double q = j ? j->
q : 0;
71 retval.append(boost::python::object(q));
73 return boost::python::incref(retval.ptr());
78 Body::calcForwardKinematics();
83 return (
PyLink *)Body::rootLink();
88 return (
PyLink *)Body::link(name);
93 boost::python::list retval;
96 retval.append(boost::python::ptr(l));
98 return boost::python::incref(retval.ptr());
103 return (
PyLink *)Body::joint(i);
107 boost::python::list retval;
110 retval.append(boost::python::ptr(l));
112 return boost::python::incref(retval.ptr());
123 boost::python::list retval;
124 for (
int i=0;
i<3;
i++){
125 retval.append(boost::python::object(cm[
i]));
127 return boost::python::incref(retval.ptr());
148 template <
class _Delete>
png_infop png_charpp int png_charpp profile
PyBody(RTC::Manager *manager=&RTC::Manager::instance())
static const char * pybody_spec[]
void setListener(PySimulator *i_sim)
void setPosition(PyObject *v)
void setRotation(PyObject *v)
void DummyDelete(RTC::RTObject_impl *rtc)
def j(str, encoding="cp932")
const std::string & name()
void setPosture(PyObject *v)
void setRotation(PyObject *v)
unsigned int numJoints() const
PyLink * link(std::string name)
void setPosition(PyObject *v)
void calcForwardKinematics()
unsigned int numLinks() const
void notifyChanged(int change)
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)
static void moduleInit(RTC::Manager *)