Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magnetometer alignment tool => alignment tool #1806

Merged
merged 6 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 9 additions & 24 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -900,18 +900,6 @@
"configurationSerialRXHelp": {
"message": "<strong>Note:</strong> Remember to configure a Serial Port (via Ports tab) for the serial receiver"
},
"configurationBoardAlignment": {
"message": "Board and Sensor Alignment"
},
"configurationBoardAlignmentRoll": {
"message": "Roll Degrees"
},
"configurationBoardAlignmentPitch": {
"message": "Pitch Degrees"
},
"configurationBoardAlignmentYaw": {
"message": "Yaw Degrees"
},
"configurationSensorAlignmentMag": {
"message": "MAG Alignment"
},
Expand Down Expand Up @@ -2035,19 +2023,22 @@
"message": "Signal Strength"
},
"magnetometerHead": {
"message": "Magnetometer Alignment"
"message": "Alignment tool"
},
"magnetometerHelp": {
"message": "Adjust the magnetometer orientation to match physical orientation on the aircraft.<br/>If magnetometer is not BN-880, adjust according to \"compass direction\" arrow or axis markings on your magnetometer model.<br/><strong>Note:</strong> Magnetometer alignment is relative to FC. Make sure to align FC first (board_align_yaw, board_align_pitch, board_align_roll)."
"message": "1. Adjust Flight Controller orientation to match physical orientation on the aircraft <u>according to \"direction\" arrow on Flight Controller</u>.<br/>2. Adjust magnetometer orientation to match physical orientation on the aircraft <u>according to \"compass direction\" arrow or axis markings on magnetometer</u>.<br/><strong>Note:</strong> Magnetometer orientation preset (align_mag) is relative to FC. Make sure to align FC first (align_board_pitch, align_board_roll, align_board_yaw).<br/>If preset is not used (orientation is set using align_mag_roll, align_mag_pitch and align_mag_yaw), then magnetometer orientation is independent."
},
"magnetometerOrientationPreset": {
"message": "Orientation presets"
"message": "Orientation preset (align_mag). Relative to FC orientation"
},
"boardInfo": {
"message": "1. Select Flight Controller alignment<br>(align_board_roll, align_board_pitch, align_board_yaw)"
},
"magnetometerInfo": {
"message": "Select a preset or create a custom configuration moving the sliders"
"message": "2. Select a preset (align_mag) or create a custom configuration using the sliders<br>(align_mag_roll, align_mag_pitch, align_mag_yaw)"
},
"magnetometerElementToShow": {
"message": "Element to show"
"message": "Element to show: Magnetometer model or axes"
},

"axisTableTitleAxis": {
Expand All @@ -2060,17 +2051,14 @@
"message": "Value [degree]"
},




"configurationMagnetometerHelp": {
"message": "<strong>Note:</strong> Remember to configure a Serial Port (via Ports tab) when using the Magnetometer feature."
},
"magnetometerStatHead": {
"message": "Mag Statistics"
},
"tabMAGNETOMETER": {
"message": "Magnetometer"
"message": "Alignment tool"
},
"motors": {
"message": "Motors"
Expand Down Expand Up @@ -4772,9 +4760,6 @@
"WaypointOptionP2": {
"message": "P2"
},
"rollPitchAdjustmentsMoved": {
"message": "Roll & Pitch board orientation is available only in the CLI. Do not use it to trim the airplane for the level flight! Use Fixed Wing Level Trim on the PID tuning tab under Mechanics instead (<strong>fw_level_pitch_trim</strong>)."
},
"pidId": {
"message": "#"
},
Expand Down
16 changes: 14 additions & 2 deletions src/css/tabs/magnetometer.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@

.tab-magnetometer #interactive_block {
position: absolute;
width: calc(100% - 40px);
height: calc(100% - 245px);
width: calc(100% - 655px);
height: 771px;
min-height: calc(100% - 200px);
background-color: #f9f9f9;
border-radius: 5px;
border: 1px solid #e4e4e4;
Expand Down Expand Up @@ -190,6 +191,17 @@ progress[value]::-webkit-progress-value {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.25) inset;
}

.tab-magnetometer-left-wrapper {
float:left;
width: calc( 100% - 655px );
}

.tab-magnetometer-right-wrapper {
float:right;
width: 600px;
}


@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {

#magnetometer-map {
Expand Down
15 changes: 15 additions & 0 deletions src/css/tabs/setup.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@
float: left;
}

