Skip to content
This repository was archived by the owner on Feb 25, 2021. It is now read-only.

Commit a137b5d

Browse files
committed
Option to invert the roll axis, used for older versions of AOG
1 parent 24c03b5 commit a137b5d

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/autosteer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ void autosteerWorker100Hz( void* z ) {
359359

360360
if ( initialisation.inclinoType != SteerConfig::InclinoType::None ) {
361361
roll = steerImuInclinometerData.roll * 16;
362+
363+
if ( steerConfig.invertRoll ) {
364+
roll = -roll;
365+
}
362366
} else {
363367
roll = 9999;
364368
}

src/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,13 @@ void setup( void ) {
782782
ESPUI.addControl( ControlType::Option, "FXOS8700/FXAS21002", "3", ControlColor::Alizarin, sel );
783783
}
784784

785+
{
786+
ESPUI.addControl( ControlType::Switcher, "Invert Roll Axis (enable for older versions of AgOpenGPS)", steerConfig.invertRoll ? "1" : "0", ControlColor::Peterriver, tab,
787+
[]( Control * control, int id ) {
788+
steerConfig.invertRoll = control->value.toInt() == 1;
789+
} );
790+
}
791+
785792
{
786793
uint16_t num = ESPUI.addControl( ControlType::Number, "Mounting Correction (Roll) of Imu", String( steerConfig.mountCorrectionImuRoll ), ControlColor::Peterriver, tab,
787794
[]( Control * control, int id ) {

src/main.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ struct SteerConfig {
188188
Fxos8700Fxas21002
189189
} inclinoType = InclinoType::None;
190190

191+
bool invertRoll = false;
192+
191193
bool sendCalibrationDataFromImu = false;
192194

193195
float mountCorrectionImuRoll = 0;

0 commit comments

Comments
 (0)