dronekit-android API addMavlinkObserver causes system crash

84 Views Asked by At

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?

0

There are 0 best solutions below