Mambo state information


#1

The latest version of the firmware seems to be sending some new information. I’m parsing the packets and it is coming as a 2, 18 which is mini drone and NavigationDataState but then it is sending a 1 after that, which is not in minidrone.xml (that contains only a 0). Can you send an updated mini drone.xml? Thanks!!


Navigation data
#2

The updated xml will come with the next SDK release :slight_smile:


#3

Thanks. Looking forward to it. Do you know when that will be? Any chance you can tell me what it is sending? Is it just altitude or is it also sending orientation? I would really love to have all of the navigation data state.


#4

@Djavan I updated to the new SDK today and I can see that it is now sending the mambo’s x, y, and z speeds. But the new mini drone.xml file indicates that there is LOTS of other state information available included altitude, position, and a quaternion. However, it doesn’t seem to be sending that information. How do we get that information from the drone? It would be incredibly useful! Thanks!


#5

Hi,

In which version of the Mambo are you?
Quaternion and altitude are sent, but only after takeoff.
The position is not sent for the moment, it will certainly be in the future.

Regards,
Djavan


Navigation data
#6

@Djavan All three of my mambos are running the latest firmware (I checked for updates and they say none are needed). They are running 3.0.6. I just did a decently long flight and it never sends any position or altitude, only speed. Any ideas?


#7

@Djavan I wrote the code to handle all of the state information and I can confirm that only speed is being sent. Any ideas? I’m running the latest firmware. Help! Thanks!!


#8

Which events are you reading?

As soon as the Mambo (in version 4.0.6) is flying, it sends its speed, altitude and quaternion.
Here are the events that you should listent to:


#9

@Djavan I listen to all events coming back. Speed is the only one being sent. Altitude and Quaternion are not being sent. I have a generic listener that looks for every single message and then I handle them as they come. I’ve tried all 3 of my Mambos and none of them are sending anything except for speed.


#10

Well, I invite you to test with our samples to see that the Mambo does sent these events.

I’ve modified the iOS Samples to add this code and I see all three logs:

if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONEALTITUDE) && (elementDictionary != NULL))
    {
        ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
        ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
        HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
        if (element != NULL)
        {
            HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONEALTITUDE_ALTITUDE, arg);
            if (arg != NULL)
            {
                float altitude = arg->value.Float;
                NSLog(@"Test Altitude = %f", altitude);
            }
        }
    } else if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONESPEED) && (elementDictionary != NULL))
    {
        ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
        ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
        HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
        if (element != NULL)
        {
            HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONESPEED_SPEED_X, arg);
            float speed_x = arg->value.Float;

            HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONESPEED_SPEED_Y, arg);
            float speed_y = arg->value.Float;

            HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONESPEED_SPEED_Z, arg);

            float speed_z = arg->value.Float;

            NSLog(@"Test Speed = %f, %f, %f", speed_x, speed_y, speed_z);
        }
    } else if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONEQUATERNION) && (elementDictionary != NULL))
    {
        ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
        ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
        HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
        if (element != NULL)
        {
            HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONEQUATERNION_Q_W, arg);

            float q_w = arg->value.Float;

            HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONEQUATERNION_Q_X, arg);

            float q_x = arg->value.Float;

            HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONEQUATERNION_Q_Y, arg);

            float q_y = arg->value.Float;

            HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_MINIDRONE_NAVIGATIONDATASTATE_DRONEQUATERNION_Q_Z, arg);

            float q_z = arg->value.Float;

            NSLog(@"Test Quat = %f, %f, %f, %f", q_w, q_x, q_y, q_z);
        }
    }

#11

@Djavan I’m watching the raw stream of BLE send & receives and it sends battery and then (2, 18, 1). According to mini drone.xml, 2 is mini drone, 18 is NavigationDataState, and 1 is DroneSpeed. I never see a (2, 18, 2) or (2, 18, 4). 2 would be the altitude and 4 would be the quaternion.


#12

@Djavan Here is what I see from my code below. Code first:

mambo = Mambo(owletAddr, debug_level=0)

print "trying to connect"
success = mambo.connect(num_retries=3)
print "connected: %s" % success

