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

If you really must use the install space, you'll need to add the required install(..) statements to your CMakeLists.txt. See catkin 0.6.14 documentation » How to do common tasks » Package format 2 (recommended) » Building and installing C++ executables for more info on that.

As @dornhege mentioned, all binaries will always also end up in /path/to/catkin_ws/devel/lib/<pkg>, so if you source /path/to/catkin_ws/devel/setup.bash, you should be able to start your node, even without having an install(..) statement in your build script.

then usually I source /home/cesare/ros_ws/install/setup.bash but when i try to run the node with rosrun pcltest xxx i have an error, it looks like it's not copying the binary from the build to the install folder... what am I doing wrong ?

If you really must use the install space, you'll need to add the required install(..) statements to your CMakeLists.txt. See catkin 0.6.14 documentation » How to do common tasks » Package format 2 (recommended) » Building and installing C++ executables for more info on that.

As @dornhege mentioned, all binaries will always also end up in /path/to/catkin_ws/devel/lib/<pkg>, so if you source /path/to/catkin_ws/devel/setup.bash, you should be able to start your node, even without having an install(..) statement in your build script.

then usually I source /home/cesare/ros_ws/install/setup.bash but when i try to run the node with rosrun pcltest xxx i have an error, it looks like it's not copying the binary from the build to the install folder... what am I doing wrong ?

If you really must use the install space, you'll need to add the required install(..) statements to your CMakeLists.txt. See catkin 0.6.14 documentation » How to do common tasks » Package format 2 (recommended) » Building and installing C++ executables for more info on that.

As @dornhege mentioned, all binaries will always also end up in /path/to/catkin_ws/devel/lib/<pkg>, so if you source /path/to/catkin_ws/devel/setup.bash, you should be able to start your node, even without having an install(..) statement in your build script.


Edit:

Now works, I found the problem (but I don't understand), apparently it was caused by add_executable being called to early in the CMakeList (see comment in file).. [..]

Ordering of statements in CMakeLists.txt files is very important. This is not ROS and / or catkin specific, normal CMake can also do strange unexpected things if you don't setup your scripts correctly.

See wiki/catkin/CMakeLists.txt - Overall Structure and Ordering for an overview of the order of statements for catkin.