Wheels of btRaycastVehicle partially penetrating ground

gunnar
Posts: 18
Joined: Fri Jun 20, 2008 2:01 pm

Wheels of btRaycastVehicle partially penetrating ground

Post by gunnar »

Hi,

I have not used the btRaycastVehicle for my own simulations, but when I just compile the demos included in the bullet sources (just running 'jam'), the wheels of the vehicle are behaving rather strange, jumping up and down while partially penetrating the ground. This has happens with the VehicleDemo, and now also ForkLiftDemo.

I've uploaded a screen capture of the ForkLiftDemo where you can see the wheels jumping up and down:
http://www.youtube.com/watch?v=8habs62Kyag

OS: ArchLinux
Kernel: 2.6.26
GCC: gcc version 4.3.2
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by John McCutchan »

I can't reproduce this under Linux using either the Jam or CMake build methods.

John
gunnar
Posts: 18
Joined: Fri Jun 20, 2008 2:01 pm

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by gunnar »

Strange.. The same thing happens even if I compile the demos using a build script I put together on my own, using scons. I've seen the same thing since I first tested the vehicle demo, I beleive it was bullet 2.66. I don't know what it might be, the other demos work as they should.

EDIT: There must be something with archlinux, I have two machines with quite different hardware running arch, and the same thing happens on both. I'll try an ubuntu live CD, but it probably works there.
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by John McCutchan »

I tried it under Ubuntu. Perhaps ArchLinux's gcc version has a bug.
gunnar
Posts: 18
Joined: Fri Jun 20, 2008 2:01 pm

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by gunnar »

John McCutchan wrote:Perhaps ArchLinux's gcc version has a bug.
Yes, it must be something like that. I thought it might have been a problem that affected more linux distros, but I suppose I'm on my own then :D
gunnar
Posts: 18
Joined: Fri Jun 20, 2008 2:01 pm

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by gunnar »

Ok, I ran the same executable on Ubuntu and the wheels pop up and down the same way. Unfortunately I was not able to compile code with the Live CD I was using, but I'll try to install Ubuntu and see what may be different.

Thanks!
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by John McCutchan »

That's not surprising. If the compiler is broken, the bad code is already present in the binary. Please recompile on a mainstream Linux distribution such as Fedora, Ubuntu or Debian.

Thanks,
John
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by John McCutchan »

Gunnar,

gcc 4.3.X introduces some changes to how the base math functions (sin, pow, etc) are compiled. If you could install the latest Ubuntu 8.10 alpha and any post-release updates and test with gcc 4.3.X under Ubuntu it would be greatly appreciated.

Thanks,
John
gunnar
Posts: 18
Joined: Fri Jun 20, 2008 2:01 pm

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by gunnar »

Ahh, bummer, not familiar with the Ubuntu versioning scheme I just installed the 8.04. I'm downloading the 8.10 alpha-5 iso now, and test on that. Thanks for making the discovery, seems they changed quite a lot on gcc 4.3, as this is not the first problem I've had with it either.

Thanks!
Gunnar
gunnar
Posts: 18
Joined: Fri Jun 20, 2008 2:01 pm

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by gunnar »

John McCutchan wrote: gcc 4.3.X introduces some changes to how the base math functions (sin, pow, etc) are compiled. If you could install the latest Ubuntu 8.10 alpha and any post-release updates and test with gcc 4.3.X under Ubuntu it would be greatly appreciated.
John
John,

You were right, compiled the demos on gcc 4.2.<something> on Ubuntu 8.04 and both the VehicleDemo and ForkLiftDemo were OK. Now, I have Ubuntu 8.10 running with gcc 4.3.2 (the same I have on Arch), and it's the VehicleDemo and ForkLiftDemo behave exactly as they do on Arch.

Does it have something to do with the following [ http://gcc.gnu.org/gcc-4.3/changes.html ]:
The GCC middle-end has been integrated with the MPFR library. This allows GCC to evaluate and replace at compile-time calls to built-in math functions having constant arguments with their mathematically equivalent results. In making use of MPFR, GCC can generate correct results regardless of the math library implementation or floating point precision of the host platform. This also allows GCC to generate identical results regardless of whether one compiles in native or cross-compile configurations to a particular target. The following built-in functions take advantage of this new capability: acos, acosh, asin, asinh, atan2, atan, atanh, cbrt, cos, cosh, drem, erf, erfc, exp10, exp2, exp, expm1, fdim, fma, fmax, fmin, gamma_r, hypot, j0, j1, jn, lgamma_r, log10, log1p, log2, log, pow10, pow, remainder, remquo, sin, sincos, sinh, tan, tanh, tgamma, y0, y1 and yn. The float and long double variants of these functions (e.g. sinf and sinl) are also handled. The sqrt and cabs functions with constant arguments were already optimized in prior GCC releases. Now they also use MPFR.
Kind regards,
Gunnar
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by John McCutchan »

Thanks for the confirmation. If my hunch is correct it does have something to do with that change. I'm downloading Ubuntu 8.10 right now and am going to investigate this problem tomorrow. I'll keep you posted.

Thanks,
John
gunnar
Posts: 18
Joined: Fri Jun 20, 2008 2:01 pm

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by gunnar »

I'm downloading Ubuntu 8.10 right now and am going to investigate this problem tomorrow. I'll keep you posted.
That is very nice, as I wouldn't even know what to look for. :D

Thanks!
Gunnar
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by John McCutchan »

Hi Gunnar,

I've looked into this and it does appear to be a bug in the archlinux distribution. Compiled under Ubuntu 8.10 with GCC 4.3.2 everything appears to work fine.

Thanks,
John
gunnar
Posts: 18
Joined: Fri Jun 20, 2008 2:01 pm

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by gunnar »

Ok, Thanks.

I can only assume there is something special about GCC 4.3.2 and my hardware, because I compiled the demos on Ubuntu 8.10, and saw exactly the same behaviour. Not to come across as a lying numbnut here, I can provide a screencast proving that I'm actually telling the truth. But if you were not able to reproduce the error, then don't waste any more time on this, I'll put together a separate vehicle demo and see how that works.

Kind regards,
Gunnar
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Re: Wheels of btRaycastVehicle partially penetrating ground

Post by John McCutchan »

Gunnar,

Can you try reproducing this bug on a different machine than the one you're currently seeing the problems on? That would help us in figuring out what is causing the behaviour you're seeing.
BTW, is there anything unusual about your hardware setup?

Thanks,
John