How to publish .py output
Hi everybody I have a code which shows specific outputs from my GPS sensor in a terminal but I`m stuck with how to publish that output to a rostopic list. Here is my code:
import serial
ser = serial.Serial( '/dev/ttyUSB0' , 4800, timeout = 5 )
while 1:
line = ser.readline()
splitline = line.split(',')
if splitline[0] == '$GPGSV':
Heading = line[20]+line[21]+line[22]
print Heading
I searched and examined different codes but am still confused. I`d appreciate any help on that.
Can you please clarify: