コード例 #1
0
ファイル: behavior.c プロジェクト: kd0aij/MatrixPilot
void updateBehavior(void)
{
    if (current_orientation == F_INVERTED)
    {
        if (canStabilizeHover() && rmat[7] < -14000)
        {
            current_orientation = F_HOVER;
        }
        else if (canStabilizeInverted() && rmat[8] < 6000)
        {
            current_orientation = F_INVERTED;
        }
        else
        {
            current_orientation = F_NORMAL;
        }
    }
    else if (current_orientation == F_HOVER)
    {
        if (canStabilizeHover() && rmat[7] < -8000)
        {
            current_orientation = F_HOVER;
        }
        else if (canStabilizeInverted() && rmat[8] < -6000)
        {
            current_orientation = F_INVERTED;
        }
        else
        {
            current_orientation = F_NORMAL;
        }
    }
    else
    {
        if (canStabilizeInverted() && rmat[8] < -6000)
        {
            current_orientation = F_INVERTED;
        }
        else if (canStabilizeHover() && rmat[7] < -14000)
        {
            current_orientation = F_HOVER;
        }
        else
        {
            current_orientation = F_NORMAL;
        }
    }
    if (flags._.pitch_feedback && !flags._.GPS_steering)
    {
        desired_behavior.W = current_orientation;
    }
    dcm_enable_yaw_drift_correction(current_orientation != F_HOVER);

}
コード例 #2
0
ファイル: yawCntrl.c プロジェクト: kd0aij/matrixpilot_old
void yawCntrl(void)
{
	if (canStabilizeHover() && current_orientation == F_HOVER)
	{
		hoverYawCntrl();
	}
	else
	{
		normalYawCntrl();
	}
}
コード例 #3
0
ファイル: pitchCntrl.c プロジェクト: kd0aij/matrixpilot_old
void pitchCntrl(void)
{
	if (canStabilizeHover() && desired_behavior._.hover)
	{
		hoverPitchCntrl();
	}
	else
	{
		normalPitchCntrl();
	}
}
コード例 #4
0
ファイル: rollCntrl.c プロジェクト: KeesGuijt/MatrixPilot
void rollCntrl(void)
{
    if (canStabilizeHover() && current_orientation == F_HOVER)
    {
        hoverRollCntrl();
    }
    else
    {
        normalRollCntrl();
    }
}