add_message_files() directory not found in hector messages
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
Well, the error states that it is looking for the messages in
/home/xiaohao/hector_quadrotor_tutorial/src/msg
Where is theCMakeLists.txt
that you are calling?The msgs as well as the
CMakeLists.txt
should be in a package.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...can you please post the full CMakeLists.txt? You can add the switch
DIRECTORY <dir>
to theadd_message_files
call, but I don't know if this is enough already.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.
it seems that error came from message directory file in ROS root path...
Have you fixed this now? Having the a
msg
directory in the Root of your workspace is probably not a good idea.well, I was trying to say the error should came from message related files in "/opt/ros/indigo", instead of created workspace.
I didn't solve it yet. So, I reinstall the entire ROS...