0
$\begingroup$

Rosanswers logo

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,
                     ^

Originally posted by user23fj239 on ROS Answers with karma: 748 on 2016-01-30

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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()


Originally posted by ahendrix with karma: 47576 on 2016-01-30

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2016-01-31:
Just to add to this: order matters in CMakeLists.txt with catkin. See wiki/catkin/CMakeLists.txt.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.