Ubuntu14.04 installs Kdevelop for ROS development

1. Install gcc

sudo apt-get build-dep gcc
sudo apt-get install build-essential

 2. Install KDevelop

sudo apt-get install Kdevelop

 3. Install cmake, etc.

sudo apt-get install automake autoconf g++ libtool cmake 

 4. Configuration (refer to ros-wiki) http://wiki.ros.org/IDEs

cd ~/Desktop
touch kDevelop.desktop
chmod +x kDevelop.desktop
sudo gedit kDevelop.desktop

 Add the following text:

[Desktop Entry]
Type=Application
Terminal=false
Exec=bash -i -c "kdevelop"
Name=kDevelop
Icon=kdevelop

 Save and exit, and the kDevelop icon will appear on the desktop.

5. Create catkin package

5.1 Import catkin top-level workspace

      First clear the build folder under the catkin_ws folder (it will appear again the next time you compile)

      Open kDevelop and use the shell or desktop icon

      Click "Project" -> "Open Project", find CMakelists.txt under catkin_ws/src, select it, click "Next", and change the project name to your own (the default is src)

      Select "Build System" as "CMake Project Manager"

      "Finish”

      The Configure Build Directory window appears

      Change the "build directory" to /home/user/catkin_ws/build/     (the one that was removed at first)

      Select the appropriate build type "Debug/Release"

      Extra parameters

-DCATKIN_DEVEL_PREFIX=../../devel -DCMAKE_INSTALL_PREFIX=../../install

      Note: For nested subdirectory structures, the appropriate number of ../ must be added 

6. Run and debug your own executable

    Click the "down arrow on the right side of the code" -> "debug launch F9" for "launch configuration"

    Click "Add New..." to select the executable to debug eg "~/catkin_ws/devel/lib/package/node_name"

    "OK"

    Click "Execute" or "Debug"

7. Precautions

    If there is a problem in the above process, you can delete the "*.kdve4" file under "catkin_ws/src./", and then repeat the above process.

The "Build Type" selected during project import (e.g. "Debug", "Release", "RelWithDebInfo") can be changed by right-clicking on the project -> "Open Configuration...". Select CMake in the left menu and change the CMake variable "CMAKE_BUILD_TYPE" appropriately.

Note, if a package inside the catkin workspace specifies its own "Build Type", e.g. by adding set(CMAKE_BUILD_TYPE Release) to the underlying package "CMakeLists.txt", it will be used for that package instead of the global one defined in the top-level CMake project.

You may set up a project filter since kDevelop displays a lot of files and (ros) binaries in the source tree that are not really interesting for the developer and finding individual files could be really confusing. Right click on the project and select "Open Configuration...". Choose "Project Filter" in the left menu. The cleanest solution is to first exclude all files and then include only desired file types:

  1. Click Add. Type in the pattern: "*" (just the star character) and select as "Target" only Files. Choose "Action" Exclude.

  2. Now add all files you want include into the project tree:

    Click "Add" and type in your desired file pattern. Choose "Action" Include. Suggested file patterns are: ".h" ".cpp" ".hpp ".c" ".ipp" ".c" ".txt" ".launch" ".xml" ".md" ".cmake" ".cfg" ".py" ".yaml" ".urdf" ".sdf" ".xacro"


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325419269&siteId=291194637