-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Replace PASSTHROUGH with MANUAL flight mode (FW) #2661
Changes from 9 commits
14502e0
a955bf5
0aa0a75
4e6a95b
a52bf62
7ad5728
e00ee80
5d8259d
c82b065
71c1530
3936a95
bba8620
9c28150
fc72312
afcf673
af4430c
7273418
8282e96
2d01012
d01af8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ typedef enum { | |
BOXCAMSTAB = 7, | ||
BOXNAVRTH = 8, // old GPSHOME | ||
BOXNAVPOSHOLD = 9, // old GPSHOLD | ||
BOXPASSTHRU = 10, | ||
BOXMANUAL = 10, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation |
||
BOXBEEPERON = 11, | ||
BOXLEDLOW = 12, | ||
BOXLLIGHTS = 13, | ||
|
@@ -114,4 +114,4 @@ bool isRangeActive(uint8_t auxChannelIndex, const channelRange_t *range); | |
|
||
void updateActivatedModes(void); | ||
void updateUsedModeActivationConditionFlags(void); | ||
void configureModeActivationCondition(int macIndex, boxId_e modeId, uint8_t auxChannelIndex, uint16_t startPwm, uint16_t endPwm); | ||
void configureModeActivationCondition(int macIndex, boxId_e modeId, uint8_t auxChannelIndex, uint16_t startPwm, uint16_t endPwm); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,14 +70,14 @@ typedef enum { | |
NAV_POSHOLD_MODE= (1 << 5), // old GPS_HOLD | ||
HEADFREE_MODE = (1 << 6), | ||
NAV_LAUNCH_MODE = (1 << 7), | ||
PASSTHRU_MODE = (1 << 8), | ||
FAILSAFE_MODE = (1 << 10), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note sure this is important but I just noticed I changed the mode values to fill the previously unused 10th bit. I don't know if this can have any side effect. Tell me if it is wrong I will restore them to the old values. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shellixyz probably it's better to keep things as they are. We are reporting flight mode flags to blackbox and rearranging the bits will make things all messed up. |
||
AUTO_TUNE = (1 << 11), // old G-Tune | ||
NAV_WP_MODE = (1 << 12), | ||
UNUSED_MODE2 = (1 << 13), | ||
FLAPERON = (1 << 14), | ||
MANUAL_MODE = (1 << 8), | ||
FAILSAFE_MODE = (1 << 9), | ||
AUTO_TUNE = (1 << 10), // old G-Tune | ||
NAV_WP_MODE = (1 << 11), | ||
UNUSED_MODE2 = (1 << 12), | ||
FLAPERON = (1 << 13), | ||
#ifdef USE_FLM_TURN_ASSIST | ||
TURN_ASSISTANT = (1 << 15), | ||
TURN_ASSISTANT = (1 << 14), | ||
#endif | ||
} flightModeFlags_e; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ | |
#include "fc/rc_controls.h" | ||
#include "fc/rc_modes.h" | ||
#include "fc/runtime_config.h" | ||
#include "fc/controlrate_profile.h" | ||
|
||
#include "flight/imu.h" | ||
#include "flight/mixer.h" | ||
|
@@ -365,11 +366,10 @@ void servoMixer(float dT) | |
{ | ||
int16_t input[INPUT_SOURCE_COUNT]; // Range [-500:+500] | ||
|
||
if (FLIGHT_MODE(PASSTHRU_MODE)) { | ||
// Direct passthru from RX | ||
input[INPUT_STABILIZED_ROLL] = rcCommand[ROLL]; | ||
input[INPUT_STABILIZED_PITCH] = rcCommand[PITCH]; | ||
input[INPUT_STABILIZED_YAW] = rcCommand[YAW]; | ||
if (FLIGHT_MODE(MANUAL_MODE)) { | ||
input[INPUT_STABILIZED_ROLL] = rcCommand[ROLL] * currentControlRateProfile->manual_rates[FD_ROLL] / 100L; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right. |
||
input[INPUT_STABILIZED_PITCH] = rcCommand[PITCH] * currentControlRateProfile->manual_rates[FD_PITCH] / 100L; | ||
input[INPUT_STABILIZED_YAW] = rcCommand[YAW] * currentControlRateProfile->manual_rates[FD_YAW] / 100L; | ||
} else { | ||
// Assisted modes (gyro only or gyro+acc according to AUX configuration in Gui | ||
input[INPUT_STABILIZED_ROLL] = axisPID[ROLL]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we change the format of the PG wouldn't it be better to group entries by function? I.e.
Also note that since we change the in-storage format we need to bump up the version number of the PG definition here (the trailing
0
):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed will make the code clearer. Done.