0
$\begingroup$

Rosanswers logo

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


Originally posted by Felix Messmer on ROS Answers with karma: 198 on 2012-08-21

Post score: 2


Original comments

Comment by Lorenz on 2012-08-21:
Please always tag your questions appropriately to make sure the right people get notified.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by michikarg with karma: 2108 on 2012-11-28

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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


Originally posted by flier with karma: 76 on 2012-11-28

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.