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

cmake error catkin package

asked 2017-09-28 06:32:39 -0500

danny5555 gravatar image

updated 2017-10-06 09:08:15 -0500

gvdhoorn gravatar image

I am following the tutorials in order and have been asked to configure the catkin environment at stage 5 of this web page: link text

The error I am receiving is as follows (bold below):

 cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)


find_package(catkin REQUIRED COMPONENTS
   roscpp
   rospy
   std_msgs
   message_generation
)



## Generate messages in the 'msg' folder
add_message_files(
  FILES
  Num.msg
)

## Generate services in the 'srv' folder
 add_service_files(
   FILES
   AddTwoInts.srv
 )

## Generate actions in the 'action' folder
# add_action_files(
#   FILES
#   Action1.action
#   Action2.action
# )

## Generate added messages and services with any dependencies listed here
generate_messages(
  DEPENDENCIES
  std_msgs
)


catkin_package(
  ...
  CATKIN_DEPENDS message_runtime ...
  ...)



include_directories(

  ${catkin_INCLUDE_DIRS}
)

Everything above is copied exactly from the CMakeLists.txt file

edit retag flag offensive close merge delete

Comments

catkin_package() called with unused arguments

this is the actual error, the rest is normal output.

Please edit your question and include the contents of your CMakeLists.txt. Please remove all comments from it, we don't need those.

gvdhoorn gravatar image gvdhoorn  ( 2017-09-28 11:05:12 -0500 )edit

The sourcing is fine. You need to source both, ROS's setup script in /opt/ros/kinetic directory and your catkin ws as well.

l4ncelot gravatar image l4ncelot  ( 2017-09-29 08:56:09 -0500 )edit
1

No, that is actually not necessary. By default, source-ing one setup.bash after another will actually make the second setup.bashoverwrite whatever the first setup.bash configured. So sourcing your workspace after /opt/ros/$distro does not work the way you imply.

gvdhoorn gravatar image gvdhoorn  ( 2017-09-30 04:24:43 -0500 )edit

Don't you have to source all your own created packages for ROS to be able to find them?

l4ncelot gravatar image l4ncelot  ( 2017-09-30 05:08:18 -0500 )edit

no, you have to source your own workspaces. As you cannot compile your workspace without source-ing /opt/ros/$distro, and doing that will result in /opt/ros/$distro being extended by your workspace, source-ing your workspace will automatically also source /opt/ros/$distro (in a way).

gvdhoorn gravatar image gvdhoorn  ( 2017-09-30 05:34:36 -0500 )edit

Oh, I didn't know that. Thanks for clarification.

l4ncelot gravatar image l4ncelot  ( 2017-09-30 07:42:58 -0500 )edit

Thanks for the directory sourcing comments. I know everything is okay there now!

I have added the CMakeLists.txt file and have deleted the other comments. However the action files comment is still in there. I'm not sure if this is the reason why there were unused arguments in the original problem.

danny5555 gravatar image danny5555  ( 2017-10-06 08:06:45 -0500 )edit
catkin_package(
  ...
  CATKIN_DEPENDS message_runtime ...
  ...)

Seeing as the error is actually in this bit, please copy-paste those lines from your CMakeLists.txt into your question verbatim. Don't leave anything out.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-06 08:22:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-06 09:10:45 -0500

gvdhoorn gravatar image

updated 2017-10-06 09:16:52 -0500

catkin_package(
  ...
  CATKIN_DEPENDS message_runtime ...
  ...)

The ... are the problem here. That is not valid CMake.

Please remove them and try again, and please tell us why you thought you had to add those.

And for future reference, see also the Catkin Howto documentation.


Edit: ah, I think I know why you did that. Section 2.1 (Creating a msg) actually has this:

Also make sure you export the message runtime dependency.

catkin_package(
  ...
  CATKIN_DEPENDS message_runtime ...
  ...)

That ... is called an ellipsis and is typically used in writing to indicate that some text has been left out, but that 'something' should be there. This is normally done to draw attention to only certain parts of the text, while still conveying the fact that those parts are still that, parts, and that there is actually more there.

See also wikipedia/ellipsis.

So in this case, you are supposed to add the CATKIN_DEPENDS message_runtime bit (if it isn't already there), while keeping whatever lines were already in the catkin_package(..) statement before.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-09-28 06:32:39 -0500

Seen: 1,718 times

Last updated: Oct 06 '17