Virtual stick - uneven force

Completed

Comments

11 comments

  • DJI Developer Support
    Could you please explain why the RollPitchControlMode is not set to SPEED? When it is set to ANGLE, the acceleration process of the aircraft is not linear, resulting in continuous changes in the direction of speed. Consequently, this may cause the aircraft to fly in a curved trajectory.
    0
    Comment actions Permalink
  • Jonathan Gabbay

    We tested with RollPitchControlMode set to VELOCITY - we still get a curve, but this time the curve is reversed (on the other side of the line)

    virtualStickFlightControlParam.setVerticalControlMode(VerticalControlMode.POSITION);
    virtualStickFlightControlParam.setYawControlMode(YawControlMode.ANGLE);
    virtualStickFlightControlParam.setRollPitchControlMode(RollPitchControlMode.VELOCITY);
    virtualStickFlightControlParam.setRollPitchCoordinateSystem(FlightCoordinateSystem.GROUND);
    double xVelocity = Math.sin(angle);
    double yVelocity = Math.cos(angle);
    virtualStickFlightControlParam.setPitch(xVelocity*ROLL_PITCH_CONTROL_MAX_VELOCITY);
    virtualStickFlightControlParam.setRoll(yVelocity*ROLL_PITCH_CONTROL_MAX_VELOCITY);

     

    Again, we calculate the angle and send those params 10 times a second.

    0
    Comment actions Permalink
  • DJI Developer Support
    I would like to inquire about the type of curve you have obtained. Would it be possible for you to provide a video demonstrating your actions?
    0
    Comment actions Permalink
  • Jonathan Gabbay

    Yes

    Video Project.mp4

    0
    Comment actions Permalink
  • 0
    Comment actions Permalink
  • Jonathan Gabbay

    Thank you, I uploaded it.

    I would like to inform you that we implemented Virtual sticks mission on SDK 4 as well.

    We are only facing this problem with SDK 5.

    With SDK 4, the drone flies in a straight line (Mavic 2 Enterprise Dual).

    We are using the same algorithm with both SDKs.

    0
    Comment actions Permalink
  • DJI Developer Support
    I would like to inquire if you are controlling the aircraft in speed mode. It seems that the speed of the aircraft is constantly changing direction. The speed direction should always point towards the next waypoint.
    0
    Comment actions Permalink
  • Jonathan Gabbay

    We are using N mode

    0
    Comment actions Permalink
  • DJI Developer Support
    I would like to inquire if you control the aircraft by adjusting the speed through setting the virtual joystick? I am curious as to why the direction of the speed keeps changing.
    0
    Comment actions Permalink
  • Jonathan Gabbay

    We are not touching the controller at all

    0
    Comment actions Permalink
  • DJI Developer Support
    I would like to inquire about the control commands that were sent to the aircraft. If the command sent was for a constant speed, why did the aircraft fly in a curved trajectory?
    0
    Comment actions Permalink

Please sign in to leave a comment.