3

A short while I asked for suggestions on choosing a Python-compatible 3D graphics library for robotic motion modelling (using inverse kinematics in Python). After doing a bit of research and redefining my objectives I hope I can ask once again for a bit of assistance.

At the time I thought Blender was the best option - but now I'm having doubts. One key objective I have is the ability integrate the model into a custom GUI (wxPython). Seems like this might be rather difficult (and I'm unsure of the performance requirements).

I think I'm now leaning more towards OpenGL (PyOpenGL + wxglcanvas), but I'm still struggling to to determine if it's the right tool for the job. I'm more of a CAD person, so I have trouble envisioning how to draw complex objects in the API and create motion. I read I could design the object in, say Blender, then import it into OpenGL somehow, but I'm unsure of the process? And how difficult is manipulating motion of objects? For example, if I create a joint between two links, and I move one link, would the other link move dynamically according to the first, or would I need to program each link's movement independently?

Have I missed any obvious tools? I'm not looking for complete robotic modelling packages, I would like to start from scratch so I can incorporate it into my own program. For for learning more than anything. So far I've already looked into vPython, Pyglet, Panda3D, Ogre, and several professional CAD packages.

Thanks

2 Answers2

2

There is a similar project going on that implements a robotic toolbox for matlab and python, it has "Rudimentary 3D graphics", but you can always interface it with blender with a well knit script, it will be less work than reinventing the wheel

Andrew Walker
  • 40,984
  • 8
  • 62
  • 84
P2bM
  • 1,038
  • 6
  • 9
  • Just wanted to mention that the toolbox you reference is a real mess. Most of the code is half-ported Matlab, if not matlab code itself, and was last updated in 2008. With some small fixes parts of it will run, but there's no way to visualise what's going on, which could make troubleshooting/completing it difficult. – John Lyon Mar 08 '13 at 05:27
0

If movements can be pre-computed, you can use Blender, hand-craft animations, bake them in some animated file format (cal3d ?), and just render in your wxPython OpenGL window.

If you need to handle user input, you can use a physics engine... I hear Bullet has Python bindings : http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?p=&f=9&t=4030 (probably still unstable).

Regarding your doubts on Blender/OpenGL : What do you mean by "complex objects" ? How many "robots/whatever" ? How many triangle per robot ? How many articulations per robot ? (I'll edit my answer depending on yours)

Anyway, OpenGL in itself won't do anything else that juste "display triangles" ; everything else has to be done eslewhere.

EDIT

Sorry for the delay, I completely forgot.

So here is what I suggest :

  • Model your robot in Blender with polygons. You can easily go at >10k polygons, but try to keep the number of objects small (1 object per moving part)
  • Rig it, i.e. create a skeleton for it. You don't need to animate it.
  • Export as Collada or X3D
  • In your own OpenGL app, reimport
  • Draw your objects at the positions and orientations specified by the skeleton
  • Modify the angles between the bones just as you would do with real stepper motors
  • If step #5 was done right, robot should be follow the movements
  • Optionally add physics ( for instance with Bullet ). The API will be similar in concept to OpenGL, and you will be able to catch objects with your robotic arm.

good luck !

Calvin1602
  • 9,413
  • 2
  • 44
  • 55
  • In terms of complexity, I was hoping to model something similar to this arm (http://www.thinkgeek.com/images/products/zoom/b696_edge_robotic_arm_kit.jpg). From what I've seen from others using OpenGL is they tend to draw a cylinder to represent a link, and a sphere to represent a joint. I'm just curious how difficult it would be to model something with a bit more detail using OpenGL, ie would I need to chose coordinate pairs individually via programming, which could be very tedious. –  Apr 02 '11 at 18:18