Copter X-Y-Z - Which is which?


I’m trying to figure out which axis is X on the copter. I’ve been looking around at the code but I couldn’t find any real reference.
Specifically, guided_set_velocity() receives a velocity vector - Which velocity points to which direction?

Also, do the XYZ axis change with the compass orientation? Or are they constant?



As far as I found out, the axis are:
+X - Front
-X - Back
+Y - Right
-Y - Left
+Z - Up
-Z - Down



I’m sorry but I was wrong. So for whoever reads this:
Ardupilot uses NED (North - East - Down) frame of reference. See this:

Copy pasted what’s important:
NED Coordinate System:

  • The x axis is aligned with the vector to the north pole (tangent to meridians).
  • The y axis points to the east side (tangent to parallels)
  • The z axis points to the center of the earth

There is also Body Fixed Frame:
Body Fixed Frame (Attached to the aircraft)

  • The x axis points in forward (defined by geometry and not by movement) direction. (= roll axis)
  • The y axis points to the right (geometrically) (= pitch axis)
  • The z axis points downwards (geometrically) (= yaw axis)

In order to convert from Body Frame to NED what you need to call this function:

copter.rotate_body_frame_to_NE(vel_vector.x, vel_vector.y);



Is there another way to convert body frame to NED frame?

Because, I am using Python and Dronekit to control arducopter.
Is there any way to control movement of arducopter based on body frame. Like x will point forward, z will point downward or upward and y will be left or right.

Hey I was looking for exactly this. And i Got a simple question . why do we have to convert Body frame to NED. I mean why can’t we just get the gps error and feed it into the gyro. why are these conversations are necessary ?

Kishan, because NED is fixed to the map. Body frame is fixed to Vehicle body. And Vehicle can turn.

If I can understand it correctly, the only situation when NED and Body frame is same is when

  • NED frame is Local NED frame (relative to Home position → 0,0,0 is at Home position
  • Vehicle points to the North and is at Home position

Body frame needs to be translated to NED Frame.

Somebody may correct me if I got something wrong.