Skip to content

SDK_SERVICE_GIMBAL_ROTATE_YAW_OUT_OF_RANGE .. when drone is flying #548

Open
@petered

Description

@petered

I'm having this problem with an M3T, on 5.14.0 (also 5.13.0)

So, as you may know, if you call the GimbalKey.KeyRotateByAngle key when the drone is flying, it rotates its body in the yaw-direction instead of the gimbal.

That's good - means it can rotate 360 degrees.

The problem is - if the drone is flying and you to rotate by, say, 30 degrees to the right, it still fails with code "SDK_SERVICE_GIMBAL_ROTATE_YAW_OUT_OF_RANGE" . Well sure - it would be out of range if the drone was on the ground and it had to actually rotate its gimbal. But since the drone is flying, it is using its body to rotate, and that check should be ignored.

Here's how I create the gimbal rotation objet that I pass to the drone:

fun getGimbalRotation(mode: GimbalAngleRotationMode, pitchDeg: Double, yawDeg: Double, durationSec: Double = 1.0): GimbalAngleRotation {
    return GimbalAngleRotation(
        mode,
        pitchDeg,
        0.0,
        yawDeg,
        false,
        false,
        false,
        durationSec,
        false,
        1000
    )
}

The problem occurs for both ABSOLUTE and RELATIVE rotation

Can we fix this so that it ignores the yaw check when the drone is flying? Is there a workaround?

Thank you.


我现在用的是M3T,无人机固件版本5.14.0(5.13.0也有这个问题)。

可能你也知道,当无人机在飞的时候,如果你调用GimbalKey.KeyRotateByAngle,它会用机身来做yaw方向的旋转,而不是转动云台。

这本来挺好的,因为这样一来就可以360度随意旋转了。

但问题来了——现在无人机明明正在飞,如果我想向右转个30度,它还是会报错,提示SDK_SERVICE_GIMBAL_ROTATE_YAW_OUT_OF_RANGE。
这明显不对啊。如果是在地面上,云台确实转不到那么大的角度,会超范围。但现在明明在飞,它用的是机身旋转,这个检查是不是就该跳过了?

下面是我创建云台旋转对象然后发给无人机的代码:

fun getGimbalRotation(mode: GimbalAngleRotationMode, pitchDeg: Double, yawDeg: Double, durationSec: Double = 1.0): GimbalAngleRotation {
    return GimbalAngleRotation(
        mode,
        pitchDeg,
        0.0,
        yawDeg,
        false,
        false,
        false,
        durationSec,
        false,
        1000
    )
}

有没有办法修一下,让它在飞行状态时忽略yaw角度的检测?
或者说,有没有什么临时的解决方法?

谢谢啦!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions