Software - Juggler
This application reads 3D geometry parameters from an XML file, then generates and displays a Java3D model. The program provides the user with a set of Swing-based GUI controllers to manipulate the movable parts and animate them. The controllers give the user the ability to control all aspects of the movements and behaviors.
Individually the program parts are a generic solid modeler, and a set of controllers and analyzers.
Collectively, however, it is a simulator of a robot entertainer with a horn instead of a mouth, and a wheel instead of legs. It doodles around a stage while balls are queued into a hopper, then one at a time they are launched out over the stage, where it catches them and adds them to its juggling pattern. It if gets too many balls, or it just gets bored, it will toss balls back into the hopper.
I'd actually like to build a working robot that juggles - well, just the arms and eyes anyway - that can see balls coming within reach and catch and juggle them.
Details
I expanded the functionality of the Model Editor for the Juggler because of its complexity. The XML file that defines this guy is nearly 3700 lines long, and keeping it all straight in my head was quite overwhelming. The Juggler model consists of hundreds of elements organized into solid sub-assemblies and joined by 77 movements; which define the relationship between two solids, like a rotation or a translation.
Each element, assembly and movement is defined by a number of attributes; so the model editor not only displays a graphic image of the complete assembly, it also displays a hierarchical data map in a tree structure and a set of low-level controllers to actuate the movements.
The Juggler
The Model Hierarchy Map and Element Attributes
The Juggler
The Low-Level Controllers
The program places the Juggler on a stage with a hopper/chute. The Juggler wanders around stage waiting for something to happen. 10 balls come flying along into the hopper, wind their way down the chute to a queue. When you click the “Toss a Ball” button a mechanism dispenses one out a trough. The ball bounces (once) and a swinging mallet whacks it out onto the stage. The Juggler looks over and watches the ball in flight, and predicts when it will be within reach (moving to it if it needs to), at which point it will reach up and catch it.
The Juggler will continue to saunter around the stage juggling as many balls as it has been tossed. If it gets too many balls (the laws of physics are such hard task-masters) it will simply start tossing balls back to the hopper.
The Juggler has a number of random paths it wanders around the stage on, and a number of juggling patterns for each given number of balls it has in control at a time. Some of the juggling patterns include bouncing the ball on the ground or off the wall.
The Juggler on Stage
The Chute is a semi-transparent spiral that the balls enter and slow down as they wind their way down. The launch mechanism consists of a wheel that turns pulling a latch that queues and dispenses one ball at a time. The ball rolls out from the latch and bounces on the ground. A mallet starts swinging at the same time, and is timed so that it smacks the ball at the apogee of its rebound, sending the ball flying out over the stage. Hopefully the Juggler is within reach of it, or he will try to navigate to where he will be, but even if he can’t reach it in time, he just patiently makes his way over to where the ball will bounce to on the stage, and he will pick it up on the rebound.
The Chute/Launch Mechanism
I gave the Juggler a lot more capability than I actually use in the program: my imagination always seems to outdo my time/patience/ability to produce.
I wanted to decorate the rest of the stage and build a structure to hold the Hopper/Chute, but you can see I didn’t. I envisioned a more elaborate mechanism to actuate the latch; and I wanted to have him toot his horn/mouth, but I didn’t. He can bulge his eyes and hop, and individually articulate his fingers, but I spent so much time on the basic functionality that I just never got around to all the bells and whistles. I also intended to add editing functionality to the Model Editor program, whereas (as useful as it is,) now it's really just a Model Viewer.