Running roboSimu, ODE and drawstuff in Mac OS X Snow Leopard

During this week my lovely wife is attending a conference at school about robotics, nano technology and neuroscience, all themes that we love and are very interested into learning as much as we can. One of the workshops was about simulating robots in the computer before attempting to build them in real life, of course the demo was in Windows but it used an open source library called ODE (Open Dynamics Engine) and examples from Kosei Demura for the simulations. Of course I was hooked right away and wanted to try the examples in my mac and since today I'm sick at home and feeling like not working at all I decided to get this running, this is how you can get to run roboSimu, ODE and drawstuff in your Snow Leopard.

First things first, you need to install Apple's Developer Tools, they either come in your Extras DVD or you get them from Apple's Developer site, they are free but you need to register.

Once you have the dev tools, you need to install premake 3.7 and premake 4, this is because ODE svn sources needs premake4 and roboSimu sources are made for premake 3.x.

So go ahead and download premake 3.7 and premake 4, unzip and copy the premake and premake4 binary into /usr/bin.

Next you need to install ODE, currently drawstuff is broken with the latest ODE 0.11.1 so we need to get the sources using subversion (if you don't have subversion get the package installer here).

So run:

svn co ode

Now to compile ode run this:

cd ode


./configure --enable-double-precision


cd build

premake4 gmake

cd gmake

make config=debugdoubledll

After this you should have libode_doubled.dylib in ode/lib/DebugDoubleDLL.

Now into roboSimu, go to Demura's instructions and you'll find along with instructions to build on Windows and CodeBlocks.

Unzip roboSimu sources and copy the files into ode/roboSimu.

Now we need to copy the ode and drawstuff libs into ode/roboSimu/DebugLib.

Standing inside ode run this:

mkdir roboSimu/DebugLib

cp lib/DebugDoubleDLL/libode_doubled.dylib roboSimu/DebugLib

cp drawstuff/src/.libs/libdrawstuff.a roboSimu/DebugLib/libdrawstuffd.a

cp drawstuff/src/ roboSimu/DebugLib/

Almost ready!, I promise!

Now you need to edit roboSimu/roboSimu.lua edit line 77 and add the following:

--table.insert(package.links, { "GL", "GLU" })

table.insert(package.linkoptions, {"-framework OpenGL", "-framework GLUT"})

Save and quit and now it's time to compile!

cd roboSimu

premake --target gnu

cd src


If everything goes well you should see this:

==== Building amotor ====

Linking amotor

==== Building arm1 ====


Linking arm1

==== Building arm2 ====


Linking arm2

==== Building arm3 ====


Linking arm3

==== Building bounce ====


Linking bounce

==== Building hello ====


Linking hello

==== Building hopper ====


Linking hopper

==== Building hopper2 ====


Linking hopper2

==== Building hopper3 ====


Linking hopper3

==== Building legged ====


Linking legged

==== Building monoBot ====


Linking monoBot

==== Building omni ====


Linking omni

==== Building pk ====


Linking pk

==== Building sensor4 ====


Linking sensor4

==== Building slope ====


Linking slope

==== Building wheel1 ====


Linking wheel1

==== Building wheel2 ====


Linking wheel2

==== Building wheel4 ====


Linking wheel4

Note that all the example binaries will be inside ode/roboSimu/DebugLib. Enjoy!

robosimu screenshot

Comments !