[ODE] Trebuchet demo

Shamyl Zakariya zakariya at earthlink.net
Tue Apr 27 17:25:42 MST 2004


It's funny, since I wrote a similar demo to stress-test an object model 
and feedback system I wrote on top of ODE's C API. My system's geared 
towards robotics, but I wrote a suite of different tests, and ... 
naturally, I wanted to make a trebuchet. But, it didn't work too well, 
so I made a vanilla catapult ( using a piston ).

http://home.earthlink.net/~zakariya/files/Catapultin-s3-low.mov
Admittedly, it's a poor shot. But it gets the point across.

And here's a quicky of my robot, stumbling over an obstacle using 
feedback on its motors for cues:
http://home.earthlink.net/~zakariya/files/clumsy.mov

I also do camera tracking, as well as motion path tracking. It's 
worthwhile, when I let my robot spend the afternoon wandering a 
randomly generated environment and I want to see if it wandered more or 
less evenly, or if it spent two hours stuck in a corner.

I'm going to try out your sample tonight.


Shamyl Zakariya
   "this is, after all, one of those movies where people spend a great
   deal of time looking at things and pointing."
	From a review of _Fantastic Voyage_

On Apr 27, 2004, at 11:23 AM, Brent Burton wrote:

>
> Hi all,
>
> To learn the ODE API and joint types, I wrote a little demo program 
> that
> simulates a trebuchet(*), and launches a projectile at a distant 
> target.
> The treb model uses hinges and sliders to model the constrained arm
> motion.
>
> In reality, a projectile is attached to the treb arm by a cord, with a
> metal ring at the end opposite the projectile.  The ring slips over a
> short pin that is attached to the end of the arm. As the arm swings, 
> the
> projectile swings further out, and eventually the ring slips off the 
> pin,
> launching the object.  Counter weight mass, arm length, arm mass, axle
> position, pin angle, cord length and projectile mass all affect how
> efficient the machine is.
>
> In ODE, the counter weight is on a vertical slider, attached to the arm
> with a hinge.  The arm's axle is on a horizontal slider. The ring-pin
> connection is yet another slider whose position is checked at each sim
> step to see if the ring position is longer than the pin length (and
> therefore released).
>
> One other demo aspect is how the viewpoint is changed relative to
> a moving object.  Press 'p' to toggle projectile following (turn it
> on to follow the projectile on its descent).
>
> The source and a binary are available at
>   http://www.io.com/~brentb/trebode.zip
> The binary is precompiled for Windows (cygwin), but you don't have
> to have Cygwin installed -- it'll still run from its directory.
>
> One problem I've run into is a crash when the number of boxes in the
> target wall is increased (more than the 10 now).  I've read about the
> Win32 stack size issue, but as far as I can tell, the treb program is
> compiled like the ODE test_crash.exe, and test_crash runs fine (155
> boxes).  As a test, I also built everything with MSVC 6, and used
>   editbin /STACK:16000000 treb.exe
> to set the stack size to a whopping 16MB which didn't fix it.
> Anyway, I haven't found this issue yet.
>
> cheers,
> -Brent
>
>
> (*)The particular design is a "floating arm trebuchet" originally 
> designed
> by Ron Toms; more info at www.trebuchet.com.
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>



More information about the ODE mailing list