Cannot load message class for [robot_position/mymsg]. Are your messages built?
I correctly followed the steps as mentioned here: link text Home>assign2>src>robot_position Where robot_position is my package name. I created a directory named msg inside it and inside msg directory, I made mymsg.msg file. I wrote this inside it:
float64 x
float64 y
then I added these lines in package.xml file:
<build_depend>message_generation</build_depend>
<run_depend>message_runtime</run_depend>
then I added message dependencies in CMakeLists.txt file as:
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
roscpp
rospy
std_msgs
message_generation
)
then I wrote message_runtime in CMakeLists.txt file as in here:
catkin_package(
INCLUDE_DIRS include
LIBRARIES robot_position
CATKIN_DEPENDS message_runtime geometry_msgs roscpp rospy std_msgs
DEPENDS system_lib
)
then I added this:
add_message_files(
FILES
mymsg.msg
)
and then this:
generate_messages(
DEPENDENCIES
geometry_msgs std_msgs
)
and then did this: catkin_make install
Did I miss anything?
Is there a mymsg.h file inside catkin_ws/devel/include/your_package_name/? If the msg is compiled properly, there should be a .h file generated in the mentioned folder.
Also, after compilation, you can check the msg details by
rosmsg list | grep mymsg
and
rosmsg show your_package_name/mymsg
Thanks for replying, Is there a mymsg.h file? Yes. After compilation, yes I can check msg details by
rosmsg list | grep mymsg
but
rosmsg show your_package_name/mymsg
gives error: Unable to load msg [your_package_name/mymsg]: Cannot locate message [mymsg]: unknown package [your_package_name]..what is the output of
rosmsg list | grep mymsg
? By the way, when I say 'your_package_name', I mean to use your package name (which is robot_position)Sorry, I'm just a beginner.
gives this:
robot_position/mymsg
and
rosmsg robot_position/mymsg
gives thisIt s ok. We were all beginners once :). The actual command is
rosmsg show robot_position/mymsg
. You can dorosmsg -h
to see more options of rosmsgIt works fine, shows what's intended
float64 x float64 y
but I'm having problem when I echo any rostopic! and following message appears