I've read several other questions on this topic and the common solutions seem to be 'catkin_make clean', 'catkin_make' to rebuild and source 'devel/setup.bash' or including the msg file in the CMakeLists.txt 'add_message_files()'. I'm not completely sure what "Are your messages built?" means. I've found a .h file of the messages under 'catkin_ws/install/include/floorbot/' so that appears to have been made.
A little more about where I am in this project; I have ROS master running on a desktop (running Ubuntu 14 & ROS Indigo) that is successfully creating messages. Running 'rostopic list' I see '/chat' - my messages. With 'rostopic echo /chat' I can see the actual messages. So that end seems to be setup fine.
If I ssh into my robot (Up Board SBC, running Ubuntu 14 & ROS Indigo), or work directly on the robot I get the same result: If I run 'rostopic list' I can see '/chat'. When I run 'rostopic echo /chat' I get "ERROR: Cannot load message class for [robot_ctlr/commands]. Are your messages built?".
So my current thought is that I have a conflict ion my message scheme. I wrote these project separately and as different projects. The robot is called 'floorbot', so that means that the package is called floorbot and the #include at the top of my main executable is #include ' "floorbot/commands.h" '. My desktop project name is 'robot_ctlr' in a package called 'robot_ctlr' and at the top of my main executable is ' #include "robot_ctlr/commands.h" '.
If that's what causing it, what should I change to make them happy? I tried reworking the naming, but that's given me a lot more problems. If that's not the cause, where else should I look?
Just in case this is helpful, here's the CMakeLists.txt from the robot:
cmake_minimum_required(VERSION 2.8.3)
project(floorbot)
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs message_generation)
find_package(Boost REQUIRED COMPONENTS system)
find_package(PkgConfig REQUIRED)
pkg_check_modules(mraa REQUIRED mraa)
include_directories(
include ${catkin_INCLUDE_DIRS}
install/include/floorbot
${mraa_INCLUDE_DIRS})
add_message_files(FILES commands.msg)
generate_messages(DEPENDENCIES std_msgs)
catkin_package(
${catkin_CURRENT_SOURCE_DIR}
INCLUDE_DIRS include
LIBRARIES floorbot mraa util
CATKIN_DEPENDS roscpp std_msgs
message_runtime
DEPENDS system_lib mraa)
add_library(util src/robot.cpp src/flags.cpp)
add_dependencies(util ${catkin_EXPORTED_TARGETS})
add_executable(floorbot src/sojourner.cpp)
target_link_libraries(floorbot util ${catkin_LIBRARIES} ${mraa_LIBRARIES})
add_dependencies(floorbot floorbot_generate_message_cpp ${catkin_EXPORTED_TARGETS})
This is the CMakeLists.txt for the robot_ctlr:
cmake_minimum_required(VERSION 2.8.3)
project(robot_ctlr)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_generation
#gazebo_ros
)
find_package(gazebo REQUIRED)
add_message_files(
FILES
commands.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
#INCLUDE_DIRS include
LIBRARIES robot_ctlr
CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
DEPENDS system_lib
#gazebo_ros
)
include_directories(include ${catkin_INCLUDE_DIRS} install/include/robot_ctlr)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
add_executable(ucomm ucomm.cpp)
target_link_libraries(ucomm ${catkin_LIBRARIES})
For now, I'm going to try and fix what I just broke.
I can include more code, but I'm not sure what would be helpful.
Originally posted by titan vista on ROS Answers with karma: 18 on 2016-11-17
Post score: 0