For background information, you may wish to read about the Redtree Hydra system model: http://www.redtreerobotics.com/wiki/index.php/System_Model
Setting up environment to compile Redtree code:
Redtree Hydra currently requires a Ubuntu or Debian based development environment. For the remaining instructions, open the terminal application in Ubuntu. In Ubuntu It can be found by clicking the Ubuntu search icon on the toolbar, and then typing terminal.
This command will install all of the tools required to build applications for the Hydra robot computer:
sudo apt-get install subversion build-essential g++-4.8 git
At the moment, we currently support development in c/c++. We do not have an in-house IDE, so you can use whatever you are comfortable writing code in. All of the code will be compiled in the terminal with a Makefile we provide.
We currently like using Geany because it's simple. You can get it on Ubuntu / Debian with:
sudo apt-get install geany
Setting up environment to run Redtree Hydra code on your computer:
It is also possible to run Redtree Hydra code on your Linux (preferably Ubuntu / Debian) computer. This will require an additional step. You need to checkout and install the Redtree Hydra middleware library (only the first time) - after that it will always be installed on your computer in the /lib directory. *note* This is not required on the actual Redtree Hydra unit as the units will ship with libaries already setup.
svn co http://www.redtreerobotics.com/svn/redtree-lib cd redtree-lib ./install.sh
Or for those of you who like git instead:
git clone https://github.com/redtreerobotics/redtree-lib.git cd redtree-lib ./install.sh
Making your first Redtree Hydra program:
Making your first program for the Redtree Hydra is really easy. Just check out the example code and change to the hello_robot folder:
svn co http://www.redtreerobotics.com/svn/redtree-apps/trunk/ redtree-apps cd redtree-apps/hello_robot
or if you prefer git:
git clone https://github.com/redtreerobotics/redtree-apps.git cd redtree-apps/hello_robot
You'll notice a makefile, and a .cpp file file. The Makefile has been setup to download the Redtree libraries automatically. It is also set up to automatically compile together any .cpp that exist within the folder, so feel free to add your own .cpp files as your projects become more complicated.
Let's look in more detail at what is inside the hello_robot.cpp file. This file contains the code that will run on the robot. You can open this with your favourite editor and work on the code in here. When you open the file you should see something like this:
#include <rtr.h>
#include <iostream>
using namespace std;
void configure(void) {}
void initialize(void) {}
void setup(void) {}
void start(void)
{
cout << "HELLO FROM THE ROBOT" << endl;
}Notice it looks like a normal c/c++ main - the only real change is including the rtr.h. Our toolchain and libraries take care of all of the rest of the work for you. To compile, just type make in the terminal where you checked out the code with subversion.
make
Note: the first time you compile a Redtree app you may need to install a bunch of dependencies.
Running the code on the robot
If you did this process on the robot itself (via SSH or through a USB serial connection for example) you just restart the robot and it will automatically run the new code you created. For now this is only way to get code onto the robot - but we're working on some easier ways such as through an IDE, over a web form or through the cloud service to deploy code to groups of robots.
Running the code on your computer
Make sure you've installed the Redtree Hydra library on your computer (see here)
Note: you need to run rtr-mid as root right now to take advantage of the networking libraries.
For 64-bit Ubuntu:
sudo rtr-mid64
And for 32-bit:
sudo rtr-mid32
You should see something like this after you run:







Comments