Skip to content

Commit 02d3fd6

Browse files
authored
Add virtual dual IMU support for 1.47 (#4742)
1 parent e65076d commit 02d3fd6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/js/VirtualFC.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ const VirtualFC = {
180180

181181
virtualFC.SENSOR_ALIGNMENT = { ...FC.SENSOR_ALIGNMENT };
182182
virtualFC.SENSOR_ALIGNMENT.gyro_to_use = 0;
183-
virtualFC.SENSOR_ALIGNMENT.gyro_detection_flags = 1;
183+
virtualFC.SENSOR_ALIGNMENT.gyro_enable_mask = (1 << 8) - 1; // Used for API v1.47+
184+
virtualFC.SENSOR_ALIGNMENT.gyro_detection_flags = semver.gte(virtualFC.CONFIG.apiVersion, API_VERSION_1_47)
185+
? 3
186+
: 1;
184187

185188
virtualFC.SENSOR_DATA = { ...FC.SENSOR_DATA };
186189

@@ -271,6 +274,10 @@ const VirtualFC = {
271274
opticalflow_hardware: 1, // MT01
272275
};
273276

277+
// For API v1.47+, set dual gyro hardware IDs
278+
virtualFC.GYRO_SENSOR.gyro_hardware[0] = 13;
279+
virtualFC.GYRO_SENSOR.gyro_hardware[1] = 22;
280+
274281
virtualFC.SENSOR_DATA.sonars = 231;
275282

276283
virtualFC.GPS_CONFIG = {

0 commit comments

Comments
 (0)