Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why catkit do not generate message headers?

I don't understand why, Catkin don't generate message headers. I have two packages. With one of them (ppl_detection) catkin works properly -- all headers are generated. But for another (ros_johnny5) -- it not works. Here CMakeList.txt for the both packages:

ppl_detection

cmake_minimum_required(VERSION 2.8.3)
project(ppl_detection)

set(CMAKE_BUILD_TYPE Debug)

find_package(catkin REQUIRED COMPONENTS 
    roscpp
    rospy
    std_msgs
    message_generation
    roslaunch
    tf
    pcl_ros
    laser_geometry
    visualization_msgs
    geometry_msgs
)

find_package(PCL)

add_message_files(
    FILES
    Human.msg
    Tracker.msg
)

generate_messages(
    DEPENDENCIES
    std_msgs
    geometry_msgs
    visualization_msgs
)

###################################
## catkin specific configuration ##
###################################

catkin_package(
    INCLUDE_DIRS include
    #  LIBRARIES ros_ssc32
    CATKIN_DEPENDS message_runtime
    #  DEPENDS system_lib
)

###########
## Build ##
###########

include_directories(
    ${catkin_INCLUDE_DIRS}
    ${PCL_INCLUDE_DIRS}
    include
)

add_library(ppl_detection 
    src/svm.cpp
    src/pca.cpp
    src/plyfile.c
)

add_executable(kinect_detect 
    src/kinect_detect.cpp
)

target_link_libraries(kinect_detect 
    ppl_detection
    ${catkin_LIBRARIES}
    ${PCL_LIBRARIES}
)

add_dependencies(kinect_detect
    ${PROJECT_NAME}_generate_messages_cpp
)

add_executable(train 
    src/train.cpp
)

target_link_libraries(train 
    ppl_detection
    ${catkin_LIBRARIES}
    ${PCL_LIBRARIES}
)

add_dependencies(train
    ${PROJECT_NAME}_generate_messages_cpp
)

add_executable(predict 
    src/predict.cpp
)

target_link_libraries(predict 
    ppl_detection
    ${catkin_LIBRARIES}
    ${PCL_LIBRARIES}
)

add_dependencies(predict
    ${PROJECT_NAME}_generate_messages_cpp
)

ros_johnny5

cmake_minimum_required(VERSION 2.8.3)
project(ros_johnny5)

set(CMAKE_BUILD_TYPE Debug)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS 
    roscpp
    rospy
    std_msgs
    roslaunch
    tf
    ppl_detection
    genmsg
    message_generation
)

################################################
## Declare ROS messages, services and actions ##
################################################

add_message_files(
    FILES
    servoMsg.msg
    servoMsgArray.msg
    robotState.msg
)

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

###################################
## catkin specific configuration ##
###################################

catkin_package(
    INCLUDE_DIRS inc
#   LIBRARIES ros_ssc32
    CATKIN_DEPENDS message_runtime std_msgs
#   DEPENDS system_lib
)

###########
## Build ##
###########

include_directories(
    ${catkin_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}
    inc
)

## Declare a cpp executable

########## SSC32 NODE ##########

set(SSC32_HEADERS
    inc/ros_ssc32.h
)

set(SSC32_SOURCES
    src/ros_ssc32.cpp
)

add_executable(ros_ssc32
    ${SSC32_SOURCES}
    ${SSC32_HEADERS}
)

add_library(ros_ssc32_lib
    src/servo.cpp
    src/serial.cpp
    src/robot.cpp
)

target_link_libraries(ros_ssc32
    ${catkin_LIBRARIES}
    ${Boost_LIBRARIES}
    ros_ssc32_lib
)

add_dependencies(ros_ssc32
   ros_johnny5_generate_messages_cpp
)

########## SSC32 NODE END ##########

########## BAL NODE ##########

set(BAL_INCLUDES
    inc/johnny_life.h
)

set(BAL_SOURCES
    src/johnny_life.cpp
)

add_executable(johnny_life
    ${BAL_INCLUDES}
    ${BAL_SOURCES}
)

add_library(johnny_life_lib
    src/positions.cpp
)

target_link_libraries(johnny_life
    ${catkin_LIBRARIES}
    ${Boost_LIBRARIES}
    johnny_life_lib
)

add_dependencies(johnny_life
    ppl_detection_generate_messages_cpp
)

########## BAL NODE END ##########

########## TEST NODE ##########

set(TEST_INCLUDES
    inc/servo.h
    inc/serial.h
    inc/topics.h
    inc/robot.h
)

set(TEST_SOURCES
    src/test.cpp
    src/servo.cpp
    src/serial.cpp
    inc/topics.h
    src/robot.cpp
)

add_executable(test_node
    ${TEST_INCLUDES}
    ${TEST_SOURCES}
)

target_link_libraries(test_node
    ${catkin_LIBRARIES}
    ${Boost_LIBRARIES}
)

add_dependencies(test_node
   ros_johnny5_generate_messages_cpp
)
########## TEST NODE END ##########

########## TRACKING NODE ##########

set(TRACKING_INCLUDES
    inc/johnny_skeleton_tracking.h
    inc/raw_model.h
)

set(TRACKING_SOURCES
    src/johnny_skeleton_tracking.cpp
    src/raw_model.cpp
)

add_executable(tracking_node
    ${TRACKING_INCLUDES}
    ${TRACKING_SOURCES}
)

target_link_libraries(tracking_node
    ${catkin_LIBRARIES}
    ${Boost_LIBRARIES}
)

add_dependencies(tracking_node
   ros_johnny5_generate_messages_cpp
)

########## TRACKING NODE END ##########

