#!/usr/bin/python import dumdum import sys import signal import rospy def signal_handler(signal, frame): sys.exit(0) rospy.init_node("dualdummys") r = dumdum.teensy("N2") signal.signal(signal.SIGINT, signal_handler) r.simplemainloop()
#!/usr/bin/python import dumdum import threading import time import sys import signal import rospy rospy.init_node("dualdummys") rightdummy = dumdum.teensy("N2") leftdummy = dumdum.teensy("N1") rospy.loginfo("nodes are runnning, no noise to be seen...") global t1, t2 t1 = threading.Thread(target=rightdummy.mainloop) t2 = threading.Thread(target=leftdummy.mainloop) t1.start() t2.start() def signal_handler(signal, frame): sys.exit(0) signal.signal(signal.SIGINT, signal_handler) while True: time.sleep(2)
#!/usr/bin/python import dumdum import sys import signal import rospy def signal_handler(signal, frame): sys.exit(0) rospy.init_node("dualdummys") r = dumdum.teensy("N1") signal.signal(signal.SIGINT, signal_handler) r.mainloop()