dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
980 stars 579 forks source link

Can not receive the positionX,Y,Z information of simulatorstate in the SampleCode #365

Open yuansuzhe123 opened 5 years ago

yuansuzhe123 commented 5 years ago

The code fragment in Samplecode is as follows: public void setUpListeners() { Simulator simulator = ModuleVerificationUtil.getSimulator(); Log.d("rund","setuplisteners2222"); if (simulator != null) { Log.d("rund","setuplisteners333"); simulator.setStateCallback(new SimulatorState.Callback() { @Override public void onUpdate(@NonNull final SimulatorState simulatorState) { positionx=simulatorState.getPositionX(); positiony=simulatorState.getPositionX(); Log.d("runt","positionxxxxxxx="+positionx+"\n"); Log.d("runt","positionyyyyyy="+positiony+"\n"); ToastUtils.setResultToText(textView, "Yaw : "

kenargo commented 5 years ago

Don't use stimulator state,  use aircraft callbacks.  The aircraft reports where it is,  even when using the sim it reports the same as of it was flying

⁣Sent from BlueMail ​

On Nov 22, 2018, 7:09 PM, at 7:09 PM, yuansuzhe123 notifications@github.com wrote:

The code fragment in Samplecode is as follows: public void setUpListeners() { Simulator simulator = ModuleVerificationUtil.getSimulator(); Log.d("rund","setuplisteners2222"); if (simulator != null) { Log.d("rund","setuplisteners333"); simulator.setStateCallback(new SimulatorState.Callback() { @Override public void onUpdate(@NonNull final SimulatorState simulatorState) { positionx=simulatorState.getPositionX(); positiony=simulatorState.getPositionX(); Log.d("runt","positionxxxxxxx="+positionx+"\n"); Log.d("runt","positionyyyyyy="+positiony+"\n"); ToastUtils.setResultToText(textView, "Yaw : "

  • simulatorState.getYaw()
  • ","
  • "X : "
  • simulatorState.getPositionX()
  • "\n"
  • "Y : "
  • simulatorState.getPositionY()
  • ","
  • "Z : "
  • simulatorState.getPositionZ()); } %%%%%%%%%%%%%% We want to get the information about the aircraft's real time positionx and positiony in the simulator,but the program after override the onupdata method will not execution ,So how can we modify the program or whether we have some new method to get these information.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/dji-sdk/Mobile-SDK-Android/issues/365

Michael-DJI commented 5 years ago

@yuansuzhe123 based on @kenargo 's advice, did you resolve your issue with new version? if not, pls report the issue to dev@dji.com it's the official channel to request DJI SDK support now.