ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

invalid message type

asked 2013-11-24 20:41:14 -0500

pelment gravatar image

updated 2013-11-24 20:43:25 -0500

I try to use my own messages. I created msg file named RopEvent:

 int32 value
 string name
 string comment

I can't publish message using rostopic pub. I try to proceed

rostopic pub rop_client rop_client/RopEvent 14 "Test" "Test"

But I receive an error

ERROR: invalid message type: rop_client/RopEvent.
If this is a valid message type, perhaps you need to type 'rosmake rop_client'

I type this, it makes package correctly, but message error still pops up. If I type rostopic list -v, I can see a string

* /rop_client [rop_client/RopEvent] 1 subscriber

'rosmsg list' shows me that my message exists, 'rosmsg show' finds message and shows it. What's wrong?

edit retag flag offensive close merge delete

Comments

I have the same problem. 'rosmsg show package_name/Msgname' works fine 'rostopic pub /xyz package_name/Msgname' doesn't.
UPDATED: After I edited the package.yml and CMakeLists.txt to actually compile the messages, it worked fine.

syrnick gravatar image syrnick  ( 2014-05-26 16:25:03 -0500 )edit

And which commands were missed?

pelment gravatar image pelment  ( 2014-05-27 07:56:53 -0500 )edit

I think, these were the core changes and commands: in package.xml:

    <build_depend>message_generation</build_depend>
    <run_depend>message_runtime</run_depend>
In CMakeLists.txt
find_package(catkin REQUIRED COMPONENTS
  message_generation std_msgs
)

add_message_files(
  FILES
  Dummy.msg
  Hit.msg
)
Commands from the catkin workspace:
catkin_make 
catkin_make install
source devel/setup.bash

syrnick gravatar image syrnick  ( 2014-05-27 18:33:58 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-04-02 16:19:52 -0500

tfoote gravatar image

You need to make sure that the compiled packages of your custom messages are in your environment when you run rostopic. That's the usual cause of this problem.

edit flag offensive delete link more
0

answered 2013-12-01 20:23:51 -0500

pelment gravatar image

My conclusions: I can send messages correctly from my own code, so I think that it isn't necessary to check messages using rostopic. I check it from my own nodes. It will be vary kind of anyone experienced to comment situation.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-11-24 20:41:14 -0500

Seen: 12,079 times

Last updated: Apr 02 '14