Skip to content

Commit 3136156

Browse files
committed
AP_ExternalAHRS_InertialSense: remove SDK duplication, use ArduPilot logging
- Move ISB data-set types (DID constants, status enums, payload structs, RMC macros) from the header into the .cpp; forward-declare payload types in the header so the class interface remains intact. - Replace IS_PUSH_PACK / IS_POP_PACK / IS_PACKED with #pragma pack. - Remove duplicated utilities: _MIN macro (use MIN()), move_buffer_32bit() (use memmove()), MEMCPY_INC macro (inlined). - Rename is_comm_fletcher16 -> isb_fletcher16 and drop the is_comm_isb_checksum16 alias; add comment explaining why it cannot be replaced by AP_Math crc_fletcher16() (different modulo semantics). - Replace all printf() calls with GCS_SEND_TEXT at appropriate MAVLink severities (INFO / WARNING / CRITICAL / ERROR). Transition-edge gating in handleIns3Message prevents GCS flooding at the INS_3 message rate. - Remove hal.scheduler->delay(1000) calls from the constructor. - Remove now-unused #include <stdio.h> and #include <algorithm>. - Baudrate: use sm.find_baudrate() instead of hardcoded 921600 - Replace #pragma pack(push,1)/#pragma pack(pop) with PACKED macro on individual structs, matching ArduPilot convention - pre_arm_check: remove trailing \n from failure message - Remove malformed commented-out IMU request block - Initialize vel_cov/pos_cov/hgt_cov to 0 to prevent garbage returns from get_variances() before first DID_INL2_NED_SIGMA message - Remove unused members port_open and ppd_fd - Thread name: "AHRS" -> "IS" to avoid collision with VectorNav - Magnetometer: remove device-specific SN510457 scaling; pass normalized values and let ArduPilot calibration handle scaling - INS_3 periodMultiple: use MAX(1, 250/get_rate()) to respect EAHRS_RATE - Barometer: 1e3 -> 1000.0f (avoid double arithmetic) - Remove redundant is_comm_enable_protocol() call (already set by is_comm_register_isb_handler) - Remove copy-pasted "GPS at 200ms" comments from vel/RTK requests - Remove unsubscribed IMU path: handlePimuMessage, pimu_t, DID_PIMU, imu_sample_duration, last_imu_pkt - Replace typedef enum/typedef struct with plain enum/struct (C++ style) - Add space after if/while/switch keywords throughout - Fix Allman-style braces to K&R (opening brace on same line) in get_filter_status(), initialize(), handleIns3Message() - Add braces to all single-line if statements - Remove unused includes: AP_AHRS, AP_Filesystem, AP_InertialSensor, AP_Logger, AP_HAL/utility/sparse-endian, cstdint - Align parameter names between declarations and definitions - Implement num_gps_sensors() - Allman braces on all function definitions - camelCase methods renamed to snake_case (handle_*, parse_isb_data, etc.) - typedef → using for all type aliases (port_handle_t, function pointers, eDataIDs) - typedef union → union without typedef - Enum names renamed to PascalCase (ProtocolType, ParseErrorType, GpsNavFixStatus, InsStatusFlags, PktSpecialChars, etc.) - Space before colon in class declaration
1 parent 3077ce0 commit 3136156

File tree

2 files changed

+1044
-1021
lines changed

2 files changed

+1044
-1021
lines changed

0 commit comments

Comments
 (0)