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

custom message from other host

asked 2015-02-09 06:44:14 -0500

niosus gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-02-09 07:40:51 -0500

dornhege gravatar image

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.

edit flag offensive delete link more

Comments

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.

niosus gravatar image niosus  ( 2015-02-10 02:38:01 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-02-09 06:44:14 -0500

Seen: 315 times

Last updated: Feb 09 '15