print "sleeping"
mambo.smart_sleep(2)
print "taking off!"
mambo.safe_takeoff(5)

mambo.turn_degrees(90)
mambo.smart_sleep(2)
mambo.turn_degrees(-90)

mambo.smart_sleep(5)

#print "trying to flip left"                                                                                                                                       
success = mambo.flip(direction="left")
print "mambo flip result %s" % success

mambo.fly_direct(roll=0, pitch=0, yaw=0, vertical_movement=10, duration=1)
mambo.fly_direct(roll=0, pitch=0, yaw=0, vertical_movement=-10, duration=1)

mambo.fly_direct(roll=0, pitch=50, yaw=0, vertical_movement=0, duration=1)
mambo.fly_direct(roll=0, pitch=-50, yaw=0, vertical_movement=0, duration=1)
print "landing"
mambo.safe_land()

Then here is what I see in my results ( I didn’t show it all as it is long). But you see that it never sends anything in the 2/18 paradigm except for 1.
updating sensors with
(2, 1, 2, 3, 1, 0)
updating sensors with
(2, 2, 0, 30, 0, 0)
updating sensors with
(2, 3, 0, 5, 2, 0)
pdating sensors with
(2, 4, 0, 5, 3, 0)
updating sensors with
(2, 1, 2, 18, 1, 0)
updating sensors with
(2, 2, 2, 18, 1, 0)
updating sensors with
(2, 5, 2, 3, 1, 0)


#13

Hi, I just understood why we are not experiencing the same behavior. You are testing the Mambo without the camera whereas I’m using the Mambo + camera.

These two events (quaternion & altitude) are not sent when the Mambo has not the camera accessory.


#14

@Djavan I just tested with my camera and it didn’t change anything. I’m still only seeing speed. Also, why would the camera make any difference in the altitude and quaternion computations? Even had the camera made it work, I’d be begging for it to work without it.


#15

I should have mentionned Mambo with the camera, connected through Wifi.

The firmware team is currently evaluating sending those events without the camera, through BLE. I’ll let you know if they decided to do it or not.


Getting IMU values
#16

@Djavan So they are being sent via wifi? And not through BLE? I don’t currently listen for any events over wifi except for the camera (e.g. the RTSP stream). That was a failure on the Raspberry Pi as it can’t handle the 30 fps bandwidth so I stopped my camera development.


#17

@Djavan What protocol is it using to communicate on the wifi? The only data I’ve gotten from it is the RTSP vision. Is there a handshake? Also, what is the chance of sending it over BLE? That would be more consistent and reliable.

Thanks!


#18

Hi,

When the camera is plugged, you can access the mambo via the wifi interface like you would do for a Bebop (except that you use the mambo commands). Our samples provide support of the Mambo through either wifi or BLE with no code change outside of the SDK.

Regarding the commands only sent on wifi this is a design choice based on available bandwidth of the BLE connection. A discussion is ongoing with the firmware team to check whether we could still send those data on the BLE link, but with a reduced frequency, without harm on the “normal” user experience.

Regards,
Nicolas.


#19

@Nicolas Thanks. I will update my python library to handle either WIFI or BLE soon then. Right now it is entirely BLE. I’ve been working on my bebop library but that means I’m learning the protocols for WIFI so that should be an easy transition. Thanks. I only have one camera and 3 mambos so I was hoping things would work over BLE as well. I understand the low bandwidth of BLE though!


#20

@Nicolas and @Djavan I’ve got the wifi library started but I have a question: the handshake protocol says that I should be sending data to the mambo on port 6000 and I tell it that I want to hear data on port 43210 (I just used your example port).

This is what I send:
{“controller_type”: “computer”, “d2c_port”: 43210, “controller_name”: “pyparrot”}

This is what I get back:
{u’status’: 0, u’c2d_port’: 6000, u’c2d_user_port’: 21, u’c2d_update_port’: 51}

But I am not seeing anything on any port! I’ve tried putting listeners on all of the ports (43210, 21, and 51, all listed above) and I am literally seeing nothing. Have I misunderstood how it is working? The documentation on the protocols says that all the data should be coming back on the d2c_port.

Thanks!