mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-16 08:29:15 +01:00
LP-385 - Fix Actuator support for CameraControl
This commit is contained in:
parent
9bb9086167
commit
7ed8e63689
@ -89,6 +89,7 @@ static xTaskHandle taskHandle;
|
||||
static FrameType_t frameType = FRAME_TYPE_MULTIROTOR;
|
||||
static SystemSettingsThrustControlOptions thrustType = SYSTEMSETTINGS_THRUSTCONTROL_THROTTLE;
|
||||
static bool camStabEnabled;
|
||||
static bool camControlEnabled;
|
||||
|
||||
static uint8_t pinsMode[MAX_MIX_ACTUATORS];
|
||||
// used to inform the actuator thread that actuator update rate is changed
|
||||
@ -165,8 +166,8 @@ int32_t ActuatorInitialize()
|
||||
HwSettingsOptionalModulesData optionalModules;
|
||||
HwSettingsInitialize();
|
||||
HwSettingsOptionalModulesGet(&optionalModules);
|
||||
camStabEnabled = (optionalModules.CameraStab == HWSETTINGS_OPTIONALMODULES_ENABLED);
|
||||
|
||||
camStabEnabled = (optionalModules.CameraStab == HWSETTINGS_OPTIONALMODULES_ENABLED);
|
||||
camControlEnabled = (optionalModules.CameraControl == HWSETTINGS_OPTIONALMODULES_ENABLED);
|
||||
// Primary output of this module
|
||||
ActuatorCommandInitialize();
|
||||
|
||||
@ -471,9 +472,6 @@ static void actuatorTask(__attribute__((unused)) void *parameters)
|
||||
case MIXERSETTINGS_MIXER1TYPE_CAMERAYAW:
|
||||
status[ct] = cameraDesired.Yaw;
|
||||
break;
|
||||
case MIXERSETTINGS_MIXER1TYPE_CAMERATRIGGER:
|
||||
status[ct] = cameraDesired.Trigger;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -486,6 +484,14 @@ static void actuatorTask(__attribute__((unused)) void *parameters)
|
||||
command.Channel[ct] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (mixer_type == MIXERSETTINGS_MIXER1TYPE_CAMERATRIGGER) {
|
||||
if (camControlEnabled) {
|
||||
CameraDesiredTriggerGet(&status[ct]);
|
||||
} else {
|
||||
status[ct] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If mixer type is motor we need to find which motor has the highest value and which motor has the lowest value.
|
||||
|
Loading…
x
Reference in New Issue
Block a user