0

I am using dronekit-android packages that can successfully connect to PX4 board. However, I try to receive the mavlink message in a while 1 thread, the receive API addMavlinkObserver causes the system crash.

After the drone is connected, I simply call this function upon pressing a button and it crashes.

this.drone.addMavlinkObserver(new MavlinkObserver() { 
   @Override 
   public void onMavlinkMessageReceived(MavlinkMessageWrapper mavlinkMessageWrapper) { 
     //Log.d("Received Mavlinks:", mavlinkMessageWrapper.getMavLinkMessage().toString()); 
     Toast.makeText(getApplicationContext(), "MAV receive " + mavlinkMessageWrapper.getMavLinkMessage().toString(),Toast.L‌​ENGTH_LONG).show();
    } 
})

Does anyone have any idea?

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
Sean Hsu
  • 11
  • 2
  • After the drone is connected, I simply call this function upon pressing a button and it crashes. this.drone.addMavlinkObserver(new MavlinkObserver() { @Override public void onMavlinkMessageReceived(MavlinkMessageWrapper mavlinkMessageWrapper) { //Log.d("Received Mavlinks:", mavlinkMessageWrapper.getMavLinkMessage().toString()); Toast.makeText(getApplicationContext(), "MAV receive " + mavlinkMessageWrapper.getMavLinkMessage().toString(),Toast.LENGTH_LONG).show(); } }); – Sean Hsu Nov 07 '16 at 11:23
  • Do you have a stack trace for the crash? There's not much more to go on without that – cbw Jan 06 '17 at 06:54

0 Answers0