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

What should be the messageType for a custom message?

asked 2016-11-28 11:20:09 -0600

nerdyTurtle gravatar image

updated 2016-11-28 12:09:41 -0600


I created a custom ROS message:

string message
int32 a
int32 b

I will need to publish the messages from the web browser (roslibjs) and show it on the terminal, using python. Roslibjs requires us to specify a messageType when we start a topic, for example:

var msgTopic = new ROSLIB.Topic({
ros: ros,
name: 'chatter',
messageType: <messageType??>

I don't know what would be the messageType here, for my custom message. I would appreciate any help with this. Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-11-28 16:22:59 -0600

jsanch2s gravatar image

The message type is the name of the package plus the name of the file. For example if your package name is my_pkg_msgs and the file where you defined the message is MyMsg.msg, then the message type is my_pkg_msgs.MyMsg.

You might want to check this tutorial (point 3.).

Hope this helps.

edit flag offensive delete link more


Great! Thank you! :)

nerdyTurtle gravatar image nerdyTurtle  ( 2016-11-29 08:48:04 -0600 )edit

Question Tools



Asked: 2016-11-28 11:20:09 -0600

Seen: 1,993 times

Last updated: Nov 28 '16