Skip to content

Commit 04d4255

Browse files
authored
Remove IMU alignment from UI (#4590)
1 parent 25def4c commit 04d4255

File tree

6 files changed

+91
-347
lines changed

6 files changed

+91
-347
lines changed

locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,9 @@
14981498
"configurationGyroAlignmentHelp": {
14991499
"message": "The gyro alignment is the orientation of the gyro sensor on the flight controller board. The default is usually correct, but if you have a custom build or a flight controller with a different gyro orientation, you may need to adjust this setting."
15001500
},
1501+
"configurationGyroActiveIMU": {
1502+
"message": "Active IMU"
1503+
},
15011504
"configurationGyroAlignmentRoll": {
15021505
"message": "$t(configurationBoardAlignmentRoll.message)",
15031506
"description": "Don't translate!!!"

src/css/tabs/configuration.less

Lines changed: 3 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@
5454
}
5555
}
5656

57-
.gyro_box {
58-
padding: 12px;
59-
margin-bottom: 15px;
57+
.gyro_item {
58+
margin-bottom: 10px;
6059
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
6160
}
62-
.gyro_box:hover {
61+
.gyro_item:hover {
6362
border-color: #bbb;
6463
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
6564
}
@@ -69,67 +68,12 @@
6968
justify-content: space-between;
7069
margin-bottom: 10px;
7170
}
72-
.alignment-container {
73-
display: flex;
74-
align-items: center;
75-
flex: 3;
76-
}
77-
.alignment-container span {
78-
min-width: 100px;
79-
margin-right: 10px;
80-
}
81-
.alignment-container select {
82-
min-width: 120px;
83-
flex: 1;
84-
}
8571
.enable-checkbox {
8672
flex: 1;
8773
text-align: left;
8874
margin-right: 15px;
8975
padding-right: 0;
9076
}
91-
.custom_alignment {
92-
margin-top: 10px;
93-
padding: 10px;
94-
}
95-
.alignment_inputs_row {
96-
display: flex;
97-
justify-content: space-between;
98-
margin-bottom: 8px;
99-
}
100-
.alignment_input_cell {
101-
flex: 1;
102-
margin-right: 15px;
103-
text-align: center;
104-
}
105-
.alignment_input_cell:last-child {
106-
margin-right: 0;
107-
}
108-
.alignment_label {
109-
display: flex;
110-
align-items: center;
111-
justify-content: center;
112-
margin-bottom: 8px;
113-
white-space: nowrap;
114-
}
115-
.alignment_label span {
116-
font-size: 12px;
117-
color: #333;
118-
font-weight: 500;
119-
display: inline-block;
120-
vertical-align: middle;
121-
}
122-
.alignment_input_cell input {
123-
width: 80px;
124-
text-align: right;
125-
padding: 4px 8px;
126-
border: 1px solid #ddd;
127-
border-radius: 3px;
128-
}
129-
.alignment_input_cell input:focus {
130-
border-color: #999;
131-
outline: none;
132-
}
13377

13478
thead {
13579
display: none;

src/js/fc.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,6 @@ const FC = {
479479
gyro_to_use: 0,
480480
gyro_1_align: 0,
481481
gyro_2_align: 0,
482-
gyro_align: [],
483-
gyro_align_roll: [],
484-
gyro_align_pitch: [],
485-
gyro_align_yaw: [],
486482
mag_align_roll: 0,
487483
mag_align_pitch: 0,
488484
mag_align_yaw: 0,

src/js/msp/MSPHelper.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -643,26 +643,6 @@ MspHelper.prototype.process_data = function (dataHandler) {
643643

644644
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
645645
FC.SENSOR_ALIGNMENT.gyro_enable_mask = data.readU8(); // replacing gyro_to_use
646-
647-
// Initialize arrays for gyro alignment
648-
FC.SENSOR_ALIGNMENT.gyro_align = [];
649-
FC.SENSOR_ALIGNMENT.gyro_align_roll = [];
650-
FC.SENSOR_ALIGNMENT.gyro_align_pitch = [];
651-
FC.SENSOR_ALIGNMENT.gyro_align_yaw = [];
652-
653-
for (let i = 0; i < MAX_GYROS; i++) {
654-
FC.SENSOR_ALIGNMENT.gyro_align[i] = data.readU8();
655-
}
656-
657-
for (let i = 0; i < MAX_GYROS; i++) {
658-
FC.SENSOR_ALIGNMENT.gyro_align_roll[i] = data.read16() / 10;
659-
FC.SENSOR_ALIGNMENT.gyro_align_pitch[i] = data.read16() / 10;
660-
FC.SENSOR_ALIGNMENT.gyro_align_yaw[i] = data.read16() / 10;
661-
}
662-
663-
FC.SENSOR_ALIGNMENT.mag_align_roll = data.read16() / 10;
664-
FC.SENSOR_ALIGNMENT.mag_align_pitch = data.read16() / 10;
665-
FC.SENSOR_ALIGNMENT.mag_align_yaw = data.read16() / 10;
666646
} else {
667647
FC.SENSOR_ALIGNMENT.gyro_to_use = data.readU8();
668648
FC.SENSOR_ALIGNMENT.gyro_1_align = data.readU8();
@@ -2112,22 +2092,6 @@ MspHelper.prototype.crunch = function (code, modifierCode = undefined) {
21122092

21132093
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
21142094
buffer.push8(FC.SENSOR_ALIGNMENT.gyro_enable_mask); // replacing gyro_to_use
2115-
2116-
for (let i = 0; i < MAX_GYROS; i++) {
2117-
buffer.push8(FC.SENSOR_ALIGNMENT.gyro_align[i]);
2118-
}
2119-
2120-
for (let i = 0; i < MAX_GYROS; i++) {
2121-
buffer
2122-
.push16(FC.SENSOR_ALIGNMENT.gyro_align_roll[i] * 10)
2123-
.push16(FC.SENSOR_ALIGNMENT.gyro_align_pitch[i] * 10)
2124-
.push16(FC.SENSOR_ALIGNMENT.gyro_align_yaw[i] * 10);
2125-
}
2126-
2127-
buffer
2128-
.push16(FC.SENSOR_ALIGNMENT.mag_align_roll * 10)
2129-
.push16(FC.SENSOR_ALIGNMENT.mag_align_pitch * 10)
2130-
.push16(FC.SENSOR_ALIGNMENT.mag_align_yaw * 10);
21312095
} else {
21322096
buffer
21332097
.push8(FC.SENSOR_ALIGNMENT.gyro_to_use)

0 commit comments

Comments
 (0)