Skip to content

Commit 6e0b100

Browse files
authored
Merge pull request #443 from mikeller/added_fpv_cam_angle_degrees
Added setting of FPV cam angle.
2 parents 57de73b + 2187e6d commit 6e0b100

File tree

5 files changed

+82
-25
lines changed

5 files changed

+82
-25
lines changed

_locales/en/messages.json

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,13 @@
638638
"message": "Magnetometer Declination [deg]"
639639
},
640640
"configurationAutoDisarmDelay": {
641-
"message": "Disarm motors after set delay(Seconds) (Requires MOTOR_STOP feature)"
641+
"message": "Disarm motors after set delay [seconds] (Requires MOTOR_STOP feature)"
642642
},
643643
"configurationDisarmKillSwitch": {
644644
"message": "Disarm motors regardless of throttle value (When arming via AUX channel)"
645645
},
646646
"configurationDigitalIdlePercent": {
647-
"message": "Motor Idle Throttle Value (percent)"
647+
"message": "Motor Idle Throttle Value [percent]"
648648
},
649649
"configurationDigitalIdlePercentHelp": {
650650
"message": "This is the 'idle' value in percent of maximum throttle that is sent to the ESCs when the craft is armed and the trottle stick is at minimum position. Increase the percent value to gain more idle speed."
@@ -722,7 +722,7 @@
722722
"message": "Flight Controller Loop Time"
723723
},
724724
"configurationCalculatedCyclesSec": {
725-
"message": "Cycles/Sec (Hz)"
725+
"message": "Cycles/Sec [Hz]"
726726
},
727727
"configurationLoopTimeHelp": {
728728
"message": "<strong>Note:</strong> Make sure your FC is capable to operate on these speeds! Check CPU and cycletime stability. Changing this may require PID re-tuning. TIP: Disable Accelerometer and other sensors to gain more performance."
@@ -873,7 +873,7 @@
873873
"message": "Manual"
874874
},
875875
"receiverRcInterpolationInterval": {
876-
"message": "RC Interpolating Interval (ms)"
876+
"message": "RC Interpolation Interval [ms]"
877877
},
878878
"pidTuningPtermSetpoint": {
879879
"message": "D Setpoint transition"
@@ -900,7 +900,7 @@
900900
"message": "RC Rate"
901901
},
902902
"pidTuningMaxVel": {
903-
"message": "Max Vel (deg/s)"
903+
"message": "Max Vel [deg/s]"
904904
},
905905
"pidTuningRate": {
906906
"message": "Rate"
@@ -1707,25 +1707,25 @@
17071707
"message": "Profile independent Filter Settings"
17081708
},
17091709
"pidTuningGyroLowpassFrequency": {
1710-
"message": "Gyro Soft Lowpass Frequency (Hz)"
1710+
"message": "Gyro Soft Lowpass Frequency [Hz]"
17111711
},
17121712
"pidTuningGyroLowpassFrequencyHelp": {
1713-
"message": "Gyro Soft Lowpass Frequency (Hz)"
1713+
"message": "Gyro Soft Lowpass Frequency [Hz]"
17141714
},
17151715
"pidTuningGyroNotch1Frequency": {
1716-
"message": "Gyro Notch Filter 1 Frequency (Hz)"
1716+
"message": "Gyro Notch Filter 1 Frequency [Hz]"
17171717
},
17181718
"pidTuningGyroNotch2Frequency": {
1719-
"message": "Gyro Notch Filter 2 Frequency (Hz)"
1719+
"message": "Gyro Notch Filter 2 Frequency [Hz]"
17201720
},
17211721
"pidTuningGyroNotchFrequencyHelp": {
17221722
"message": "Gyro Notch Filter Frequency in Hz (0 means disabled)"
17231723
},
17241724
"pidTuningGyroNotch1Cutoff": {
1725-
"message": "Gyro Notch Filter Cutoff 1 Frequency (Hz)"
1725+
"message": "Gyro Notch Filter Cutoff 1 Frequency [Hz]"
17261726
},
17271727
"pidTuningGyroNotch2Cutoff": {
1728-
"message": "Gyro Notch Filter Cutoff 2 Frequency (Hz)"
1728+
"message": "Gyro Notch Filter Cutoff 2 Frequency [Hz]"
17291729
},
17301730
"pidTuningGyroNotchCutoffHelp": {
17311731
"message": "Gyro Notch Filter Cutoff Frequency in Hz (This is where notch filter starts. For example with notch filter 160 and notch hz of 260 it means the range is 160-360hz with most attenuation around center)"
@@ -1734,28 +1734,28 @@
17341734
"message": "Filter Settings"
17351735
},
17361736
"pidTuningDTermLowpassFrequency": {
1737-
"message": "D Term Lowpass Frequency (Hz)"
1737+
"message": "D Term Lowpass Frequency [Hz]"
17381738
},
17391739
"pidTuningDTermLowpassFrequencyHelp": {
1740-
"message": "D Term Lowpass Frequency in Hz (0 means disabled)"
1740+
"message": "D Term Lowpass Frequency [Hz] (0 means disabled)"
17411741
},
17421742
"pidTuningDTermNotchFrequency": {
1743-
"message": "D Term Notch Filter Frequency (Hz)"
1743+
"message": "D Term Notch Filter Frequency [Hz]"
17441744
},
17451745
"pidTuningDTermNotchFrequencyHelp": {
1746-
"message": "D Term Notch Filter Frequency in Hz (0 means disabled)"
1746+
"message": "D Term Notch Filter Frequency [Hz] (0 means disabled)"
17471747
},
17481748
"pidTuningDTermNotchCutoff": {
1749-
"message": "D Term Notch Filter Cutoff (Hz)"
1749+
"message": "D Term Notch Filter Cutoff [Hz]"
17501750
},
17511751
"pidTuningDTermNotchCutoffHelp": {
17521752
"message": "D Term Notch Filter Cutoff in Hz (This is where notch filter starts. For example with notch filter 160 and notch hz of 260 it means the range is 160-360hz with most attenuation around center)"
17531753
},
17541754
"pidTuningYawLowpassFrequency": {
1755-
"message": "Yaw Lowpass Frequency (Hz)"
1755+
"message": "Yaw Lowpass Frequency [Hz]"
17561756
},
17571757
"pidTuningYawLowpassFrequencyHelp": {
1758-
"message": "Yaw Lowpass Frequency in Hz (Yaw axis can sometimes be noiser than the rest. This filter only affects the P of yaw)"
1758+
"message": "Yaw Lowpass Frequency [Hz] (Yaw axis can sometimes be noiser than the rest. This filter only affects the P of yaw)"
17591759
},
17601760
"pidTuningVbatPidCompensation": {
17611761
"message": "Vbat PID Compensation"
@@ -1916,16 +1916,19 @@
19161916
"pidTuningPidTuningTip": {
19171917
"message": "<b>Proportional:</b> You will notice a very strong resistant force to any attempts to move the MultiRotor<br><b>Integral:</b> Increase the ability to hold overall initial position and reduce drift, but also increase the delay in returning to initial position.<br><b>Derivative:</b> Improves the speed at which deviations are recovered, but increases noise<br><b>Rates and Expo</b>: Determine your stick feel based on these parameters. Use the graph and live 3D model to find your favourite rate setting"
19181918
},
1919-
"pidTuningRatesTip": {
1919+
"pidTuningRatesTip": {
19201920
"message": "Play with the rates and see how those affect the stick curve"
19211921
},
1922-
"configurationMisc": {
1922+
"configurationMisc": {
19231923
"message": "Misc"
19241924
},
1925-
"configurationVesselName": {
1925+
"configurationVesselName": {
19261926
"message": "Craft name"
19271927
},
1928-
"onboardLoggingBlackbox": {
1928+
"configurationFpvCamAngleDegrees": {
1929+
"message": "FPV Camera Angle [degrees]"
1930+
},
1931+
"onboardLoggingBlackbox": {
19291932
"message": "Blackbox logging device"
19301933
},
19311934
"onboardLoggingRateOfLogging": {

js/fc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,11 @@ var FC = {
305305
rx_max_usec: 0,
306306
rcInterpolation: 0,
307307
rcInterpolationInterval:0,
308-
airModeActivateThreshold: 0
308+
airModeActivateThreshold: 0,
309+
rxSpiProtocol: 0,
310+
rxSpiId: 0,
311+
rxSpiRfChannelCount: 0,
312+
fpvCamAngleDegrees: 0
309313
};
310314

311315
FAILSAFE_CONFIG = {

js/msp/MSPHelper.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,17 @@ MspHelper.prototype.process_data = function(dataHandler) {
605605
RX_CONFIG.rcInterpolation = data.readU8();
606606
RX_CONFIG.rcInterpolationInterval = data.readU8();
607607
RX_CONFIG.airModeActivateThreshold = data.readU16();
608+
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
609+
RX_CONFIG.rxSpiProtocol = data.readU8();
610+
RX_CONFIG.rxSpiId = data.readU32();
611+
RX_CONFIG.rxSpiRfChannelCount = data.readU8();
612+
RX_CONFIG.fpvCamAngleDegrees = data.readU8();
613+
} else {
614+
RX_CONFIG.rxSpiProtocol = 0;
615+
RX_CONFIG.rxSpiId = 0;
616+
RX_CONFIG.rxSpiRfChannelCount = 0;
617+
RX_CONFIG.fpvCamAngleDegrees = 0;
618+
}
608619
} else {
609620
RX_CONFIG.rcInterpolation = 0;
610621
RX_CONFIG.rcInterpolationInterval = 0;
@@ -1083,6 +1094,12 @@ MspHelper.prototype.crunch = function(code) {
10831094
buffer.push8(RX_CONFIG.rcInterpolation)
10841095
.push8(RX_CONFIG.rcInterpolationInterval)
10851096
.push16(RX_CONFIG.airModeActivateThreshold);
1097+
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
1098+
buffer.push8(RX_CONFIG.rxSpiProtocol)
1099+
.push32(RX_CONFIG.rxSpiId)
1100+
.push8(RX_CONFIG.rxSpiRfChannelCount)
1101+
.push8(RX_CONFIG.fpvCamAngleDegrees);
1102+
}
10861103
}
10871104

10881105
break;

tabs/configuration.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,11 @@
532532
i18n="configurationVesselName"></span>
533533
</label>
534534
</div>
535+
<div class="number fpvCamAngleDegrees">
536+
<label> <input type="number" name="fpvCamAngleDegrees" step="1" min="0" max="50" /> <span
537+
i18n="configurationFpvCamAngleDegrees"></span>
538+
</label>
539+
</div>
535540
</div>
536541
</div>
537542
</div>

tabs/configuration.js

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,22 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
118118
}
119119

120120
function load_current() {
121-
var next_callback = load_html;
121+
var next_callback = load_rx_config;
122122
if (semver.gte(CONFIG.flightControllerVersion, "3.1.0")) {
123123
MSP.send_message(MSPCodes.MSP_CURRENT_METER_CONFIG, false, false, next_callback);
124124
} else {
125125
next_callback();
126126
}
127127
}
128128

129+
function load_rx_config() {
130+
var next_callback = load_html;
131+
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
132+
MSP.send_message(MSPCodes.MSP_RX_CONFIG, false, false, next_callback);
133+
} else {
134+
next_callback();
135+
}
136+
}
129137

130138
//Update Analog/Battery Data
131139
function load_analog() {
@@ -354,6 +362,13 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
354362

355363
$('input[name="vesselName"]').val(CONFIG.name);
356364

365+
366+
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
367+
$('input[name="fpvCamAngleDegrees"]').val(RX_CONFIG.fpvCamAngleDegrees);
368+
} else {
369+
$('div.fpvCamAngleDegrees').hide();
370+
}
371+
357372
if (semver.lt(CONFIG.flightControllerVersion, "3.0.0")) {
358373
$('.miscSettings').hide();
359374
}
@@ -739,6 +754,10 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
739754
PID_ADVANCED_CONFIG.gyroUse32kHz = $('input[id="gyroUse32kHz"]').is(':checked') ? 1 : 0;
740755
}
741756

757+
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
758+
RX_CONFIG.fpvCamAngleDegrees = parseInt($('input[name="fpvCamAngleDegrees"]').val());
759+
}
760+
742761
function save_serial_config() {
743762
if (semver.lt(CONFIG.apiVersion, "1.6.0")) {
744763
MSP.send_message(MSPCodes.MSP_SET_CF_SERIAL_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_CF_SERIAL_CONFIG), false, save_misc);
@@ -838,14 +857,23 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
838857
}
839858

840859
function save_current() {
841-
var next_callback = save_to_eeprom;
860+
var next_callback = save_rx_config;
842861
if (semver.gte(CONFIG.flightControllerVersion, "3.1.0")) {
843862
MSP.send_message(MSPCodes.MSP_SET_CURRENT_METER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_CURRENT_METER_CONFIG), false, next_callback);
844863
} else {
845864
next_callback();
846865
}
847866
}
848867

868+
function save_rx_config() {
869+
var next_callback = save_to_eeprom;
870+
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
871+
MSP.send_message(MSPCodes.MSP_SET_RX_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_RX_CONFIG), false, next_callback);
872+
} else {
873+
next_callback();
874+
}
875+
}
876+
849877
function save_to_eeprom() {
850878
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, reboot);
851879
}

0 commit comments

Comments
 (0)