These are chat archives for dronekit/dronekit-android

10th
Oct 2016
mJaneBP
@mJaneBP
Oct 10 2016 03:09
This message was deleted

Hello, I want to get mavlink variables that are not included in the attribute types (rc channel, EKF values) so I'm trying to listen to the mavlink messages. This is my code:
protected void onregMavButtonClicked(View view)
{
if (myPH.isConnected())
{
myPH.addMavlinkObserver(new MavlinkObserver() {
@Override
public void onMavlinkMessageReceived(MavlinkMessageWrapper mavlinkMessageWrapper) {

                                        MAVLinkMessage Mm = mavlinkMessageWrapper.getMavLinkMessage();
                                        writeToTab("got sth" + String.format("%d",Mm.msgid));                                     
                                    }
                                }
        );   

}
}
After that I see the "got sth 0" shows up, so I got a heartbeat message. But it only appear once.

mJaneBP
@mJaneBP
Oct 10 2016 03:15
(Sorry for the poor code typing) So I try to register the Mavlink Observer after a button click event, and connection check. But after I click the button, the "got sth 0" message only appear once. It should appear frequently right? Please give some guidance, thanks so much!
Or must I send a message to PixHawk first for it to return the variables like in mission planner? I haven't use the sendMavlinkMessage from Experimental Api at all
mJaneBP
@mJaneBP
Oct 10 2016 06:44
Can I please get some help? If this question is inappropriate for this forum please tell me so.
mJaneBP
@mJaneBP
Oct 10 2016 07:59
never mind, my UI was causing the problem. Got different Mavlink messages now.