Rosanswers logo

Hello everyone,

this is a small design question. I have a Rasberry PI that runs ros and gets everything from the sensors on the robot. It is all working great while sending standard messages, but I bumped into an issue with the custom ones.

Say, I want to send a string name of the button, a boolean of its state and a timestamp. I would need to define a new msg for this purpose. The question is: how can I include this message's header, when receiving this message on another machine?

Can I just create a message with the same parameters in the recipient package? I believe this cannot work, because the type will be different.

Any ideas are greatly appreciated.

Originally posted by niosus on ROS Answers with karma: 386 on 2015-02-09

Post score: 0


1 Answer 1


Rosanswers logo

You have to have the same message (as in package + name + content) on both machines. If the issue is building the code on different machines, that is why often messages are put into separate ..._msgs packages.

Besides this, there might be workarounds to make that work anyways, but I would not recommend any such hacks.

Originally posted by dornhege with karma: 31395 on 2015-02-09

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by niosus on 2015-02-10:
Avoiding the hacks is exactly the reason for posting this question! :)

Thanks for the nice idea, I didn't think of putting the messages into a separate package, it seems to fit the need.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.