ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Use Morse to interface with Blender

asked 2012-08-21 02:38:39 -0500

Felix Messmer gravatar image

updated 2014-01-28 17:13:24 -0500

ngrennan gravatar image

Hi everybody,

I would like to use Morse to interface between ROS and the Blender Game Engine to simulate a robot that has been modeled in Blender. But I'm having problems with getting started - I think it has something to do that I have both python2.7 and python3.2 installed (more to it later).

I'm using ROS Electric on a Ubuntu 11.04 Natty and Blender 2.63. I followed the installation instructions on http://www.openrobots.org/morse/doc/stable/user/installation.html to install Morse.

Since Morse requires python3.2 it installed it via Synaptic Package Manager. The following command was used to install Morse

cmake -DCMAKE_INSTALL_PREFIX=/opt/morse -DBUILD_ROS_SUPPORT=ON -DPYMORSE_SUPPORT=ON -DCMAKE_BUILD_TYPE=RELEASE -DPYTHON3_EXECUTABLE=/usr/bin/python3 -DPYTHON_EXECUTABLE=/usr/bin/python ..

sudo make install

This worked fine but when I tried to run

morse <some_file>.blend

I got encoding errors. Since this is mentioned in the installation instructions, I downloaded python 3.2.3 source code and installed it from source using

./configure --with-wide-unicode

After setting the PYTHONPATH accordingly, I tried to reinstall Morse but it failed due to an error with the shared library or so (I don't know the exact error message anymore).

I was able to install Morse after I reconfigured and reinstalled python using

./configure --enable-shared --with-wide-unicode --with-system-expat --with-system-ffi

Now, when I want to run

morse <some_file>.blend

I get the following error message

Traceback (most recent call last):
  File "/opt/morse/bin/morse", line 32, in <module>
    import tempfile
  File "/usr/local/lib/python3.2/tempfile.py", line 37, in <module>
    from random import Random as _Random
  File "/usr/local/lib/python3.2/random.py", line 43, in <module>
    from os import urandom as _urandom
ImportError: cannot import name urandom

Can anyone help me with this?

Best regards, Felix

edit retag flag offensive close merge delete

Comments

Please always tag your questions appropriately to make sure the right people get notified.

Lorenz gravatar image Lorenz  ( 2012-08-21 05:24:34 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-11-28 01:14:56 -0500

michikarg gravatar image

updated 2012-11-28 01:16:52 -0500

The urandom problem is caused by a version mismatch of Python 3.2.2 and python 3.2.3.

The precompiled Blender < 2.64a use Python3.2.2 while Ubuntu > 11.10 use Python 3.2.2. So i guess switching to a Blender version compiled with the correct Python should solve the problem (in your case Blender 2.64a when using Python3.2.3). Of course, you could also compile Blender yourself but I guess switching the Blender version should be the easiest solution especially since the changes between 2.63 and 2.64a are not really relevant for MORSE.

edit flag offensive delete link more
1

answered 2012-11-28 00:48:23 -0500

flier gravatar image

Hey there,

I have written an extensivee tutorial on that topic. It's way to long to post it right here so you may have a look at:

http://www.warp1337.com/content/morse-and-ros-detailed-installation-howto-ubuntu-precise

Cheers, Florian

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-21 02:38:39 -0500

Seen: 1,271 times

Last updated: Nov 28 '12