Adding ROS Catkin package to Eclipse

After doing the preceding configuration, we can start adding ROS packages to Eclipse IDE. Click on File Menu | Project... from the New Project wizard, select
C/C++ | MakeFileProject with Existing Code:

Figure 6: Open the ROS package from the catkin workspace

There was a hello_world ROS package in ros_catkin_ws; we are opening this project. This package consists of two ROS nodes, talker.cpp and listener.cpp. You can open any packages on your workspace.

Give a name for this project as hello_world and browse the ROS package from the catkin workspace as shown in the following screenshot:

Figure 7: Giving project and location

After opening the project, right-click on the project and go to Properties of the project. From the Properties, click on the C/C++ Build option, and from the Builder Settings tab, change the Build command to the custom command called eclipsemake. Browse Build location of the ROS package by clicking on the File System button, as shown in the following screenshot:

Figure 8: Eclipse build settings for ROS

In C/C++ Build | Environment, add a new variable called VERBOSE and set the value as 1, as shown in the following screenshot:

Figure 9: Setting VERBOSE in ROS project properties

In C/C++ General, select Path and Symbols, choose the Symbols tab, and add a symbol called __GXX_EXPERIMENTAL_CXX0X__ in GNU C++ with no values. Click on Apply | OK to confirm the settings, as shown in the following screenshot:

Figure 10: Setting path and symbols for the ROS project

In C/C++ General, choose Preprocessor Includes Paths, Macros etc. from the Providers tab, check the options CDT GCC Build Output Parser [Shared] and GCC Built-in Compiler Settings [Shared]. We should also verify the Use global provider shared between projects option in both. Click on Apply and then click on OK, as shown in the following screenshot:

Figure 11: Setting Pre-processor in the project properties

After doing these all settings, we should clean the project by right-clicking on the Project | Clean Project. After cleaning, build the project (Ctrl+B).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.163.250