diff --git a/scripts/rtlightsensors.py b/scripts/rtlightsensors.py index 9df0a78..dee2fe8 100755 --- a/scripts/rtlightsensors.py +++ b/scripts/rtlightsensors.py @@ -18,10 +18,11 @@ def talker(): d.left_side = int(data[2]) d.left_forward = int(data[3]) pub.publish(d) - rate.sleep() except: rospy.logerr("cannot open " + devfile) + rate.sleep() + if __name__ == '__main__': try: talker()