mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-03 19:24:09 +05:30
Close serial port on exit
This commit is contained in:
parent
6d6390fa53
commit
c15c0be2a8
@ -477,7 +477,7 @@ class ArduinoROS():
|
||||
rospy.sleep(0.2)
|
||||
|
||||
# Close the serial port
|
||||
#self.device.serial_port.close()
|
||||
self.device.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
@ -486,7 +486,9 @@ if __name__ == '__main__':
|
||||
try:
|
||||
myArduino.device.serial_port.close()
|
||||
except:
|
||||
rospy.logerr("Serial exception trying to close port.")
|
||||
os._exit(0)
|
||||
except SerialException:
|
||||
rospy.logerr("Serial exception trying to open port.")
|
||||
os._exit(0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user