All of the demo programs can be accessed by running the d2k-demos script. A text menu will show up, and you can type the name of the demo you wish to run. The demos as of this writing are:
- display - Displays a robot using the displayCfgGL program. You can interactively move the robot's joints using the GUI, and can save images to a file.
- arm - Shows a robot arm following a predefined trajectory, using kinematic (rather than dynamic) simulation. This demo uses evStandaloneGL, a general-purpose shell program for running Darwin2K simulations.
- cdemo - Another manipulator simulation, though this one uses dynamics and constraints. The underlying machinery is a little more complex than it appears: in this case, the robot's base is actually free-flying, but the end effector has been constrained to stay in the same place. This demo also includes simulation of joint limits with constraints.
First of all, you needn't run all the demos in order. Go ahead and run them all to see what Darwin2K can do, and then come back and read each section here if you want to find out more about what goes on under the hood.
Demo 1: display
This demo displays a two-armed robot using the displayCfgGL program. You can select a serial chain and joint using the two pulldown, and can move the selected joint using the slider below. This robot has two arms attached to a pyramidal base. While one could consider the entire robot to be a single serial chain, it can be more convenient for control purposes to think of it as two serial chains attached at the base link--and this is what Darwin2K does. Thus, you can select one of the two serial chains from the serial chain pulldown, and then select one of seven joints from the joint pulldown.
The program name "displayCfgGL" is short for "display configuration using openGL". The core Darwin2K capabilities are display-independent, though there GL and OpenInventor display layers are also included in the Darwin2K distribution. If you have the OpenInventor development environment installed, you should also be able to use "displayCfgIv". In either case, you can save a snapshot of the current rendering window by clicking the "Save Image" button. This will write a ppm file using the current basename and index, which you can modify in the two text windows at the bottom of the GUI. Make sure you press return after making changes to either window.
The 'display' demo calls displayCfgGL with three arguments:
displayCfgGL best8.l componentDB disp.pThe first file, called an l-file, describes the robot configuration being modeled. The second file is a componentDB and contains specification for discrete components using in building robots, such as motors, gearheads, harmonic drives, lead screws, and material types. The l-file can reference specific components in the componentDB, allowing new component specifications to be added without recompiling Darwin2K. The actuator and gearhead performance models in Darwin2K include effects such dry and viscous friction, power losses from motor winding resistance, continuous and peak torque limits, and gearhead and motor armature inertias. On the other hand, if you just want to do something simple, you can use a simple actuator that doesn't have any of the limitations of real life. Finally, the third file is a p-file, which contains run-time parameters for many Darwin2K components, including rendering, task representations, payload and obstacle models, and rendering.l-files: Describing robots l-files describe robots built from parameterized modules. Each module is a self-contained part, such as a base, link, joint, or tool, that can be connected to other modules at pre-defined connector locations. The reason for the use of modules, rather than lower-level descriptions (such as raw geometry and material information) is that Darwin2K was originally intended for automated synthesis and optimization, which is made more tractable by the use of predefined modules. This also makes it fairly easy for humans to piece together robots out of existing modules, though later we'll see how to add new modules to Darwin2K.
If you look at the best8.l, it looks like LISP: lots of lists, enclosed in parentheses. This format is also an artifact of Darwin2K's original intent, being easily read by a simple parser. Unfortunately, it's not quite as easy for humans to read and write, though it's not too hard with some practice. (Incidentally, the 'best8.l' robot is one designed automatically by Darwin2K; see Example 1 in my thesis or the Darwin2K book for more details on how this was done.)
Let's look at a simpler l-file:
displayCfgGL simple.l disp.padd simple .l and .l.sym files to play with, including original versions. paste in tutorial stuff on configurations using class browser doc to figure out parameters + num connectors
Alphabetic index Hierarchy of classes