Remote Development of Mobotware Using Eclipse: Difference between revisions
No edit summary |
No edit summary |
||
Line 99: | Line 99: | ||
== Set up an Eclipse Remote Development Project == | == Set up an Eclipse Remote Development Project == | ||
Go to '''File->New->Project...'''. Under '''C/C++''', choose '''C++ Project''' and click '''Next'''. Give your project a name, and uncheck the '''Use default location''' checkbox. This will enable the '''Location''' field. Choose the base folder of your project inside the mount folder |
Revision as of 14:27, 15 June 2011
It is possible to use an Eclipse, running locally on one's computer to remotely develop Mobotware residing in Kalman. This tutorial will describe how to set up eclipse so that one can:
- use full features of Eclipse including indexing, content assist, error highlighting and much more...
- build on the automation servers from inside Eclipse
- debug the code running on the SMRs while stepping through the source code and observing variables in Eclipse
The following description is for Eclipse Galileo (Eclipse 3.5.2), hopefully, the steps will not be very different in future versions.
There are essentially 4 things to do:
- Install Eclipse and the required plug-ins
- Mounted on the local file system the Mobotware directory (or a sub-directory of it) residing in Kalman.
- Set up an Eclipse project for remote development
- Configure Eclipse to make sure all the nice features are available
NOTE: The windows tutorial is not finished as of this very moment!
Install Eclipse
One first needs to install Eclipse, along with the necessary plug-ins for C++ development as well as remote development. Installing Eclipse and enabling it for C++ development differs substantially between operating systems:
Windows
It is non-trivial to set up an Eclipse C++ development environment under windows. It is not particularly hard, but it's an integration between Eclipse, a plug-in called CDT and GCC ported to windows. It would be futile to list the steps as of writing this tutorial, as the process changes slightly depending on the versions of the named software elements. Try googling "C/C++ development using Eclipse under Windows" and come back when you have this working properly.
Now, it is necessary to install two other plug-ins for our task:
- TM and RSE (Remote system Explorer)
- Eclipse C/C++ Remote Launch
As you've probably already noticed while installing CDT, one installs Eclipse plug-ins through Help->Install New Sofware.... The drop down list next to Work with lists some software sites, but the ones we need are probably not there. Click on the 'Available Software Sites' link just under the Add... button to get a list of software sites compatible with your version of eclipse. You need to add:
RSE - http://download.eclipse.org/dsdp/tm/updates/3.1 - for TM and RSE CDT - http://download.eclipse.org/tools/cdt/releases/galileo - for Eclipse C/C++ Remote Launch, under CDT Optional Features
Note that the above links and names might differ slightly depending on the version, but you're choosing from a list anyway.
Ubuntu
It is much easier to set up Eclipse for C++ development under Ubuntu. Simply type
sudo apt-get install eclipse
At the command line to install eclipse. This will probably be vanilla Eclipse that won't support plug-ins. So, if you have problems installing the plug-ins later, type
sudo apt-get install eclipse-pde
To prepare eclipse for the plug-ins. Eclipse plug-ins are installed through Help->Install New Sofware.... The drop down list next to Work with lists some software sites. We will install CDT (C/C++ Development Tools) from Galileo Update Site - http://download.eclipse.org/releases/galileo/. This is for Eclipse Galileo of course, it will look slightly different on different versions. Select that site, and under Programming Languages mark Eclipse C/C++ Development Tools. Finish the installation by clicking Next and so on...
At this point, you should be able to create, compile, run and debug local C/C++ projects as long as you have gcc and make installed. If not, try
sudo apt-get install gcc make
Now, it is necessary to install two other plug-ins for our task:
- TM and RSE (Remote system Explorer)
- Eclipse C/C++ Remote Launch
Go to Help->Install New Sofware... again, but the software sites we need are probably not in your drop down list. Click on the 'Available Software Sites' link just under the Add... button to get a list of software sites compatible with your version of eclipse. You need to add:
RSE - http://download.eclipse.org/dsdp/tm/updates/3.1 - for TM and RSE CDT - http://download.eclipse.org/tools/cdt/releases/galileo - for Eclipse C/C++ Remote Launch, under CDT Optional Features
Note that the above links and names might differ slightly depending on the version, but you're choosing from a list anyway.
Mount the Mobotware directory
There are many ways to mount your home folder or directly the Mobotware directory residing on Kalman to your local file system. To avoid most complications, we will do it using sshfs here. In order to do so, we need to be able to connect to kalman.iau.dtu.dk using ssh.
If you are outside the automation network (such as on DTU wireless), you will have to tunnel to kalman through DTU G-Bar for instance. How to do this depends on your operating system. Note that, you do not need the tunneling step if you can already connect to kalman.iau.dtu.dk
Tunneling to Kalman
Windows
[www.putty.org putty] is a great and free ssh client for windows and it supports tunneling.
Ubuntu
In order to tunnel to kalman through G-Bar, you will simply need to type the following in a new terminal:
ssh -L10000:kalman.iau.dtu.dk:22 {gbarusername}@login.gbar.dtu.dk
Don't forget to substitute {username} with your own.
Mounting a Directory from Kalman on Your File System
Windows
Dokan can be used to mount an sshfs drive on windows. Download and install the Dokan Library and then download and run the Dokan SSHFS
Ubuntu
If you do not already have it installed, type the following to install sshfs
sudo apt-get install sshfs
Now create the folder where you would like to mount.
mkdir mountPoint
If you have direct access to Kalman you can type the following to mount a drive from Kalman:
sshfs {kalmanusername}@kalman.iau.dtu.dk:projectpath mountPoint
If you created a tunnel as described before, than you need to go through that tunnel
sshfs -p 10000 {kalmanusername}@localhost:projectpath mountPoint
At this point, you should see the contents of the projectpath at the mountPoint. You can verify this with:
ls mountPoint
Set up an Eclipse Remote Development Project
Go to File->New->Project.... Under C/C++, choose C++ Project and click Next. Give your project a name, and uncheck the Use default location checkbox. This will enable the Location field. Choose the base folder of your project inside the mount folder