mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 15:23:57 -04:00
AP_RangeFinder: stop persisting detections in LeddarOne driver
We don't use these readings except immediately after where we store them - so don't store them persistently.
This commit is contained in:
parent
65cfded501
commit
6923f20ce6
@ -172,12 +172,10 @@ LeddarOne_Status AP_RangeFinder_LeddarOne::parse_response(uint8_t &number_detect
|
||||
return LEDDARONE_STATE_ERR_NUMBER_DETECTIONS;
|
||||
}
|
||||
|
||||
memset(detections, 0, sizeof(detections));
|
||||
sum_distance = 0;
|
||||
for (index=0; index<number_detections; index++) {
|
||||
// construct data word from two bytes and convert mm to cm
|
||||
detections[index] = (static_cast<uint16_t>(read_buffer[index_offset])*256 + read_buffer[index_offset+1]) / 10;
|
||||
sum_distance += detections[index];
|
||||
sum_distance += (static_cast<uint16_t>(read_buffer[index_offset])*256 + read_buffer[index_offset+1]) / 10;
|
||||
|
||||
// add index offset (4) to read next detection data
|
||||
index_offset += LEDDARONE_DETECTION_DATA_OFFSET;
|
||||
|
@ -69,7 +69,6 @@ private:
|
||||
uint32_t last_sending_request_ms;
|
||||
uint32_t last_available_ms;
|
||||
|
||||
uint16_t detections[LEDDARONE_DETECTIONS_MAX];
|
||||
uint32_t sum_distance;
|
||||
|
||||
LeddarOne_ModbusStatus modbus_status = LEDDARONE_MODBUS_STATE_INIT;
|
||||
|
Loading…
Reference in New Issue
Block a user