Ask Your Question
0

add_message_files() directory not found in hector messages

asked 2015-07-14 04:18:51 -0500

Glen gravatar image

updated 2015-07-14 20:57:40 -0500

Hi

I was trying to build custom message in hector_quadrotor package. For some reason, I cannot catkin_make the packages. Modified packages are all removed and it still cannot solve errors. Enter catkin_make, it shows:

> CMake Error at
> /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:91
> (message):   add_message_files()
> directory not found: 
> /home/xiaohao/hector_quadrotor_tutorial/src/msg
> Call Stack (most recent call first):  
> CMakeLists.txt:23 (add_message_files)

"CMakeLists.txt" is changed back to original version as below,

cmake_minimum_required(VERSION 2.8.3)
project(hector_uav_msgs)
find_package(catkin REQUIRED message_generation std_msgs)
add_message_files(
  FILES
  Altimeter.msg
  AttitudeCommand.msg
  Compass.msg
  ControllerState.msg
  HeadingCommand.msg
  HeightCommand.msg
  MotorCommand.msg
  MotorPWM.msg
  MotorStatus.msg
  PositionXYCommand.msg
  RawImu.msg
  RawMagnetic.msg
  RawRC.msg
  RC.msg
  RuddersCommand.msg
  ServoCommand.msg
  Supply.msg
  ThrustCommand.msg
  VelocityXYCommand.msg
  VelocityZCommand.msg
  YawrateCommand.msg
)
generate_messages(
  DEPENDENCIES
  std_msgs
)
catkin_package(
  INCLUDE_DIRS include
#  LIBRARIES hector_uav_msgs
  CATKIN_DEPENDS message_runtime std_msgs
#  DEPENDS system_lib
)
install(DIRECTORY include/${PROJECT_NAME}/
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  FILES_MATCHING PATTERN "*.h"
  PATTERN ".svn" EXCLUDE
)

Any advice on how to solve this error? Thanks

edit retag flag offensive close merge delete

Comments

Well, the error states that it is looking for the messages in /home/xiaohao/hector_quadrotor_tutorial/src/msg Where is the CMakeLists.txt that you are calling?

The msgs as well as the CMakeLists.txt should be in a package.

mgruhler gravatar image mgruhler  ( 2015-07-14 04:45:06 -0500 )edit

The CmakeLists.txt in /home/xiaohao/hector_quadrotor_tutorial/src/hector_uav_msgs/. I don't know how to change its search directories to 'CMakeLists.txt' directory...

Glen gravatar image Glen  ( 2015-07-14 06:23:43 -0500 )edit
1

can you please post the full CMakeLists.txt? You can add the switch DIRECTORY <dir> to the add_message_files call, but I don't know if this is enough already.

mgruhler gravatar image mgruhler  ( 2015-07-14 09:57:14 -0500 )edit

I added the full CMakeList.txt code above. That's the original cmakelist.txt. I don't think it caused the error. Actually, I removed the whole package "hector_quadrotor". And I build a new workspace by "catkin_create_pkg". When I try to build the new workspace, it showed the same error.

Glen gravatar image Glen  ( 2015-07-14 21:01:12 -0500 )edit

it seems that error came from message directory file in ROS root path...

Glen gravatar image Glen  ( 2015-07-14 21:01:44 -0500 )edit
1

Have you fixed this now? Having the a msg directory in the Root of your workspace is probably not a good idea.

mgruhler gravatar image mgruhler  ( 2015-07-15 00:44:54 -0500 )edit

well, I was trying to say the error should came from message related files in "/opt/ros/indigo", instead of created workspace.

Glen gravatar image Glen  ( 2015-07-15 10:35:34 -0500 )edit

I didn't solve it yet. So, I reinstall the entire ROS...

Glen gravatar image Glen  ( 2015-07-15 10:36:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-03-23 02:36:04 -0500

130s gravatar image

directory not found: /home/xiaohao/hector_quadrotor_tutorial/src/msg

Your directory structure is most likely messed up. Similar to the issue #q67415. ROS uses a "workspace" concept when building source code with it. I suggest you go through the basic tutorial set once again (no worries I've gone through them multiple times in the past) to familiarize with the concept.

Particularly with your setting I would assume directory structure including the problematic msg folder would look something like (catkin_ws can be named anything you like):

/home/xiaohao/catkin_ws/src/hector_quadrotor_tutorial/msg
edit flag offensive delete link more

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: 2015-07-14 04:18:51 -0500

Seen: 1,215 times

Last updated: Mar 23 '17