This assignment uses the Open Dynamics Engine (ODE, www.ode.org) to explore trajectory planning and optimization. Below are ODE demo programs and Linux and Windows versions of the necessary include and library files to compile them. Documentation and the source code for ODE is available from www.ode.org. Download the appropriate file below. The readme.txt file in the top level lists what the directories are. ode-demos includes the source and compiled versions for the demo programs that came with ODE. cga-demos includes the source and compiled versions for demo programs written by CGA.
Service Pack 6 for Visual Studio 6.
Part 1: Optimize the trajectory of a pendulum with friction. The program cga-demos/ass1kdc.cpp gives an example of an answer to this part, using a simple PD servo. Note that the score is printed out for each second of simulated time. See if you can find a way to swing the pendulum from the downward pointing equilibrium point to the upward pointing equilibrium point with a smaller score. The scoring function is given in the example program ass1kdc.cpp.
Part 2: Redo Part 1 with an unknown initial starting point.
The program ass1kdc.cpp (see links above)
shows how we will give an initial state
as command line arguments to the program:
ass1kdc.exe 2.1 5.3
For some reason command line arguments do not work under Windows, so
edit the program to change the initial state. Let us know if you figure
out how to fix this problem.
To get Windows to work with command line arguments the console subsystem
must be selected in the project configuration.
System -> Subsystem -> Console (/SUBSYSTEM:CONSOLE)
The range of initial states we will test on will have a maximum
energy of 20 (roughly twice the energy of the goal position).
If you don't want to use ODE, here is a C program and a Makefile that approximately matches the ODE simulation.
You can use any type of computer/OS/language you want. You can work in groups or alone.