How to Build the FC Software 2005/07/01
Step 0: Before you start
The latest rocket simulator, RocketDes, requires additional libraries and header files to build successfully. Make sure that you have them in place if you want to run the simulator. If you don't then RocketDes will not build successfully, however the rest of the C bits will still build correctly.
The following software/libraries are required by RocketDes:
- readline
- sdl (Simple DirectMedia Layer)
- freetype (freetype2 font engine)
- oglft (OpenGL-FreeType Library - http://oglft.sourceforge.net)
Debian packages are available for all of the above except oglft. If you choose to use packages you will need the header files that accompany them. They are distributed in a separate dev package so don't forget those. For example if you install the libfreetype6 package you'll also need the libfreetype6-dev package.
*Note that the RocketDes makefile expects the oglft file "config.h" to be located in /usr/local/include/oglft/. It is not installed there by default so you need to copy it there from your oglft source directory.
> cp PATH_TO_OGLFT_SRC/config/config.h /usr/local/include/oglft
If anyone knows an easier way to deal with the need for this file, make it known.
Step 1: Get ready
- Get the
c
andjava
modules out of cvs (see ?AvionicsCVSAccess). - Or, do a
cvs update
Step 2: Build the rocket kernel, uncanny, and the other c bits
cd c/linux-2.4 |
|
make |
Make everything including the kernel and configure the kernel tree which includes the headers for uncanny |
make linux-2.4.27-adeos/.config |
To configure the kernel tree which includes the headers for uncanny only (may not work, may need to do make) |
sudo ln -s |
Make a sym link so that uncanny can find the kernel headers |
cd ../uncanny |
|
make |
Make uncanny |
cd .. |
|
make |
A top level make to get all the sequencer and whatnot bits |
*Note if the compiler complains about not being able to find a shared library (libSomeFile.so), then first see if you really have it on your system and it just can't find it:
> find /usr -name 'libSomeFile.so'
If you find it, you need to add the absolute path to the file that it returned to /etc/ld.so.conf. Finally run 'ldconfig' to add the path. Now recompile
Step 3: Build the java bits
cd ../java |
|
ant jar |
Build the java stuff |
java -jar dist/rocketview.jar |
run rocketview just to make sure it works |
cp src/launchcontrol/main.conf . |
Copy over main.conf so changes you make aren't committed |
ln -s src/launchcontrol/sched.conf . |
Always look at the latest sched.conf which gets updated by CVS every once in a while |
java -jar dist/rocketview.jar lc |
Run launchcontrol |
Step 4: Connect to the rocket
- If you have the field server, then connect to the
psas
network and the field server will usenetforward
to get you to the rocket at 10.0.0.1. - If you don't have the field server, then you'll need an orinoco card:
cd c/tools |
|
=./wireless.sh eth |
where n is your orinoco card interface address (try running /sbin/ifconfig ) and where m is some arbitrary large number like 57 |
Step 5: Copy stuff to the rocket
- To connect to the rocket:
ssh root@10.0.0.1
. - Remount the compactflash disk as read-write:
mount -o remount,rw /
- On your computer, scp over the files:
scp uncanny/can.o fcfifo/run_threads root@10.0.0.1:/tmp
Step 6: Run stuff on the rocket.
- Edit
setbase.sh
to get you the right GPS base coordinagtes and then run it:. setbase.sh
- Add in the new uncanny can driver:
insmod /tmp/can.o
- And run run_threads IF AND ONLY IF YOU WANT THE ANTENNAS ON!
DEBUG=1 ANTENNA=1 /tmp/run_threads
Step 7: Put good code in a more permanent place
- In the
/root
directory, you'll notice direcotries with dates (e.g.,20050701
). Make one of these, and copy over all of the previous bits from the last directory. - Overwrite your new bits into that directory.
rm current
and thenln -s <yournewdirectory> current
in order to getcurrent
to point to your new bits.- Remount the compactflash disk as read-only:
mount -o remount,ro /
... and that's it. Whew!
logs are in /var/log/psas