Best 3D Robot Motion Simulation Library

In short, I asked for suggestions on choosing a Python-compatible 3D graphics library for modeling robotic motion (using reverse kinematics in Python). After doing a little research and redefining my goals, I hope that once again I will ask for a little help.

At the time I thought Blender was the best option, but now I have doubts. One of the main tasks that I have is the ability to integrate the model into a graphical user interface (wxPython). It seems like it can be quite complicated (and I'm not sure about the performance requirements).

I think that now I am more inclined towards OpenGL (PyOpenGL + wxglcanvas), but I'm still struggling to determine if it is the right tool for the job. I'm more of a CAD person, so it's hard for me to imagine how to draw complex objects in the API and create movements. I read that I can create an object, say Blender, and then import it into OpenGL, but I'm not sure about this process? And how difficult is it to manipulate the movement of objects? For example, if I create a connection between two links and I move one link, will the other link move dynamically according to the first, or will I need to program each channel movement independently?

Did I miss any obvious tools? I'm not looking for a complete package of robotic models, I would like to start from scratch, so I can include it in my own program. For learning the most. So far, I have already studied vPython, Pyglet, Panda3D, Ogre and several professional CAD packages.

thanks

+4
source share
2 answers

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

+3
source

If the movements can be pre-calculated, you can use Blender animations, hand-craft, bake them in some kind of animated file format (cal3d?) And just visualize OpenGL in wxPython in your window.

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

As for your doubts about Blender / OpenGL: what do you mean by “complex objects”? How many robots / whatever? How many triangles per robot? How many articulations per robot? (I will edit my answer depending on yours)

In any case, OpenGL alone will not do anything to “display triangles”; everything else needs 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 to> 10k polygons, but try to keep the number of objects small (1 object per moving part)
  • Run it, i.e. create a skeleton for him. You do not need to animate it.
  • Export as Collada or X3D
  • In your own OpenGL reimport application
  • Draw your objects in the positions and orientations given by the skeleton
  • Change the angles between the bones in the same way as with real stepper motors.
  • If step 5 was done correctly, the robot must follow the movements
  • It is not necessary to add physics (for example, using Bullet). The API will be similar to the OpenGL concept, and you will be able to catch objects with your robotic arm.

Good luck

0
source

Source: https://habr.com/ru/post/1346146/


All Articles