Added realistic physics engine for Xith3d (ODE)

Hi Jani,

I would be very interested in using your code, because I am developing a robot simulator using ode at my university and it would be wonderful to write it in Java.

I have been checking for some days your project site on java.net but unfortunately it seems that your project is still under review. Since I need to start writing code asap, I would be very grateful if you might send me your code or make it avalaible somewhere.

Thanks a lot

Paolo

I am very interested in the current status of the physics engines of David, shawnkendall and Jani, too. If there are some updates please post them here.

Looks like I’m not the only one monitoring this thread eagerly awaiting something to get my dirty hands on… ANY progress on ANY bindings or physicsengine a la ODE would be greatly appreciated :stuck_out_tongue:

/Micke

I will set odejava package up in some www-site in six hours after writing this email. The package is ready.

dev.java.net sure takes some time to get it up, so it is best that I share this package today. I have to go for other businesses for some hours but after that I write an email (and instructions) and a link where to download it.
Package contains also some Xith3d examples (box simulation and car simulation).

Perfect. Good news. Looking forward to see the demos.

Yuri

Download odejava-0.1.zip from the link below:
http://cray.tuug.fi/~jani/odejava/

Sorry that it took more than I promised, I realised that I needed to write some readme and compiling information for those people that are not using windows systems.

I truly hope someone can benefit from this package. If you do, send some email to me and tell what kind of project are you running.

And when someone compiles linux or mac native library, I would be glad to add that into this package.

As always, if it breaks your system down, do not blame on me :slight_smile:

Well bud win32 jar contains non-compiled source, no wonder nothing wanted to compile/run :stuck_out_tongue:

Woot!

Thanks, I’ve been hanging out for this to be released :slight_smile:

Java Cool Dude,
Good point, I made the package in a hurry… lib/odejava.jar was broken.

In any case the file lib/odejava.jar is not required as the package contains full source (see odejava/net directory). I fixed odejava.jar now to both www-page zips.

By the way, I added another (bigger) package that contains easy way to execute the demos (in windows).
See this thread:
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1070408605

Just to inform that Java Cool Dude had some problem executing the demos (javaode-0.1-full.zip).
His problem was:
Exception in thread “main” java.lang.UnsatisfiedLinkError: new_dWorld
at net.java.dev.odejava.ode.OdeJNI.new_dWorld(Native Method)

Please tell me if you have problems so I can fix this.

I do not know JCDudes platform but as my dll building knowledge is quite low I decided to inform about possible problem on this thread also (see the message below). Of course if you are compiling your own odejava library, you know what you get. I am confident that the source code runs well on all the platforms that can compile + run ODE as well.

Info message follows…

The package has been now tested succesfully on 5 different Windows machines. Although all the machines had Windows XP or Windows 2000 and JDK (or JRE) 1.4.2_02.

Just to make sure, I tested it again ok with the following software:
Windows 2000 / SP4 / JRE 1.4.2_02
This machine was quite clean w2k install.

I have not tested it on Win95/98/Me, my dll and msvc6 knowledge is very low so there might be very well be a problem with the dll on some systems.

PS. The cardemo needs a bit newer GPU hardware, boxdemo on the other hand is more CPU intensive.

Hi! we are a group of students and we are going to use odejava to develop a simulator for robots in dynamic environments.

I’m tryng to build odejava on linux debian but so far I have not been successful…

First, if i get this correctly I think that according to the readme.txt
odejava.h
odejava.cpp
odejava.i
files should go into javaode/net/java/dev/odejava/ode and not in zip’s root as in odejava-0.1.1-full.zip right?

Then after i ran swig i try with
g++ -c -I /usr/local/j2se/include/ -I /usr/local/j2se/include/linux -I …/…/…/…/…/include odejava_wrap.cxx

