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 https://opende.svn.sourceforge.net/svnroot/opende/trunk ode
Now to compile ode run this:
cd ode
./autogen.sh
./configure --enable-double-precision
make
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 roboSimu090614.zip 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/libdrawstuff.la roboSimu/DebugLib/libdrawstuffd.la
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
make
If everything goes well you should see this:
==== Building amotor ====
Linking amotor
==== Building arm1 ====
arm1.cpp
Linking arm1
==== Building arm2 ====
arm2.cpp
Linking arm2
==== Building arm3 ====
arm3.cpp
Linking arm3
==== Building bounce ====
bounce.cpp
Linking bounce
==== Building hello ====
hello.cpp
Linking hello
==== Building hopper ====
hopper.cpp
Linking hopper
==== Building hopper2 ====
hopper2.cpp
Linking hopper2
==== Building hopper3 ====
hopper3.cpp
Linking hopper3
==== Building legged ====
legged.cpp
Linking legged
==== Building monoBot ====
monoBot.cpp
Linking monoBot
==== Building omni ====
omni.cpp
Linking omni
==== Building pk ====
pk.cpp
Linking pk
==== Building sensor4 ====
sensor4.cpp
Linking sensor4
==== Building slope ====
slope.cpp
Linking slope
==== Building wheel1 ====
wheel1.cpp
Linking wheel1
==== Building wheel2 ====
wheel2.cpp
Linking wheel2
==== Building wheel4 ====
wheel4.cpp
Linking wheel4
Note that all the example binaries will be inside
ode/roboSimu/DebugLib
. Enjoy!
Comments !