# Take-Off and Land command each fly to xy=[0,0] location instead of on the spot

Source: https://forum.modalai.com/topic/3344/take-off-and-land-command-each-fly-to-xy-0-0-location-instead-of-on-the-spot
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Tags: px4
Posted: 2024-04-19 15:04:58 UTC by LaborzaubererTHI
Replies: 5 · Views: 2646

## LaborzaubererTHI · 2024-04-19 15:04:58 UTC

Dear developers, 

while connected to PX4 instance over MavSDK, using the python environment, we initiate the take-off and land command. 
But instead of the commands being executed on the spot, meaning where the drone is, the drones fly towards its xy=[0,0] location while executing the respectively command. So instead of flying vertical each time, they actually fly diagonal. 

More detailed description: 
Drone position at [1, 0, 0]. 
Command takeoff. 
Offboard to setpoint [-2,0]. 
Command land. 

April tag #0 is set to “unknown” and no other tag specified. 

Result: 
Took off and flew diagonal to location: NED = [0, 0, -1.5].
Flew backwards to [-2,0,-1.5] as commanded in offboard mode.
Land command led to a diagonal land flight at [0,0] location, where it initialy took off from.

Expected: 
Take-off and land command would lead to vertical flight at the xy-location where it was when initiated.

The flight can be seen here: https://www.youtube.com/watch?v=Trz97csbsz0

Our example is very close to your example offboard_position_ned2.py found here: 
https://gitlab.com/voxl-public/voxl-docker-images/voxl-docker-mavsdk-python/-/blob/master/offboard_position_ned2.py?ref_type=heads

From testing PX4 within an gazebo environment, we did not expect such a behavior. 

Regards
LabMag

Drone: RB5
System-image: 1.7.1-M0052-14.1a-perf-nightly-20231025
Kernel:       #1 SMP PREEMPT Thu Oct 26 05:24:02 UTC 2023 4.19.125
hw version:   M0052
voxl-suite:   1.1.2

## Reply by wilkinsaf · 2024-04-19 16:02:42 UTC

@LaborzaubererTHI 

What coordinate frame are you using?

## Reply by LaborzaubererTHI · 2024-04-22 06:33:39 UTC (in reply to wilkinsaf)

@wilkinsaf 

We are connected to the drone via MavSDK. We booted the drone at the [0,0] location. Carried it forwards to [1,0] and send the takeoff and land commands via MavSDK. 
Due to the fact that I think we are connected to PX4 I suspect we are using its coordinate system. 

Regards.

## Reply by LaborzaubererTHI · 2024-04-22 12:44:34 UTC (in reply to LaborzaubererTHI)

@wilkinsaf 
@LaborzaubererTHI 

How would one go about using the different coordinate systems? All of our code is currently running on an external computer, not on the drone. [Question might need separate thread].

## Reply by Eric Katzfey (ModalAI staff) · 2024-04-22 16:02:25 UTC (in reply to LaborzaubererTHI)

@LaborzaubererTHI Sounds like it may be similar to: https://forum.modalai.com/topic/2533/failsafe-landing-bug-in-px4-1-14/19?_=1713800679314

## Reply by LaborzaubererTHI · 2024-04-23 07:17:12 UTC (in reply to Eric Katzfey)

@Eric-Katzfey said in [Take\-Off and Land command each fly to xy=[0,0] location instead of on the spot](/post/16461):
> @LaborzaubererTHI Sounds like it may be similar to: https://forum.modalai.com/topic/2533/failsafe-landing-bug-in-px4-1-14/19?_=1713800679314

Indeed it does.
