ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The answer and comment in response to my question pointed me in the right direction, namely that I was setting up packages to use with Eclipse improperly. As I mentioned in a comment I was putting the Eclipse project in the src/<package> directory when it should have been in the build/<package> directory. That put all the catkin files and directories in the 'build' instead of 'src'. With those in the proper place putting the entire 'src' directory under version control is possible.

To contribute something for others here is a script I use to create a package for use with Eclipse. You can put it and run it from anywhere because it switches to the catkin workspace directory. Be sure to change the script to your workspace. The sole parameter is the name of the new package. The script:

    #!/usr/bin/env bash
clear

cd ~/development/ros  <<<== change!!
cd src
echo

echo create package
catkin_create_pkg $1 std_msgs roscpp
echo
pwd

echo setup project for eclipse
pwd
cd ../build
mkdir $1

echo
pwd
cd $1
cmake ../../src/$1 -DCMAKE_INSTALL_PREFIX=../../install -DCATKIN_DEVEL_PREFIX=../../devel -G"Eclipse CDT4 - Unix Makefiles"

echo
echo set debug in build
cd ..
cmake ../src -DCMAKE_BUILD_TYPE=Debug

echo
echo back up to catkin worksapce
cd ..
catkin_make

Once it is run import the project to Eclipse from the build/<package> directory.