From e219a623e77ff576d743dea1140a2af1e79c54b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Mon, 2 Sep 2024 10:39:10 +0200 Subject: [PATCH] Removed duplicated test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- tutorials/rotation.md | 104 ------------------------------------------ 1 file changed, 104 deletions(-) delete mode 100644 tutorials/rotation.md diff --git a/tutorials/rotation.md b/tutorials/rotation.md deleted file mode 100644 index 59eae34f2..000000000 --- a/tutorials/rotation.md +++ /dev/null @@ -1,104 +0,0 @@ -\page rotation Rotation example - -This example explains how to use quaternions and euler angles, and how to convert between them. - -## Compiling and running the code - -Go to `gz-math/examples` and use `cmake` to compile the code: - -```{.sh} -git clone https://github.com/gazebosim/gz-math/ -b gz-math7 -cd gz-math/examples -mkdir build -cd build -cmake .. -make -``` - -When the code is compiled, you can run two different examples, one which converts from quaternion to euler angles: - -```{.sh} -Usage: - ./quaternion_to_euler - -Example - ./quaternion_to_euler 0.5 0.5 0.5 0.5 -``` - -And the other which converts from euler to quaternion: - -```{.sh} -Usage (angles specified in radians): - quaternion_from_euler - -Example - quaternion_from_euler 0 0 1.57 -``` - -The ouput of each program, respectively: - -```{.sh} -./quaternion_to_euler 0.5 0.5 0.5 0.5 -Normalizing Quaternion components: - W 0.5 - X 0.5 - Y 0.5 - Z 0.5 -to - W 0.5 - X 0.5 - Y 0.5 - Z 0.5 - -Converting to Euler angles - roll 1.570796 radians - pitch -0.000000 radians - yaw 1.570796 radians - - roll 90.000000 degrees - pitch -0.000000 degrees - yaw 90.000000 degrees - -to Rotation matrix - 0.000000 0.000000 1.000000 - 1.000000 0.000000 0.000000 - 0.000000 1.000000 0.000000 -``` - -```{.sh} -./quaternion_from_euler 0 0 1.57 -Converting Euler angles: - roll 0.000000 radians - pitch 0.000000 radians - yaw 1.570000 radians - - roll 0.000000 degrees - pitch 0.000000 degrees - yaw 89.954374 degrees - -to Quaternion - W 0.707388 - X 0.000000 - Y 0.000000 - Z 0.706825 - -to Rotation matrix - 0.000796 -1.000000 0.000000 - 1.000000 0.000796 0.000000 - 0.000000 0.000000 1.000000 -``` - -## Code - -You can create some objects to express rotations: - -\snippet examples/quaternion_from_euler.cc constructor -\snippet examples/quaternion_to_euler.cc constructor - -To access the quaterions attributes: - -\snippet examples/quaternion_from_euler.cc access quaterion - -Or to acccess the rotation matrix elements: - -\snippet examples/quaternion_from_euler.cc rotation matrix