.attitude_note1 {
position: absolute;
left: 130px;
top: 29px;
font-size: 10px;
}

.attitude_note2 {
position: absolute;
left: 130px;
top: 13px;
font-size: 10px;
}


#interactive_block a.reset {
position: absolute;
display: block;
Expand Down
22 changes: 0 additions & 22 deletions tabs/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,6 @@

</div>
</div>
<div class="board gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" data-i18n="configurationBoardAlignment"></div>
<div class="helpicon cf_tip" data-i18n_title="configHelp2"></div>
</div>
<div class="spacer_box">
<div class="info-box" data-i18n="rollPitchAdjustmentsMoved"></div>
<div class="number">
<input id="board_align_yaw" type="number" name="board_align_yaw" step="0.1" min="-180" max="360" />
<div class="alignicon yaw"></div>
<label for="board_align_yaw" data-i18n="configurationBoardAlignmentYaw"></label>
</div>
<div class="select" style="position: relative; top: -3px;">
<select id="magalign" class="magalign">
<option value="0">Default</option>
<!-- list generated here -->
</select>
<div class="alignicon yaw"></div>
<label for="magalign" data-i18n="configurationSensorAlignmentMag"></label>
</div>
</div>
</div>

<div class="config-section gui_box grey other">
<div class="gui_box_titlebar">
Expand Down
19 changes: 4 additions & 15 deletions tabs/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
var saveChainer = new MSPChainerClass();

var saveChain = [
mspHelper.saveSensorAlignment,
mspHelper.saveAccTrim,
mspHelper.saveArmingConfig,
mspHelper.saveAdvancedConfig,
mspHelper.saveVTXConfig,
mspHelper.saveBoardAlignment,
mspHelper.saveCurrentMeterConfig,
mspHelper.saveMiscV2,
saveSettings,
Expand Down Expand Up @@ -115,14 +113,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
// translate to user-selected language
localize();

let alignments = FC.getSensorAlignments();
let orientation_mag_e = $('select.magalign');

for (i = 0; i < alignments.length; i++) {
orientation_mag_e.append('<option value="' + (i + 1) + '">' + alignments[i] + '</option>');
}
orientation_mag_e.val(SENSOR_ALIGNMENT.align_mag);

// VTX
var config_vtx = $('.config-vtx');
if (VTX_CONFIG.device_type != VTX.DEV_UNKNOWN) {
Expand Down Expand Up @@ -209,7 +199,8 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('input[name="board_align_yaw"]').val((BOARD_ALIGNMENT.yaw / 10.0).toFixed(1));

// fill magnetometer
$('#mag_declination').val(MISC.mag_declination);
//UPDATE: moved to GPS tab and hidden
//$('#mag_declination').val(MISC.mag_declination);

// fill battery voltage
$('#voltagesource').val(MISC.voltage_source);
Expand Down Expand Up @@ -264,7 +255,8 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$i2cSpeed.change();

$('a.save').click(function () {
MISC.mag_declination = parseFloat($('#mag_declination').val());
//UPDATE: moved to GPS tab and hidden
//MISC.mag_declination = parseFloat($('#mag_declination').val());

ARMING_CONFIG.auto_disarm_delay = parseInt($('input[name="autodisarmdelay"]').val());

Expand All @@ -281,8 +273,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
MISC.battery_capacity_critical = parseInt($('#battery_capacity_critical').val() * MISC.battery_capacity / 100);
MISC.battery_capacity_unit = $('#battery_capacity_unit').val();

SENSOR_ALIGNMENT.align_mag = parseInt(orientation_mag_e.val());

googleAnalytics.sendEvent('Setting', 'I2CSpeed', $('#i2c_speed').children("option:selected").text());

googleAnalytics.sendEvent('Board', 'Accelerometer', $('#sensor-acc').children("option:selected").text());
Expand All @@ -300,7 +290,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
helper.features.reset();
helper.features.fromUI($('.tab-configuration'));
helper.features.execute(function () {
BOARD_ALIGNMENT.yaw = Math.round(parseFloat($('input[name="board_align_yaw"]').val()) * 10);
CURRENT_METER_CONFIG.scale = parseInt($('#currentscale').val());
CURRENT_METER_CONFIG.offset = Math.round(parseFloat($('#currentoffset').val()) * 10);
saveChainer.execute();
Expand Down
Loading