EclipseUsage - RCPRG-ros-pkg/irp6_robot GitHub Wiki
Download and unpack Eclipse IDE for C/C++ Developers.
To improve the indexer behaviour, increase the default memory allocation in eclipse ini
Open new console
Source your workspace if you have not done it before.
- e.g. for irp6:
source ws_irp6/robot/devel_isolated/setup.bash
Run Eclipse in the same console.
cd ~/<your_eclipse_path>
./eclipse
Choose proper eclipse workspace (e.g. for irp6 ws_irp6)
Select File->New->Makefile Project from Existing Code.
Select catkin workspace that you want to build in Eclipse (for example robot folder in your IRPOS workspace ~/ws_irp6/robot).
Right-click on your project and select Properties.
Click C/C++ Build, and uncheck Use default build command box.
Write new Build command:
catkin_make -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCATKIN_ENABLE_TESTING=OFF
Then go to C/C++ General and select Preprocessor Include Paths, Macros etc. Select Providers tab, and change following entries:
- check CDT GCC Built-in Compiler Settings [Shared]
- check CDT GCC Build Output Parser
- In CDT GCC Build Output Parser modify Compiler command pattern:
(.*gcc)|(.*[gc]\+\+)|(.*clang)
Add eigen paths:
- C/C++ General -> Paths and Symbols -> Includes -> Add /usr/include/eigen3/ Add to all configuration, add to all languages
Now you can build your project in Eclipse using Project->Build All.
Import the code style for your C++ code: C/C++ General -> Formatter - > Enable project specific -> import -> eclipse-cpp-google-style.xml
- The file is stored in main repository of the project (e.g. for irp6 scripts/eclipse-cpp-google-style.xml)
- Please, use the formatter any time you safe the files.
Install eclipse plug-in from https://marketplace.eclipse.org/content/cppstyle.
- Check if cpplint.py is installed in your system, and check the path to this file. This script is already installed at our labs.
- If not download the cpplint.py file, add executable attribute and add its directory to system path.
- In project settings check CppStyle -> Enable project specific settings -> Run cpplint on save. The cpplint warnings will be shown in the problems tab any time you save the file.
- Before committing the files it is obligatory to remove all of the cpplint errors. Most of them occur, when you do not use proper code formatter.
Install eclipse plug-in from http://marketplace.eclipse.org/content/cppcheclipse.
- In project settings check cppcheclipse -> check for all known issues.
- Then you can perform checking by calling cppcheck->Run cppcheck from the project menu. The cppcheck errors and warnings occur in "problems" tab. You will be prompted to set path to cppcheck first time you call the check. Usually it is /usr/bin/cppcheck.
- Before committing the files all of the errors should be eliminated and warnings should be analyzed.
- install eclipse colorer plugin: http://colorer.sf.net/eclipsecolorer/