AP_Proximity: initialize structures correctly

This commit is contained in:
Andy Piper 2023-06-14 12:42:02 -04:00 committed by Peter Barker
parent e06952bf0f
commit 80112051b4
1 changed files with 3 additions and 3 deletions

View File

@ -273,13 +273,13 @@ void AP_Proximity_RPLidarA2::get_readings()
} }
// identify the payload data after the descriptor // identify the payload data after the descriptor
static const _descriptor SCAN_DATA_DESCRIPTOR[] { static const _descriptor SCAN_DATA_DESCRIPTOR[] {
RPLIDAR_PREAMBLE, 0x5A, 0x05, 0x00, 0x00, 0x40, 0x81 { RPLIDAR_PREAMBLE, 0x5A, 0x05, 0x00, 0x00, 0x40, 0x81 }
}; };
static const _descriptor HEALTH_DESCRIPTOR[] { static const _descriptor HEALTH_DESCRIPTOR[] {
RPLIDAR_PREAMBLE, 0x5A, 0x03, 0x00, 0x00, 0x00, 0x06 { RPLIDAR_PREAMBLE, 0x5A, 0x03, 0x00, 0x00, 0x00, 0x06 }
}; };
static const _descriptor DEVICE_INFO_DESCRIPTOR[] { static const _descriptor DEVICE_INFO_DESCRIPTOR[] {
RPLIDAR_PREAMBLE, 0x5A, 0x14, 0x00, 0x00, 0x00, 0x04 { RPLIDAR_PREAMBLE, 0x5A, 0x14, 0x00, 0x00, 0x00, 0x04 }
}; };
Debug(2,"LIDAR descriptor found"); Debug(2,"LIDAR descriptor found");
if (memcmp((void*)&_payload[0], SCAN_DATA_DESCRIPTOR, sizeof(_descriptor)) == 0) { if (memcmp((void*)&_payload[0], SCAN_DATA_DESCRIPTOR, sizeof(_descriptor)) == 0) {