HITL/SITL X-Plane: Improvements#11253
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
|
Oh man, i use HITL/SITL a lot, this would be great. I'll test this as soon as i can. |
|
@xznhj8129 have you tried? It does not work for me Scavanger/INAV-X-Plane-XITL#3 |
- MSP_SIMULATOR v2/v3 protocol: refactor into readMspSimulatorValues() and mspProcessSimulatorCommand(); v3 uses 2-byte flags field - New HITL flags: HITL_RANGEFINDER, HITL_CURRENT_SENSOR, HITL_SIM_RC_INPUT, HITL_FAILSAFE_TRIGGERED, HITL_SITL_MODE - Fix GPS velocity: exclude HITL mode from validVelNE path (same as SITL) - battery.c: inject simulated current when HITL_CURRENT_SENSOR active - displayport_msp_osd.c: enable OSD vtxActive in SITL mode - runtime_config: add SIMULATOR_MSP_VERSION_3 and new HITL flag bits - common.h: promote RX_SIM and RANGEFINDER_FAKE out of SITL-only target.h - xplane.h: add stdbool.h include and simXPlaneClose() declaration - xplane.c: INAV-XITL plugin with DataRef state machine; add atomic thread safety and simXPlaneClose() from maintenance-9.x
- MSP_SIMULATOR v2/v3 protocol: refactor into readMspSimulatorValues() and mspProcessSimulatorCommand(); v3 uses 2-byte flags field - New HITL flags: HITL_RANGEFINDER, HITL_CURRENT_SENSOR, HITL_SIM_RC_INPUT, HITL_FAILSAFE_TRIGGERED, HITL_SITL_MODE - Fix GPS velocity: exclude HITL mode from validVelNE path (same as SITL) - battery.c: inject simulated current when HITL_CURRENT_SENSOR active - displayport_msp_osd.c: enable OSD vtxActive in SITL mode - runtime_config: add SIMULATOR_MSP_VERSION_3 and new HITL flag bits - common.h: promote RX_SIM and RANGEFINDER_FAKE out of SITL-only target.h - xplane.h: add stdbool.h include and simXPlaneClose() declaration - xplane.c: INAV-XITL plugin with DataRef state machine; add atomic thread safety and simXPlaneClose() from maintenance-9.x
- MSP_SIMULATOR v2/v3 protocol: refactor into readMspSimulatorValues() and mspProcessSimulatorCommand(); v3 uses 2-byte flags field - New HITL flags: HITL_RANGEFINDER, HITL_CURRENT_SENSOR, HITL_SIM_RC_INPUT, HITL_FAILSAFE_TRIGGERED, HITL_SITL_MODE - Fix GPS velocity: exclude HITL mode from validVelNE path (same as SITL) - battery.c: inject simulated current when HITL_CURRENT_SENSOR active - displayport_msp_osd.c: enable OSD vtxActive in SITL mode - runtime_config: add SIMULATOR_MSP_VERSION_3 and new HITL flag bits - common.h: promote RX_SIM and RANGEFINDER_FAKE out of SITL-only target.h - xplane.h: add stdbool.h include and simXPlaneClose() declaration - xplane.c: INAV-XITL plugin with DataRef state machine; add atomic thread safety and simXPlaneClose() from maintenance-9.x
- MSP_SIMULATOR v2/v3 protocol: refactor into readMspSimulatorValues() and mspProcessSimulatorCommand(); v3 uses 2-byte flags field - New HITL flags: HITL_RANGEFINDER, HITL_CURRENT_SENSOR, HITL_SIM_RC_INPUT, HITL_FAILSAFE_TRIGGERED, HITL_SITL_MODE - Fix GPS velocity: exclude HITL mode from validVelNE path (same as SITL) - battery.c: inject simulated current when HITL_CURRENT_SENSOR active - displayport_msp_osd.c: enable OSD vtxActive in SITL mode - runtime_config: add SIMULATOR_MSP_VERSION_3 and new HITL flag bits - common.h: promote RX_SIM and RANGEFINDER_FAKE out of SITL-only target.h - xplane.h: add stdbool.h include and simXPlaneClose() declaration - xplane.c: INAV-XITL plugin with DataRef state machine; add atomic thread safety and simXPlaneClose() from maintenance-9.x
|
I ran a small set of regression tests and 14 of 14 passed. @Scavanger may want to review the work in 5522945 |
User description
New features for X-Plane HITL/SITL, mainly for use with https://github.com/Scavanger/INAV-X-Plane-XITL
HITL
SITL
Improved communication, only set simulator values via X-Plane DataRefs, no a mix with MSP.
Should not break compatibility with HITL Plugin 1.X or with "raw" X-Plane.
PR Type
Enhancement, New Feature
Description
This description is generated by an AI tool. It may have inaccuracies
Add support for X-Plane INAV-XITL plugin with DataRef-based communication for SITL/HITL modes
Implement new simulator features: RC input from joystick, RSSI, failsafe, current sensor, rangefinder
Refactor simulator MSP protocol to support version 3 with extended sensor data and SITL-specific handling
Add connection state management and dynamic DREF registration for X-Plane plugin detection
Support battery voltage/current, magnetometer, and RC failsafe simulation via X-Plane DREFs
Diagram Walkthrough
File Walkthrough
9 files
Refactor simulator MSP protocol to support V3Add current and rangefinder to simulator dataDefine MSP V3 and new HITL feature flagsEnable OSD in SITL mode via HITL flagAdd failsafe support to RC simulatorAdd failsafe setter function signatureIntegrate simulated current sensor dataImplement INAV-XITL plugin connection and DREFsAdd stdbool include for xplane header1 files
Fix GPS velocity handling for HITL mode2 files
Move RX_SIM and RANGEFINDER_FAKE to commonEnable RX_SIM and RANGEFINDER_FAKE globally3 files
Add reference to INAV-X-Plane-XITL pluginDocument INAV-XITL plugin for advanced featuresAdd INAV-XITL plugin documentation link