and i get
odejava_wrap.cxx: In function void Java_net_java_dev_odejava_ode_OdeJNI_dHingeJoint_1addTorque(JNIEnv*, _jclass*, long long int, float)': odejava_wrap.cxx:2416: error: addTorque’ undeclared (first use this function)
odejava_wrap.cxx:2416: error: (Each undeclared identifier is reported only once
for each function it appears in.)
odejava_wrap.cxx: In function void Java_net_java_dev_odejava_ode_OdeJNI_dSliderJoint_1addForce(JNIEnv*, _jclass*, long long int, float)': odejava_wrap.cxx:2620: error: addForce’ undeclared (first use this function)
odejava_wrap.cxx: In function void Java_net_java_dev_odejava_ode_OdeJNI_dUniversalJoint_1addTorques(JNIEnv*, _jclass*, long long int, float, float)': odejava_wrap.cxx:2929: error: addTorques’ undeclared (first use this function)
odejava_wrap.cxx: In function void Java_net_java_dev_odejava_ode_OdeJNI_dHinge2Joint_1addTorques(JNIEnv*, _jclass*, long long int, float, float)': odejava_wrap.cxx:3204: error: addTorques’ undeclared (first use this function)
odejava_wrap.cxx: In function void Java_net_java_dev_odejava_ode_OdeJNI_dAMotorJoint_1addTorques(JNIEnv*, _jclass*, long long int, float, float, float)': odejava_wrap.cxx:3765: error: addTorques’ undeclared (first use this function)

Is swig not including something?

Has someone suceded in building odejava under linux?

Thank you :slight_smile:

First, I know the readme is a mess, I really should have compiled and linked at least linux binaries, but I have linux only at work and well…

  1. unpack ode e.g. to directory /tmp/ode

  2. go to ode dir and do as the INSTALL file says
    “cd /tmp/ode”
    “cat INSTALL”

  3. I am assuming that following commands went ok
    “make configure”
    “make ode-lib”
    Now you should have a file /tmp/ode/lib/ode.so and plenty of *.o files under /tmp/ode/ode/src

  4. Handle odejava-0.1.1-full.zip into /tmp
    cd /tmp/ode
    cp -a /tmp/odejava/net /tmp/ode
    cd /tmp/odejava/net/java/dev/odejava/ode/
    swig -Wall -java -c++ -package net.java.dev.odejava.ode odejava.i
    cd /tmp/ode

  5. compile odejava_wrap.cxx (at /tmp/ode)

g++ -c -I ‘d:\j2sdk1.4.2_01\include’ -I ‘d:\j2sdk1.4.2_01\include\win32’ -I include net/java/dev/odejava/ode/odejava_wrap.cxx -o net/java/dev/odejava/ode/odejava_wrap.o

  1. compile odejava.cpp (at /tmp/ode)

g++ -c -I ‘d:\j2sdk1.4.2_01\include’ -I ‘d:\j2sdk1.4.2_01\include\win32’ -I include net/java/dev/odejava/ode/odejava.cpp -o net/java/dev/odejava/ode/odejava.o

  1. link odejava.so library (at /tmp/ode)

If you run into problems, take exactly same command that “make ode-lib” does last, just add: net/java/dev/odejava/ode/odejava_wrap.obj and net/java/dev/odejava/ode/odejava.obj files to get everything linked, you may change the library’s name from ode.so also into odejava.so

Here’s the last commands example:

ar rc lib/javaode.a ode/src/array.o ode/src/error.o ode/src/memory.o ode/src/obstack.o ode/src/odemath.o ode/src/matrix.o ode/src/misc.o ode/src/rotation.o ode/src/mass.o ode/src/ode.o ode/src/step.o ode/src/stepfast.o ode/src/lcp.o ode/src/joint.o ode/src/timer.o ode/src/mat.o ode/src/testing.o ode/src/collision_kernel.o ode/src/collision_util.o ode/src/collision_std.o ode/src/collision_space.o ode/src/collision_transform.o ode/src/collision_quadtreespace.o ode/src/fastldlt.o ode/src/fastlsolve.o ode/src/fastltsolve.o ode/src/fastdot.o net/java/dev/odejava/ode/odejava_wrap.o net/java/dev/odejava/ode/odejava.o

Note that I tested above g++ commands succesfully on my cygwin machine (winxp), so change path’s to java includes.

