Python: serialHelper with rospy (threading conflict?)
Hi,
here a little script which works fine until I remove the remark for init of the roc node
#!/usr/bin/env python
import threading
from time import sleep
import rospy
import serialHelper
sh = serialHelper.SerialHelper()
NODE_NAME ='SerialHelperTestRos'
if __name__ == '__main__':
try:
t = threading.Thread(target=sh.serialReader)
t.setDaemon(True)
t.start()
h = 0
#rospy.init_node(NODE_NAME, anonymous=True)
while True:
sh.writeToSerial('Hello Nr' + str(h))
h = h + 1
resp = sh.getResponse()
print ('response ' + resp)
sleep(3)
except Exception as e:
print (e)
it's on ubuntu mate with python 2.7. Any idea why I don't see serial input when rod did init ? I am new to python and ros so any input is greatly appreciated
@vKuehn: I've edited the title of your post to better reflect the question. "not working" is too vague.
thanks, hopefully someone has at least any hint