Why catkit catkin do not generate message headers?

I don't understand why, Catkin don't generate message headers. I have two packages. With one of them (ppl_detection) catkin works properly -- all headers are generated. But for another (ros_johnny5) -- it not works. Here CMakeList.txt for the both packages:

ppl_detection

cmake_minimum_required(VERSION 2.8.3)
project(ppl_detection)

set(CMAKE_BUILD_TYPE Debug)

find_package(catkin REQUIRED COMPONENTS 
    roscpp
    rospy
    std_msgs
    message_generation
    roslaunch
    tf
    pcl_ros
    laser_geometry
    visualization_msgs
    geometry_msgs
)

find_package(PCL)

add_message_files(
    FILES
    Human.msg
    Tracker.msg
)

generate_messages(
    DEPENDENCIES
    std_msgs
    geometry_msgs
    visualization_msgs
)

###################################
## catkin specific configuration ##
###################################

catkin_package(
    INCLUDE_DIRS include
    #  LIBRARIES ros_ssc32
    CATKIN_DEPENDS message_runtime
    #  DEPENDS system_lib
)

###########
## Build ##
###########

include_directories(
    ${catkin_INCLUDE_DIRS}
    ${PCL_INCLUDE_DIRS}
    include
)

add_library(ppl_detection 
    src/svm.cpp
    src/pca.cpp
    src/plyfile.c
)

add_executable(kinect_detect 
    src/kinect_detect.cpp
)

target_link_libraries(kinect_detect 
    ppl_detection
    ${catkin_LIBRARIES}
    ${PCL_LIBRARIES}
)

add_dependencies(kinect_detect
    ${PROJECT_NAME}_generate_messages_cpp
)

add_executable(train 
    src/train.cpp
)

target_link_libraries(train 
    ppl_detection
    ${catkin_LIBRARIES}
    ${PCL_LIBRARIES}
)

add_dependencies(train
    ${PROJECT_NAME}_generate_messages_cpp
)

add_executable(predict 
    src/predict.cpp
)

target_link_libraries(predict 
    ppl_detection
    ${catkin_LIBRARIES}
    ${PCL_LIBRARIES}
)

add_dependencies(predict
    ${PROJECT_NAME}_generate_messages_cpp
)

ros_johnny5

cmake_minimum_required(VERSION 2.8.3)
project(ros_johnny5)

set(CMAKE_BUILD_TYPE Debug)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS 
    roscpp
    rospy
    std_msgs
    roslaunch
    tf
    ppl_detection
    genmsg
    message_generation
)

################################################
## Declare ROS messages, services and actions ##
################################################

add_message_files(
    FILES
    servoMsg.msg
    servoMsgArray.msg
    robotState.msg
)

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

###################################
## catkin specific configuration ##
###################################

catkin_package(
    INCLUDE_DIRS inc
#   LIBRARIES ros_ssc32
    CATKIN_DEPENDS message_runtime std_msgs
#   DEPENDS system_lib
)

###########
## Build ##
###########

include_directories(
    ${catkin_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}
    inc
)

## Declare a cpp executable

########## SSC32 NODE ##########

set(SSC32_HEADERS
    inc/ros_ssc32.h
)

set(SSC32_SOURCES
    src/ros_ssc32.cpp
)

add_executable(ros_ssc32
    ${SSC32_SOURCES}
    ${SSC32_HEADERS}
)

add_library(ros_ssc32_lib
    src/servo.cpp
    src/serial.cpp
    src/robot.cpp
)

target_link_libraries(ros_ssc32
    ${catkin_LIBRARIES}
    ${Boost_LIBRARIES}
    ros_ssc32_lib
)

add_dependencies(ros_ssc32
   ros_johnny5_generate_messages_cpp
)

########## SSC32 NODE END ##########

########## BAL NODE ##########

set(BAL_INCLUDES
    inc/johnny_life.h
)

set(BAL_SOURCES
    src/johnny_life.cpp
)

add_executable(johnny_life
    ${BAL_INCLUDES}
    ${BAL_SOURCES}
)

add_library(johnny_life_lib
    src/positions.cpp
)

target_link_libraries(johnny_life
    ${catkin_LIBRARIES}
    ${Boost_LIBRARIES}
    johnny_life_lib
)

add_dependencies(johnny_life
    ppl_detection_generate_messages_cpp
)

########## BAL NODE END ##########

########## TEST NODE ##########

set(TEST_INCLUDES
    inc/servo.h
    inc/serial.h
    inc/topics.h
    inc/robot.h
)

set(TEST_SOURCES
    src/test.cpp
    src/servo.cpp
    src/serial.cpp
    inc/topics.h
    src/robot.cpp
)

add_executable(test_node
    ${TEST_INCLUDES}
    ${TEST_SOURCES}
)

target_link_libraries(test_node
    ${catkin_LIBRARIES}
    ${Boost_LIBRARIES}
)

add_dependencies(test_node
   ros_johnny5_generate_messages_cpp
)
########## TEST NODE END ##########

########## TRACKING NODE ##########

set(TRACKING_INCLUDES
    inc/johnny_skeleton_tracking.h
    inc/raw_model.h
)

set(TRACKING_SOURCES
    src/johnny_skeleton_tracking.cpp
    src/raw_model.cpp
)

add_executable(tracking_node
    ${TRACKING_INCLUDES}
    ${TRACKING_SOURCES}
)

target_link_libraries(tracking_node
    ${catkin_LIBRARIES}
    ${Boost_LIBRARIES}
)

add_dependencies(tracking_node
   ros_johnny5_generate_messages_cpp
)

########## TRACKING NODE END ##########