御2行业进阶版,在执行waypoint MISSION 时,执行 Rotation rotation =new ...

Completed

Comments

10 comments

  • DJI Developer Support
    飞机云台的getYawRelativeToAircraftHeading为什么还是不会为0? -->您选择的模式是ABSOLUTE_ANGLE,也就是绝对角度。航点飞行的时候云台角度以正北为0,而不是以机头方向为0,因此存在角度差。
    0
    Comment actions Permalink
  • DJI Developer Support
    那要怎样设置,才能使云台于机头的夹角为0?
    0
    Comment actions Permalink
  • DJI Developer Support
    可以通过FlightControllerState.getAttitude获取到无人机的当前朝向,然后通过Rotation rotation =new Rotation.Builder().mode(RotationMode.ABSOLUTE_ANGLE).yaw(无人机当前朝向).build(); gimbal.rotate(rotation,callBack);实现云台与无人机朝向相同。
    0
    Comment actions Permalink
  • DJI Developer Support
    我按你的方式设置yaw,但是在执行waypoint 任务时,调gimbal.rotate,云台没任何变化,请问这是为什么?
    0
    Comment actions Permalink
  • DJI Developer Support
    我在模拟器上测试了一下,M2EA所使用的V1航线中可以使用Rotation rotation =new Rotation.Builder().mode(RotationMode.ABSOLUTE_ANGLE).yaw(0).build(); gimbal.rotate(rotation,callBack);将云台回中(这里的回中指的是与机头一个朝向),这一点与V2不同。但是航线中存在拍照和gimbalPitch的动作就会造成rotate失败,我这边测试回调是会给出提示的。
    0
    Comment actions Permalink
  • DJI Developer Support
    MSDK4.16.1,在waypoint1任务中,有拍照,有gimbalPitch动作,按你之前的建议用 Rotation rotation = new Rotation.Builder() .mode(RotationMode.ABSOLUTE_ANGLE) .pitch(0) .yaw((float) attitude.yaw) .build(); gimbal.rotate(rotation, new CommonCallbacks.CompletionCallback() { @Override public void onResult(DJIError djiError) { LogUtil.info2("云台归中", djiError == null ? "null" : djiError.getDescription()); if (djiError != null) { runOnUiThread(() -> { ToastUtil.show("云台归中失败:" + djiError.getDescription()); }); } } });
    0
    Comment actions Permalink
  • DJI Developer Support
    在onResult中没有错误返回,云台也不会回中
    0
    Comment actions Permalink
  • DJI Developer Support
    实测100%不会回中,也没错误返回。
    0
    Comment actions Permalink
  • DJI Developer Support
    你之前说“航点飞行的时候云台角度以正北为0,而不是以机头方向为0”为啥你用0?
    0
    Comment actions Permalink
  • DJI Developer Support
    收到你的反馈之后,我去确认了一下,目前waypointV2使用的是正北方向,v1航线因为航线动作无法设置yaw,因此rotate是否使用航线无关。 我注意到你使用的代码并没有设置旋转时间,如果设置旋转时间为2或者其他数值是否可以实现会中呢?或者使用reset的方法进行回中。
    1
    Comment actions Permalink

Please sign in to leave a comment.