How can I use rospylib to transmit data from raspberry pi to ROS running on laptop.
Greetings, I hope you are doing well. I am using rospylib for transmitting data into a ros topic , however, it is working when the ROSbridge and publisher created using rospylib are working on the same machine. However, I want to use rospylib to publish data from a raspberry pi to ROS bridge running on laptop. The code looks like this
import time
import roslibpy
client = roslibpy.Ros(host='localhost', port=9090) #### should I change the local address with the IP address of the laptop?
client.run()
talker = roslibpy.Topic(client, '/chatter', 'std_msgs/String')
while client.is_connected:
talker.publish(roslibpy.Message({'data': 'Hello World!'}))
print('Sending message...')
time.sleep(1)
talker.unadvertise()
client.terminate()
Please edit your question by selecting your python code and clicking on the "preformatted text" button on the editor. This button has 101010 text written over it.