Auterion / px4-ros2-interface-lib

Library to interface with PX4 from a companion computer using ROS 2
BSD 3-Clause "New" or "Revised" License
39 stars 13 forks source link

examples: use geometry utils #23

Closed GuillaumeLaine closed 5 months ago

GuillaumeLaine commented 5 months ago

Changes

Side-node on euler angles

Rotation conventions

Some euler angle convention choices (details here):

Interesting result

@bkueng you were correct. Given a rotation R s.t.:

R = R_z * R_y * R_x 

with R_x, R_y, R_z rotations along X, Y, Z axes respectively. Then R corresponds to euler angles respecting both of the following rotation conventions:

GuillaumeLaine commented 5 months ago

@bkueng I double checked, the code works as documented and is consistent with the PX4 matrix lib (we're using 3-2-1 intrinsic euler angles).

My only concern now is that the naming quaternionToEulerRpy is confusing, seeing as rpy <-> ypr depends on the intrinsic/extrinsic convention used. Do you think we should remove the Rpy from the function name and have people refer to the docstring? I'm not sure quaternionToEulerRpyExtrinsic is helpful, I wonder if people generally know about these conventions.

bkueng commented 5 months ago

I think it still adds some value, as it describes the order of the vector elements.