def devices(self, type):
     try:
         if type not in ['', 'Serial', 'SpiFTDI', 'Ethernet', 'Usb']:
             raise RuntimeError(f'invalid type {type}')
         return QVariant(leddar.get_devices(type))
     except:
         print(traceback.format_exc())
        print(
            str(data[i]["indices"]) + " - " + str(data[i]["distances"]) +
            " - " + str(data[i]["amplitudes"]) + " - " + str(data[i]["flags"]))


def states_callback(states):
    print("timestamp: " + str(states["timestamp"]))
    print("cpu_load " + str(states["cpu_load"]) + "%")
    print("system_temp " + str(states["system_temp"]) + " C")


#Create device
dev = leddar.Device()

#Connect to the device
sensorlist = leddar.get_devices("Usb")
dev.connect(sensorlist[0]['name'], leddar.device_types["Usb"])

#Get properties value
print("ID_BASE_POINT_COUNT = " +
      dev.get_property_value(leddar.property_ids["ID_BASE_POINT_COUNT"]))
print("ID_LED_INTENSITY = " +
      dev.get_property_value(leddar.property_ids["ID_LED_INTENSITY"]))

#Property available values
values = dev.get_property_available_values(
    leddar.property_ids["ID_LED_INTENSITY"])
print(values["type"])
print(values["data"])

#Set callback method
Example #3
0
            " - " + str(data[i]["amplitudes"]) + " - " + str(data[i]["flags"]))


def states_callback(states):
    print("timestamp: " + str(states["timestamp"]))
    print("cpu_load " + str(states["cpu_load"]) + "%")
    print("system_temp " + str(states["system_temp"]) + " C")


#Create device
dev = leddar.Device()

#Connect to the device
##Use one of this connection method
#Ethernet
sensor_list = leddar.get_devices("Ethernet")
print(leddar.device_types["Ethernet"])
dev.connect('192.168.0.2', leddar.device_types["Ethernet"], 48630)
connection = dev.connect('192.168.0.2', leddar.device_types["Ethernet"], 48630)

#M16 Usb
# sensor_list = leddar.get_devices("Usb")
# dev.connect(sensor_list[0]['name'], leddar.device_types["Usb"])

##For any sensors with modbus serial communication (LeddarOne, Vu8 or M16)
# sensor_list = leddar.get_devices("Serial")
# dev.connect(sensor_list[0]['name'], leddar.device_types["Serial"])

##For Vu8/M16 sensors with CAN BUS communication
# dev.connect(Baud rate (kbps), Type of sensor, Tx ID (optionnal), Rx ID (optionnal))
# dev.connect('1000', leddar.device_types["M16Komodo"])