7 #define LEDDARONE_DEFAULT_ADDRESS 0x01 8 #define LEDDARONE_MODOBUS_FUNCTION_CODE 0x04 9 #define LEDDARONE_MODOBUS_FUNCTION_REGISTER_ADDRESS 20 10 #define LEDDARONE_MODOBUS_FUNCTION_READ_NUMBER 10 12 #define LEDDARONE_SERIAL_PORT_MAX 250 13 #define LEDDARONE_READ_BUFFER_SIZE 25 15 #define LEDDARONE_DETECTIONS_MAX 3 16 #define LEDDARONE_DETECTION_DATA_NUMBER_INDEX 10 17 #define LEDDARONE_DETECTION_DATA_INDEX_OFFSET 11 18 #define LEDDARONE_DETECTION_DATA_OFFSET 4 47 uint8_t serial_instance);
58 return MAV_DISTANCE_SENSOR_LASER;
66 bool CRC16(uint8_t *aBuffer, uint8_t aLength,
bool aCheck);
bool get_reading(uint16_t &reading_cm)
static AP_SerialManager serial_manager
#define LEDDARONE_DEFAULT_ADDRESS
#define LEDDARONE_READ_BUFFER_SIZE
AP_RangeFinder_LeddarOne(RangeFinder::RangeFinder_State &_state, AP_SerialManager &serial_manager, uint8_t serial_instance)
uint32_t last_available_ms
uint16_t detections[LEDDARONE_DETECTIONS_MAX]
#define LEDDARONE_DETECTIONS_MAX
#define LEDDARONE_MODOBUS_FUNCTION_READ_NUMBER
LeddarOne_ModbusStatus modbus_status
AP_HAL::UARTDriver * uart
LeddarOne_Status parse_response(uint8_t &number_detections)
#define LEDDARONE_MODOBUS_FUNCTION_REGISTER_ADDRESS
const uint8_t send_request_buffer[8]
#define LEDDARONE_MODOBUS_FUNCTION_CODE
uint8_t read_buffer[LEDDARONE_READ_BUFFER_SIZE]
uint32_t last_sending_request_ms
bool CRC16(uint8_t *aBuffer, uint8_t aLength, bool aCheck)
static bool detect(AP_SerialManager &serial_manager, uint8_t serial_instance)
virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override