=====Getting started with DUNE, Neptus and IMC=====
==== Prerequisites ====
You need to use a Linux computer. I prefer Linux Mint on a Dual boot computer, but a virtual computer is also an alternative.
In your linux terminal, you need to get some basic tools. (The commands are for debian-based distros like Ubuntu)
sudo apt-get install build-essential
sudo apt-get install g++ gcc openjdk-8-jdk
sudo apt-get install git cmake
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get install oracle-java8-installer
sudo apt-get update
==== DUNE ====
All code and shared files are placed on a gitlab repository. You can find it here: [[https://github.com/adallolio|Albertos Git]]. To get the code yourself, you clone it into your chosen folder.
mkdir dune_all
cd dune_all
git clone https://github.com/adallolio/dune.git
cd dune/
git checkout AutoNaut
cd ..
mkdir build
cd build
cmake ../dune
make -j8
To find out more about DUNE, read [[https://lsts.fe.up.pt/toolchain/dune|LSTS Toolchain/Dune]]
==== Neptus ====
Now, clone and build Neptus.
git clone https://github.com/adallolio/neptus.git
cd neptus
git checkout AutoNaut
ant
When it is build, jump to the AutoNaut branch and open Neptus by typing
git checkout AutoNaut
./neptus.sh
Once Neptus is opened, to see your vehicle, you click //Consoles/Open// and choose //ntnu/fixed-wind.ncon// or another if you're not working on a fixed-wing vehicle.
==== IMC ====
git clone https://github.com/adallolio/imc.git
cd imc/
git checkout AutoNaut
==== Working with DUNE ====
To start DUNE, you need to choose a configuration file (that is, a .ini-file). These files are placed under the // /etc//-folder. Assuming you are in the correct branch (AutoNaut), you can run simulations by typing
./dune -c ntnu-autonaut -p Simulation
It is also possible to see the available cmake flags and change their values in a simple GUI by running ''%%ccmake ../dune%%'' in the build directory (requires ''%%sudo apt-get install cmake-curses-gui%%'').
A lot of the tasks are specified to work either in //Hardware// or in //AP-SIL// or simulation mode. Then, you write
./dune -c name.ini -p Hardware
or, of course, //AP-SIL// instead of //Hardware//.
When DUNE starts running, the messages you get tell you which tasks are starting, and whether there are any warnings or errors.
To make your own task, type
cd dune/user
python ../programs/scripts/dune-create-task.py . "Your Name" Your/Task/name
To make sure your new tasks or files are compiled, type in your terminal:
make rebuild_cache
It could be wise to follow the tutorial on [[https://github.com/LSTS/dune/wiki|LSTS Dune Tutorials]]. The tasks communicate using IMC Messages. Read more about them on [[https://lsts.fe.up.pt/toolchain/imc|IMC]]. To make debugging easier, you can code your printouts as //err//, //war//, //inf// and //cri//:
war("This is a warning message. You don't need any endline.");
You can also use the debug symbols //debug//, //trace// and //spew//.
==== Cross-compiling dune ====
To be able to use dune on an on-board platform, you need to cross-compile it and have a version of Glued on your on-board computer. See [[https://lsts.fe.up.pt/toolchain/glued|GLUED]] for description of how this is done.