### Crazyflie 2 body frame of reference

Posted:

**Wed Jul 29, 2020 5:41 am**I had assumed that the Crazyflie's body frame followed a standard right-hand rule coordinate system, with the positive x-axis pointing forward along the CF's longitudinal axis, the y-axis pointing left along the CF's lateral axis, and the z-axis pointing up, similar to the image below:

Similarly, I had also assumed that positive roll, pitch and yaw rotations were given by counter-clockwise rotations about the x, y and z axes respectively. However, after looking at some parts of the controller code, and how the final motor mixing is done, it seems that this is not the case. An example is the mixing of the pitch commands, in the powerDistribution() function, which indicates that a positive pitching moment causes the quadrotor to pitch its nose upwards. However, this is opposite to that assumed by the right-hand coordinate system given in the image above, which would have a positive pitch rotation being counter-clockwise about the y-axis, causing the Crazyflie to pitch its nose downwards. As such, it seems like there are two possibilities for how the Crazyflie's body frame is aligned:

1) If the body frame follows a standard right-hand coordinate system with x-axis forward, y-axis left, and z-axis up, then a positive pitch is being regarded as a clockwise rotation about the y-axis in the code, instead of the standard counter-clockwise rotation about axes that is assumed in right-hand coordinate systems

2) If we are using the right-hand thumb rule to consider rotations about axes, then if a positive pitch is being regarded as a counter-clockwise rotation about the y-axis in the code, then the y-axis must be pointing right instead of left. In this case we wouldn't have a standard right-hand coordinate system.

Instead of scratching my head for hours and working off potentially incorrect assumptions, I wanted to ask where I could find a document or online link that explains the Crazyflie's coordinate system in more detail. This would make development a lot easier, and would limit erroneous code due to incorrect coordinate system assumptions being made. Any help would be appreciated, thanks!

Similarly, I had also assumed that positive roll, pitch and yaw rotations were given by counter-clockwise rotations about the x, y and z axes respectively. However, after looking at some parts of the controller code, and how the final motor mixing is done, it seems that this is not the case. An example is the mixing of the pitch commands, in the powerDistribution() function, which indicates that a positive pitching moment causes the quadrotor to pitch its nose upwards. However, this is opposite to that assumed by the right-hand coordinate system given in the image above, which would have a positive pitch rotation being counter-clockwise about the y-axis, causing the Crazyflie to pitch its nose downwards. As such, it seems like there are two possibilities for how the Crazyflie's body frame is aligned:

1) If the body frame follows a standard right-hand coordinate system with x-axis forward, y-axis left, and z-axis up, then a positive pitch is being regarded as a clockwise rotation about the y-axis in the code, instead of the standard counter-clockwise rotation about axes that is assumed in right-hand coordinate systems

2) If we are using the right-hand thumb rule to consider rotations about axes, then if a positive pitch is being regarded as a counter-clockwise rotation about the y-axis in the code, then the y-axis must be pointing right instead of left. In this case we wouldn't have a standard right-hand coordinate system.

Instead of scratching my head for hours and working off potentially incorrect assumptions, I wanted to ask where I could find a document or online link that explains the Crazyflie's coordinate system in more detail. This would make development a lot easier, and would limit erroneous code due to incorrect coordinate system assumptions being made. Any help would be appreciated, thanks!