[Robotics] Summary of my work on Blender for Robotics

Izaak Van Crombrugge izaak.vancrombrugge at gmail.com
Wed Sep 1 16:27:54 CEST 2010


As my assignment comes to an end, I would like to inform you on the results.

The results are not always usable scripts, sometimes it are insights about
what is possible and not possible (yet / any more).
The assignment was to extend Blender 2.5 with Python scripts. The baseline
was "Add UI panels that are useful for robotics and that make Blender more
accessible."

Peter Roelants has worked mostly on the start of a SimCreator. He has
documented his results on
http://wiki.blender.org/index.php/Robotics:SimCreator .

These are the topics I have been working on:

COLLADA 1.5
===========
Together with Peter Roelants, we have looked into the use of COLLADA 1.5 as
a standard format for saving and interchanging files. We have tried to do
this starting with the ColladaImEx, the Importer/Exporter script of Blender
2.4x. We have ported part of this code to Python 3 and Blender 2.5. There is
some usable code that is capable of importing a simple mesh, but it is quite
experimental and may not be up to date with the newest naming changes in the
Python API.

Working on this code and with the feedback of the mailing list, it became
clear to us that:
- Neither COLLADA 1.5 nor Blender 2.5 are completely stable enough to do
this.
- To avoid double or triple work, the full COLLADA 1.5 support should be
implemented in the native importer/exporter of Blender. This is implemented
using OpenCollada in C++. Most physics and kinematics features are
absolutely no priority for the current developers (understandable as Blender
still is an artist tool in the first place and implementing those features
is a lot of work).
- I believe that if we really want the full physics and kinematics support,
then an extra C++ developer may be needed to work on this.
- The current status of the COLLADA support in Blender 2.5 is not very clear
and documentation on it is hard to find. I guess the best way to start on it
is by following the Committers Mailing List on all COLLADA issues.


Grouping and Linking/Appending
==============================
In Blender 2.4x a "trick" was used to link objects in the scene that can be
moved. In 2.5 this is No Longer Possible! The only way to get a decent
working scene, is by Appending the objects. Saving such files is not memory
efficient and makes synchronizing files hard.

One possible workaround is to make scripts that remember what objects are
appended, store those actions in a config file and saving only this file.
When we want to reopen the file, we use a script that reconstructs the scene
by appending the objects as described in the config file. This is like
simulating the linking process through Python scripts.
Pro:
 - Makes linking possible.
Contra:
 - A lot of work to make these scripts.
 - Not as robust and user friendly as the build in linking
Conclusion:
 - The linking mechanism should really be extended.
 - Suggestion: an extra type of linking ("Game Linking") that makes it
easier to import groups with their own id, that can be moved and that keep
all there physics and game behaviour. But this can only be done in the
source.


Use of Armatures (problems with physics)
========================================
One of the results of iTaSC is that armatures now also work dynamically in
the Game Engine. This makes it possible to do real time IK solving in a
simulation.
It was suggested to use armatures for all kinds of joints (like a skeleton).
But this is not really possible. The connections of the armature look like a
Rigid Body Joint, but they do not work like that. They are actually a
parent-child relation. Such a relation can not work properly for Rigid
Bodies: the child object can not move because it is parented.
Example: http://www.sendspace.com/file/vjwqq8 (press P in 3D view).


Constraint Generator script (WIP)
=================================
Other problems with the armatures is that the Armature Constraints are not
really physics constraints. The Rigid Body Joints (RBJs) are. The solution
is to use objects and link them together using RBJs. I am currently working
on a UI script to automate the creation and configuration of such Joints.
This is still Work In Progress, but I hope I can continue working on it as
it will be a handy feature, especially now the RBJ UI is partly broken in
Blender 2.5 (The 6DOF is not configurable in the UI).
It will be documented on the wiki:
http://wiki.blender.org/index.php/Robotics:Scripts/constraintGenerator.


View Menu + Snapping
====================
I have made a script that provides easy to use controls that may be handy
when composing a simulation scene. It is described in the wiki
http://wiki.blender.org/index.php/Robotics:Scripts/viewPanel. It also has a
"snap" or "drop on ground" function with visual support and can be installed
as an add-on.


Others
======
- Packing Logic Bricks: I have been testing how to save Logic Bricks in a
config file (using the standard configparser Python class) and reloading
them. This could come in handy when COLLADA files would be used for the
objects.
- Info SimCreator: Added the info (read out the *.info file) when selecting
objects and scenes. It would be interesting to show a preview image, but for
now there is no neat way to do this directly in de Blender 2.5 UI.


If anyone has questions or remarks, I will continue to participate in the
BFR mailing list.

Cheers,
Izaak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/robotics/attachments/20100901/e4e45545/attachment.htm 


More information about the Robotics mailing list