These are chat archives for dronekit/dronekit-android

8th
Jul 2016
Jack-2025
@Jack-2025
Jul 08 2016 10:34
is anyone interested in helping out to implementing px4 support for dronekit?
pablomar13
@pablomar13
Jul 08 2016 16:36
@Jack-2025 it would have to be outside my non-work hours, but sure thing. I can help I guess.
pablomar13
@pablomar13
Jul 08 2016 18:37
@ne0fhyk from what I've been told. Altitude reading is just "bugged" while there's no GPS lock.
Fredia Huya-Kouadio
@ne0fhyk
Jul 08 2016 18:38
@pablomar13 does the issue disappear once GPS lock is acquired?
kalnir
@kalnir
Jul 08 2016 18:47
Does anyone have an example of how to get a specific mavlink message that is not in the attributeEvents?
I've been trying to use MavlinkObserver to no avail so far
Fredia Huya-Kouadio
@ne0fhyk
Jul 08 2016 18:55
@kalnir can you post the code you used with MavlinkObserver?
kalnir
@kalnir
Jul 08 2016 18:56
mDrone.addMavlinkObserver(new MavlinkObserver() {
            @Override
            public void onMavlinkMessageReceived(MavlinkMessageWrapper mavlinkMessageWrapper) {
                Log.d("MAVLINK", "Got message - "+ mavlinkMessageWrapper.getMavLinkMessage().toString());
            }
        });
Fredia Huya-Kouadio
@ne0fhyk
Jul 08 2016 19:00
@kalnir that looks correct. Was your drone instance connected, and receiving attribute events?
kalnir
@kalnir
Jul 08 2016 19:00
Yes, I was able to display the gps and battery status using the attributevents
pablomar13
@pablomar13
Jul 08 2016 19:02
@ne0fhyk from what I've been told. Yes it does, haven't tested it myself though.
kalnir
@kalnir
Jul 08 2016 19:03
@ne0fhyk I'm specifically trying to get MAVLink/common/msg_rc_channels_raw message
Is there anything else that will give me that information?
Fredia Huya-Kouadio
@ne0fhyk
Jul 08 2016 19:07
@kalnir not at the moment. the raw rc data is not propagated through the attribute events yet.
@kalnir also did you set up your mavlink observer instance after the drone was connected and receiving data?
kalnir
@kalnir
Jul 08 2016 19:08
No, currently I have it set up in the OnCreate() function
Let me try that
Okay, that worked...Really appreciate the help!
Thank you @ne0fhyk
pablomar13
@pablomar13
Jul 08 2016 19:15
@all just a random question. Does someone has some experience linking OpenCV libraries to Android Studio?
Fredia Huya-Kouadio
@ne0fhyk
Jul 08 2016 19:16
@kalnir great to hear! If you get the time, do you mind updating the Dronekit-Android-Starter app with your example? I'm sure it would be useful to others as well!
@pablomar13 I think the Tower tracking_prototype branch makes use of the OpenCV libraries
kalnir
@kalnir
Jul 08 2016 19:18
Sure, will do :)
pablomar13
@pablomar13
Jul 08 2016 19:21
@ne0fhyk have you ever seen two different libs working together in one app. I need both 3.1.0 and 2.4.10 opencv libs in an app... Having trouble with the second module.
Fredia Huya-Kouadio
@ne0fhyk
Jul 08 2016 19:23
@pablomar13 no i haven't. they're bound to conflict with each other. Wouldn't the latter version be a superset of the earlier though?
pablomar13
@pablomar13
Jul 08 2016 19:24
No, because the new version has no HOG Cascade Classifier but it has the new Kalman Filter.
@ne0fhyk I need both.
And they conflict on the AIDL engine...
kalnir
@kalnir
Jul 08 2016 19:47
@ne0fhyk Another small follow-up question - /
I am able to receive and print out the message I need currently
Is there a direct way in which I can unpack() it into the msg_rc_channel_raw() message so I can access the values directly instead of parsing the string values?
Fredia Huya-Kouadio
@ne0fhyk
Jul 08 2016 19:51
@kalnir msg_rc_channel_raw extends the MavLinkMessage class, so you can cast the result from mavlinkMessageWrapper.getMavLinkMessage()
kalnir
@kalnir
Jul 08 2016 20:50
I'm not sure how exactly to do that...I tried a few ways but the message contents aren't transferring
TShapinsky
@TShapinsky
Jul 08 2016 21:01
msg_rc_channel_raw msg = (msg_rc_channel_raw) mavlinkMessageWrapper.getMavlinkMessage()
kalnir
@kalnir
Jul 08 2016 21:11
Thanks...! That's literally the most straightforward casting and the only kind I didn't try lol
TShapinsky
@TShapinsky
Jul 08 2016 21:12
You're too smart for your own good
kalnir
@kalnir
Jul 08 2016 21:14
Haha, hadn't had any luck with anything straightforward in the past
kalnir
@kalnir
Jul 08 2016 21:40
Will this MavlinkObserver approach also work for custom mavlink messages defined on Copter?
TShapinsky
@TShapinsky
Jul 08 2016 22:33
you may have to add your packet to the unpack function for MAVLinkPacket