How to import existing ROS packages in Eclipse

       Use Eclipse c/c++ IDE to develop ros programs. I have imported the entire ROS workspace into Eclipse, but suddenly I want to add a new program package, and this ROS package has been built. Directly drag it to the ROS workspace imported into Eclipse. No newly added packages are displayed in Eclipse, so you can right-click the project name (or source folder name) in the Eclipse ROS workspace project > Index > Freshen All Files. It is found that the newly added ROS package is displayed normally under the ROS workspace folder of Eclipse. You're done.

       It is worth mentioning that it is not very convenient to debug ROS programs on Eclipse, but it is still very good to use Eclipse to view the code. As long as the Includes and lib libraries are added, follow the command:

$ catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles"  -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8

Compiled packages can clearly view the internal calls of the program.

The command to set project parameters can be referenced as follows, and executed in the ROS workspace path (such as catkin_ws) that will be imported into Eclipse:

$ awk -f $(rospack find mk)/eclipse.awk build/.project > build/.project_with_env && mv build/.project_with_env build/.project

In addition, if you import the compiled executable file, you can also debug it. The premise is that the compilation type needs to select Debug (DCMAKE_BUILD_TYPE=Debug).

 

 

Guess you like

Origin blog.csdn.net/liuxhCSDN/article/details/94562920