I suggest that you do not ascend into /tmp/ode/net/java/dev/odejava/ode directory.
keep yourself in /tmp/ode as this is where the ode’s makefile also is. For some reason g++ does not find ode’s include files even though your path (…/…/…/…/…/include) seems ok.

I am 100% sure that it works on linux. Similar interface file has been used for creating bindings for ode, under linux.

You can also mail to my personal account if you have more questions about compiling.

If you get a working odejava.so, please email it to me and tell me what ODE version (or cvs date) are you using, also what configuration (single vs. double precision, opcode vs. non-opcode).

PS. I hope Xith3d people wont mind that this thread get’s a bit away from Xith, odejava still have no forums up as dev.java.net is pending.

[quote]I hope Xith3d people wont mind that this thread get’s a bit away from Xith, odejava still have no forums up as dev.java.net is pending.
[/quote]
This thread isn’t really far from Xith3D - I believe many people here are interested in this porject.

Yuri

just was wandering if this engine is capable of handling Navier-Stokes equations, I am starting to work on more realistic looking(behaving) water and will need to use that.

Update: after running through docs I found that non-rigid body mechanincs is not supported - maybe in next version- it states

So that leaves me with rolling up sleeves and diving into math world :slight_smile:

I compiled libodejava.so for Linux platform. I tested it succesfully with console demo.

  1. Download linux library

http://cray.tuug.org/~jani/odejava/libodejava.so.gz

  1. Install library

gunzip libodejava.so.gz
mv libodejava.so odejava/lib/linux

  1. Run console test

java -cp .:./lib/vecmath.jar -Djava.library.path="./lib/linux" net.java.dev.odejava.test.OdeHelloWorld

Other tests are trivial to run, I am sure that they work. However, I could not test those under linux platform because I compiled this library on a remote server.

If this library get’s good feedback, I’ll add it to odejava packages.

Hope this helps…

PS. My friend is just compiling odejava for mac.

Sorry, I had to change the url because IE / Mozilla unpacked it implicitly, this may cause confusion so I now the file is named libodejava.tgz

Library can now be found from:
http://cray.tuug.org/~jani/odejava

Jani,

Looks like your project - odejava - is already accessible via on java.net!

Just check https://odejava.dev.java.net/ and you will see it works! It also added to games-middleware, i.e. the same level as Xith3D!

So, if you can confirm this, maybe we can setup standard infrastructure for it (I mean CVS, IssueZilla, etc.)?

Yuri

Yes, good news, odejava is now official on http://odejava.dev.java.net

I uploaded basic package + linux and mac os libraries to dev.java.net today. Also created two forums (users and development), perhaps this discussion should be moved to odejava.dev.java.net?

CVS is definately first priority. I have time to set this up next tuesday or wednesday. We need to set up better hierarchy for the files (than on my current package).

Please join to this project if you have any ideas to share about anything (odejava related). Project just started, so all comments are welcome.

Also, anyone who is developing Physics Engine in pure Java is more than welcome to the developer area.

PS. I assume YVG means you Yuri, as I gave observer and developer access to this account.

[quote]PS. I assume YVG means you Yuri, as I gave observer and developer access to this account.
[/quote]
Yes, thanks. ODE to Java bindings is exactly thing I need for my project(s), so I will do my best for it.

[quote]Also created two forums (users and development), perhaps this discussion should be moved to odejava.dev.java.net?
[/quote]
Most of games-related projects use forums at java-gaming.org. Here forums are well integrated and very easy to use. My suggestion is to post a request for ODEJAVA forum to “Suggestions” board here, so we have everything in one place.

Yuri

[quote]just was wandering if this engine is capable of handling Navier-Stokes equations, I am starting to work on more realistic looking(behaving) water and will need to use that.

Update: after running through docs I found that non-rigid body mechanincs is not supported - maybe in next version- it states

So that leaves me with rolling up sleeves and diving into math world :slight_smile:
[/quote]
Sorry, almost forgot to answer to this message. Better later than never I think…

All ODE related questions are best to direct into ODE’s own mailing lists. There is a good amount of activity and excellent knowledge of ODE’s guts. However if there’s some functionality that is missing from odejava then post a message to odejava.dev.java.net forums.