Ask Your Question
0

How to move packages from build to devel folder

asked 2016-01-30 17:32:14 -0500

user23fj239 gravatar image

updated 2016-01-31 12:15:20 -0500

I cannot figure out why some of my packages end up inside the devel folder other stay inside the build folder (including their targets) Doc just says:

The location of the devel space is controlled by a catkin specific CMake variable called CATKIN_DEVEL_PREFIX, and it defaults to <build space>/develspace.

How to Configure the package.xml or CMakeLists.txt properly? Link for more info on the files
##EDIT addon
##1. I changed the order and It works. I thought this is the purpose of that command:

## Libraries are installed in a lib/ directory shared by all packages in entire ROS distro
 install(TARGETS my_test_lib
    ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})

## List all your executables as TARGETS to be installed in a per-package directory 
#   not the distro’s global bin/ directory
  install(TARGETS talker listener add_two_ints_server add_two_ints_client
    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

##2. Furthermore the tutorial uses find_package with genmsg but does not mention any build_depend in the xml? Is there a difference to message_generation? I get this if I use message_generation and not genmsg:

/home/baum/catkin_ws/src/test_my_env/src/add_two_ints_server.cpp:2:36: fatal error: test_my_env/AddTwoInts.h: No such file or directory

#include "test_my_env/AddTwoInts.h" I feel like all find_package(catkin REQUIRED COMPONENTS need to be mentioned in the run_depend tag in xml
##3. Do I need rospy also I only use roscpp. In the tutorials its often present also its c++ tut. (like addtwoints serv/client)
##4. SOLVED: Argl... I missed the header name AddTwoInts in the variable declaration test_my_env::AddTwoInts::Request

I moved the package to another workspace and now it says:

 [ 36%] Building CXX object test_my_env/CMakeFiles/my_test_lib.dir/src/add_two_ints_server.cpp.o
 [ 40%] Built target polled_camera_generate_messages_eus
 [ 42%] Building CXX object test_my_env/CMakeFiles/my_test_lib.dir/src/add_two_ints_client.cpp.o
 /home/baum/catkin_ws/src/test_my_env/src/add_two_ints_server.cpp:5:10: error: ‘Request’ is not a member of ‘test_my_env’
  bool add(test_my_env::Request  &req,
                 ^
/home/baum/catkin_ws/src/test_my_env/src/add_two_ints_server.cpp:5:33: error: ‘req’ was not declared in this scope
bool add(test_my_env::Request  &req,
                     ^
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-01-30 18:53:17 -0500

ahendrix gravatar image

The CMake call to catkin_package(...) sets the destination folder for binaries, so you need to make sure that your CMakeLists.txt is ordered so that all of your add_executable() and add_library() calls are AFTER your call to catkin_package()

edit flag offensive delete link more

Comments

Just to add to this: order matters in CMakeLists.txt with catkin. See wiki/catkin/CMakeLists.txt.

gvdhoorn gravatar image gvdhoorn  ( 2016-01-31 01:56:42 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-01-30 17:32:14 -0500

Seen: 552 times

Last updated: Jan 31 '16