Virtual Stick Implementation in MSDK V5
已完成The API for virtual stick appears to have completely changed in MSDK v5. How can we translate the horizontal and vertical position of a virtual RC stick to controlling the pitch, roll and yaw of an aircraft accurately?
Will v5 add an interface similar to v4 where the aircraft can be sent the pitch, roll, yaw and vertical throttle e.g. like sendVirtualStickFlightControlData in v4? Or will all new drones including the mini 3 pro support waypoint missions?
Thanks
-
The MSDK V5 has refactored the whole virtual stick function. The virtual stick is just like a virtual remote controller, you can get left and right stick and set their value. All values are from -660 to 660. You need to find a linear relationship between the stick value to the speed. Different aircraft will have different coefficient. The Mini 3 Pro will not support waypointMissions. The plan to support Mini 3 Pro for MSDK is about next year. -
The Virtual Stick feature of version 4 of the MSDK was its most reliable feature across all drone models with a relatively easily accessible interface. I can't see how this refactor improves on the previous iteration of virtual stick? This will make it much more difficult to automate drone flight for drones like the mini 3. Access to an interface that can receive pitch, roll, yaw angles or velocities would be much more useful in my opinion since many people have already implemented solutions for this.
Will the mini 3 only be controllable via the new virtual stick interface?
-
We are now preparing the guide to help you switch from MSDK 4.x vesion to 5.x version. The virtual stick function you have mention, we do have some flightControllerKeys that matches with the previous MSDK 4.x version. The doc is about going online in the end of June in both Chinese and English version. Here is a screenshot of it. The KeyVirtualStickEnabled and KeySendVirtualStickFlightControlData are what you want. I am going to write an article with it soon. ![](https://djisdksupport.zendesk.com/attachments/token/Qu7ARF15JuTKmX0D5I03ygaVs/?name=image.png) -
I think I found the relevant key. I wasn't sure of the order of the 1st 4 (Double) parameters as they weren't named. But that can be easily discovered with some testing in the simulator
val vsSendDataKey: DJIKey.ActionKey<VirtualStickFlightControlParam, EmptyMsg> = KeyTools.createKey(
FlightControllerKey.KeySendVirtualStickFlightControlData
)
djiSdkModel.setValue(
vsSendDataKey,
VirtualStickFlightControlParam(
0.0, // Double: pitch in m/s ?
0.0, // Double: roll in m/s ?
0.0, // Double: yaw in degrees ?
50.0, // Double: altitude position in metres ?
VerticalControlMode.POSITION,
RollPitchControlMode.VELOCITY,
YawControlMode.ANGLE,
FlightCoordinateSystem.GROUND
)
) -
controlParam.setVerticalControlMode(verticalControlMode); controlParam.setRollPitchControlMode(rollPitchControlMode); controlParam.setYawControlMode(yawControlMode); controlParam.getRollPitchCoordinateSystem(rollPitchCoordinateSystem); controlParam.setVerticalThrottle(verticalThrottle); controlParam.setYaw(yaw); controlParam.setPitch(pitch); controlParam.setRoll(roll); KeyManager.getInstance().performAction(KeyTools.createKey(FlightControllerKey.KeySendVirtualStickFlightControlData), controlParam, Callback);
请先登录再写评论。
评论
6 条评论