From 63a329600798d81b880a81b5b1d8564b4cc4529d Mon Sep 17 00:00:00 2001 From: Patrick Goebel Date: Sat, 19 Mar 2016 19:34:34 -0700 Subject: [PATCH] Added error message for unsuccessful connection --- ros_arduino_python/src/ros_arduino_python/arduino_driver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ros_arduino_python/src/ros_arduino_python/arduino_driver.py b/ros_arduino_python/src/ros_arduino_python/arduino_driver.py index 8752fef..f951662 100755 --- a/ros_arduino_python/src/ros_arduino_python/arduino_driver.py +++ b/ros_arduino_python/src/ros_arduino_python/arduino_driver.py @@ -264,7 +264,11 @@ class Arduino: def get_baud(self): ''' Get the current baud rate on the serial port. ''' - return int(self.execute('b')); + try: + return int(self.execute('b')) + except: + print "Failed to determine baud rate of Arduino so aborting!" + os._exit(1) def get_encoder_counts(self): values = self.execute_array('e')