Move to a GPS location error


#1

Product: Bebop 2
Product version: [4.4.2]
SDK version: [3.13.1]
Use of libARController: YES
SDK platform: Unix
Reproductible with the official app: Not tried

Hello,

I’m trying to use the command “Move to a location” (aRDrone3->sendPilotingMoveTo) on my Bebop 2.

The command is correctly sent and I catch the “Move to changed” event.
When using my Bebop 2, the status is always “ARCOMMANDS_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED_STATUS_ERROR”.

When using the Sphinx simulator, the command succeed with status “ARCOMMANDS_ARDRONE3_PILOTINGSTATE_MOVETOCHANGED_STATUS_DONE”.

The code is exactly the same between my Bebop 2 and the simulator; the only difference is the GPS coordinates given as arguments to the command.
Also I’m waiting for the flying state to be “hovering” before sending the command.

In which cases the MoveTo command can fail? Should I wait for other states before sending it?

Thanks.


#2

Hi,

Sorry for the delay in my answer.
Has your Bebop a gps fix? Is its magnetometer calibrated?


#3

Thanks for your reply, no worries for the delay :slight_smile:

I’m waiting for the GPS to be properly fixed but I don’t check the sensors states yet.
When I’m using the skycontroller 2 + the FreeFlight Pro app, the magnetometer and all others sensors are okay but I will add these checks in my code soon to be sure that the magnetometer is calibrated.


#4

Ok, so this should be ok.
How far is the location you set from the take off position?


#5

In fact the location I set is the takeoff position in latitude and longitude, and I add 1.5 meters to the altitude.


#6

And this works with the simulator but not with the real drone? They are in the same version?


#7

Yes it works with Sphinx and not in the real world.

My Bebop 2 firmware’s version is 4.4.2.

Concerning Sphinx I’m sure sure where to find the firmware version.
When launching Sphinx I have this message:

[Msg] Preparation of firmware http://plf.parrot.com/sphinx/firmwares/ardrone3/milos_pc/latest/images/ardrone3-milos_pc.ext2.zip

The return of fdc LIST instances:

meretricious_bellatrix[15846cf270a2d1971847171b565a30ee61afed8a]


#8

Ok, that’s tricky :wink:

Could you try to log these events:

And also please log what you are sending to the drone (with the parameters).
Thanks in advance,
Djavan


#9

Here the logs recorded on my Bebop 2 and on Sphinx: https://drive.google.com/open?id=15gPeuTtKW7uMoOTLkxYd4GbSO7I5_Lut

The scenario is the following:

  1. takeOff
  2. relativeMove (3 meters on the right)
  3. moveTo (to a custom home location)
  4. landing

Also I’ve noted a weird value concerning the argument altitude of the HomeLocationChanged event. It equals to -2 on both logs.
The custom home location is recorded after a valid (if I omit the altitude == -2) HomeLocationChanged event, and I add 1.5 meter to the altitude coordinate.

Thank you for your support.


#10

Okaaaaay ! Thanks a lot for these logs.

I think the problem is that the move to altitude is relative to the take off altitude, not above sea level.
It’s my fault, the command is wrongly documented, I’m really sorry about that.

The drone is actually refusing to do the move to because the target is higher than its own maximum altitude.
It is working on your simulator probably because its take off gps (i.e. above sea level) altitude is 0.

I’ll change the command documentation for the next release.


#11

Ah okay now I understand, I will change my altitude :smiley:

If the altitude is relative to the take off altitude, why the altitude returned by HomeLocationChanged is -2 and not 0? Is it safe to do a moveTo with the exact arguments returned by HomeLocationChanged for simulating a return to home?

Anyway, thanks a lot for you help!


#12

I don’t know why it is -2, but during a Return Home, I think the drone recomputes its own altitude relative to the ground to stop at around 2 meters from it.
I think it does not the same for the move to. So, no it is not safe.
Why do you want to simulate a return home and not actually do a return home?


#13

Okay, I tried it in Sphinx and the simulated drone crashed :sweat_smile:

I can’t use the real return to home because in my application the drone needs to come back above its take off point (around 3.5 meters).