ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Custom Message Creation

asked 2012-02-24 08:50:31 -0500

bzt gravatar image

I've followed the ros tutorial for creating a custom message, but I'm unsure as to where to put it. Does it go in ros_workspace/package/msg/CustomMessage.msg? Or does it go into opt/ros/electric/stacks? If so, where exactly?

I'm making a node to publish a Vehicle.msg message filled by the Joy driver. I'm using the turtle_teleop_joy tutorial as my base. I need the custom message to define the axes.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-02-24 08:54:22 -0500

DimitriProsser gravatar image

Your first suggestion is correct. You put it in the msg directory of your message package. Make sure you then update the CMakeLists.txt to add the rosbuild_genmsg() option. Also, be sure to make any package using this message to depend on your message package (unless your messages are located in the same package as your node).

edit flag offensive delete link more


Thanks! I thought this was the source of my error, but I see it successfully generated the msg_gen folder and files in the package folder.

bzt gravatar image bzt  ( 2012-02-24 08:56:26 -0500 )edit

Also if other packages need to use the custom message from package A, make sure the manifest of package A exports the include cflags.

Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2012-02-24 08:58:34 -0500 )edit

@Ivan Dryanovski: I believe the CFLAGS export is provided automatically, now.

joq gravatar image joq  ( 2012-02-24 10:56:52 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-02-24 08:50:31 -0500

Seen: 728 times

Last updated: Feb 24 '12