4 #include <hrpModel/ModelLoaderUtil.h> 5 #include "hrpsys/util/GLutil.h" 22 boost::python::list retval;
24 return boost::python::incref(retval.ptr());
29 if (PySequence_Size(v) != 3)
return;
36 boost::python::list retval;
39 return boost::python::incref(retval.ptr());
45 int n = PySequence_Size(v);
50 for (
int i=0;
i<3;
i++) {
51 axis(
i) = boost::python::extract<double>(PySequence_GetItem(v,
i));
53 double angle = boost::python::extract<double>(PySequence_GetItem(v, 3));
68 boost::python::list retval;
70 return boost::python::incref(retval.ptr());
75 if (PySequence_Size(v) != 3)
return;
88 boost::python::list retval;
90 return boost::python::incref(retval.ptr());
95 int n = PySequence_Size(v);
100 for (
int i=0;
i<3;
i++) {
101 axis(
i) = boost::python::extract<double>(PySequence_GetItem(v,
i));
103 double angle = boost::python::extract<double>(PySequence_GetItem(v, 3));
130 boost::python::list retval;
132 return boost::python::incref(retval.ptr());
137 if (PySequence_Size(v) != 3)
return;
143 boost::python::list retval;
146 return boost::python::incref(retval.ptr());
151 if (PySequence_Size(v) != 3)
return;
157 boost::python::list retval;
159 return boost::python::incref(retval.ptr());
164 if (PySequence_Size(v) != 3)
return;
170 boost::python::list retval;
172 return boost::python::incref(retval.ptr());
177 if (PySequence_Size(v) != 9)
return;
189 boost::python::list retval;
191 return boost::python::incref(retval.ptr());
196 if (PySequence_Size(pyo) != 3)
return;
202 boost::python::list retval;
204 return boost::python::incref(retval.ptr());
209 if (PySequence_Size(v) != 3)
return;
226 std::string nameServer = manager->
getConfig()[
"corba.nameservers"];
227 int comPos = nameServer.find(
",");
229 comPos = nameServer.length();
231 nameServer = nameServer.substr(0, comPos);
234 OpenHRP::ModelLoader_var modelloader =
hrp::getModelLoader(CosNaming::NamingContext::_duplicate(
naming.getRootContext()));
235 OpenHRP::ModelLoader::ModelLoadOption opt;
236 opt.readImage =
true;
237 opt.AABBdata.length(0);
238 opt.AABBtype = OpenHRP::ModelLoader::AABB_NUM;
239 OpenHRP::BodyInfo_var binfo = modelloader->getBodyInfoEx(url.c_str(), opt);
240 OpenHRP::LinkInfoSequence_var lis = binfo->links();
259 boost::python::list retval;
262 retval.append(boost::python::object((
PyLink *)l));
265 return boost::python::incref(retval.ptr());
270 if(type ==
"fixed" ){
272 }
else if(type ==
"free" ){
274 }
else if(type ==
"rotate" ){
276 }
else if(type ==
"slide" ){
286 case Link::FIXED_JOINT:
288 case Link::FREE_JOINT:
290 case Link::ROTATIONAL_JOINT:
292 case Link::SLIDE_JOINT:
301 boost::python::list retval;
305 return boost::python::incref(retval.ptr());
static void Matrix33ToPyList(const hrp::Matrix33 &M, boost::python::list &l)
PyLink * addChildLink(std::string name)
void setTranslationAxis(PyObject *v)
PyObject * getRelPosition()
PyObject * getRelRotation()
HRPMODEL_API OpenHRP::ModelLoader_var getModelLoader(CosNaming::NamingContext_var cxt)
void setPosition(PyObject *v)
void setRotation(PyObject *v)
void setInertia(PyObject *v)
HRP_UTIL_EXPORT void calcRotFromRpy(Matrix33 &out_R, double r, double p, double y)
void setAttitude(const Matrix33 &R)
GLshape * createPyShape()
void setJointType(std::string type)
void setRotation(double r, double p, double y)
static Manager & instance()
void loadCube(GLshape *shape, double x, double y, double z)
void setRotationAxis(PyObject *v)
std::vector< GLshape * > m_shapes
coil::Properties & getConfig()
PyObject * getTranslationAxis()
static void PyListToMatrix33(PyObject *pyo, hrp::Matrix33 &M)
void setPosition(double x, double y, double z)
void setAngVel(PyObject *v)
HRP_UTIL_EXPORT void calcRodrigues(Matrix44 &out_R, const Vector3 &axis, double q)
std::string getJointType()
void setRelPosition(PyObject *v)
PyObject * getRotationAxis()
void addShape(GLshape *shape)
void VectorToPyList(const T &v, boost::python::list &l)
PyShape * addCube(double x, double y, double z)
void setRelRotation(PyObject *v)
void loadShapeFromLinkInfo(GLlink *link, const OpenHRP::LinkInfo &i_li, OpenHRP::ShapeSetInfo_ptr i_ssinfo, GLshape *(*shapeFactory)())
void addChild(GLlink *i_child)
void setLinVel(PyObject *v)
void notifyChanged(int change)
void PyListToVector(PyObject *pyo, T &v)
void addShapeFromFile(std::string url)