Changed default serial port paths, and added example udev rule file.

pull/1/head
Mark Jessop 2017-01-06 11:55:59 +10:30
rodzic bf16ac6350
commit 58759ae435
3 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -0,0 +1,8 @@
# Assuming the BNO055 is connected via a FTDI USB-UART cable.
# Note: Plugging in more than one FTDI Cable will cause the symlink to jump to the newest device.
# This can be fixed by determining the specific cables serial number, and adding a
# ATTRS{serial}=="serialnumberhere" argument to the udev line.
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="bno"
# uBlox-7 GPS unit (Gmouse VK-102 unit purchased on ebay, using a uBlox G7020 chip.)
SUBSYSTEM=="tty", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="ublox"

Wyświetl plik

@ -760,7 +760,7 @@ class WenetBNO055(object):
bno = None
def __init__(self,
port='/dev/ttyUSB0',
port='/dev/bno',
update_rate_hz = 10,
callback = None,
callback_decimation = 10,
@ -771,6 +771,7 @@ class WenetBNO055(object):
Keyword Arguments:
port: Serial port where the BNO055 is connected. The default baud rate of 115200 baud will be used.
See 99-usb-serial.rules for suitable udev rules to make a /dev/bno symlink.
update_rate_hz: The rate at which the internal state vector is updated, in Hz.
callback: reference to a callback function that will be passed a copy of the above
@ -968,7 +969,8 @@ class WenetBNO055(object):
self.bno.close()
self.bno = None
# Attempt to re-connect to BNO055. This will loop until it connects.
self.init()
# Don't reset the BNO055 upon reconnection.
self.init(reset=False)
# Push in saved calibration data, if we have it.
if self.calibration_data != None:
self.bno.set_calibration(self.calibration_data)

Wyświetl plik

@ -921,7 +921,7 @@ class UBloxGPS(object):
state_writelock = False
state_readlock = False
def __init__(self,port='/dev/ttyACM0', baudrate=115200, timeout=2,
def __init__(self,port='/dev/ublox', baudrate=115200, timeout=2,
callback=None,
update_rate_ms=500,
dynamic_model=DYNAMIC_MODEL_AIRBORNE1G,