Setup on Ubuntu Eclipse IDE for ROS development on C++

Add and run code for another ROS-package

Similar way add source file for another application

  1. add a new source file “listener.cpp” to “src” directory
  2. copy/paste content from the section “1.2.1 The Code” of the  tutorial (or from GitHub)
  3. in the file “CMakeList.txt” add a new line “rosbuild_add_executable(listener src/listener.cpp)”
  4. build the project – make sure the directory “Binaries” contains file “listener”
  5. create a new “Run Configurations” (click on the button “Add” in the dialog “Run Configurations”)
  6. add an executable “listener” in the dialog “Program Selection”
  7. click the button “Apply” and close the dialog “Run Configurations”

Switch to the Terminal where “roscore” was started. Ensure it is started or start it again.

Start a new Terminal. Run following command to start ROS-package “talker”

rosrun ExampleCpp1 talker


Switch to Eclipse, select the project in the “Project Explorer” tab and click on the button “Run” EclipseIconRunProject – “listener” package will start receiving data from “talker” and show it in the “Console” tab.