jjshoots / PyFlyt

UAV Flight Simulator for Reinforcement Learning Research
https://taijunjet.com/PyFlyt/documentation.html
MIT License
97 stars 18 forks source link

Clarification of Coordinate Systems in Documentation #63

Open defrag-bambino opened 3 days ago

defrag-bambino commented 3 days ago

Hi,

I am trying to deploy a learned controller from PyFlyt onto a real quadcopter running Ardupilot. As far as I can tell these two use different coordinate system conventions. Namely: PyFlyt uses ENU (which means on the body of the drone its forward is X, to the left is Y and up is Z; Ardupilot uses NED (i.e. forward X, right Y and Z down). Is this correct thus far? Also, I am unsure about the direction of rotation for yaw pitch roll in PyFlyt. Looking at the illustration provided in the paper, which way is a positive roll for example? image Ideally, the image containing this information should provided in the documentation.

Thanks!

jet-sony commented 3 days ago

Hi, admitttedly, even I had an issue with different axis convention when trying to deploy agents onto real quadcopters (PX4, Crazyflie, and Ardupilot all use different conventions).

PyFlyt used ENU / FLU:

Ardupilot uses NED / FRD:

Rotation conventions always follow right hand thumb rule, this is the standard regardless of NED/ENU: image

Therefore, for PyFlyt (Front X) and Ardupilot (Front X), roll positive would be facing-forwards-clockwise. However, in PyFlyt (Left Y), pitching positive would be pitching downwards; in Ardupilot (Right Y), pitching positive would be pitching upwards.

Hope this clarifies things!

defrag-bambino commented 9 hours ago

Thanks! What is the range for the rotations? Are they in [0, pi] or [-pi/2, pi/2] or [0,1] ...?

jjshoots commented 8 hours ago

[-pi, pi].