Publish message across UDP to a user defined port
I'm creating a node that will be subscribing to another node and then publishing a message. This message will need to be sent to a user defined IP address/ port combination and contain plain-text to be parsed by a non-ROS enabled Raspberry Pi listening on that port.
Outside of having to publish a text string to a port, I believe this should be a fairly standard Pub/Sub node. I see this page regarding UDPROS but there seems to be little, new information.
Does anyone have any suggestions?
The message needs to be of this format:
(sent to an IP address/ Port combination)
100 0
101 -1
102 100
103 0
104 0
105 0
106 0
That is to say, six lines, with each line having the first three characters be an ID number and the next three be either -1, 0, 100 (aka "do nothing", "move to 0% open", "move to 100% open").
I know that publishing to a port is pretty trivial in Python and only a little more complicated in C++... but how would that translate to ROS messages?
Thank you