33 #include "gtest/gtest.h"
69 float LLA[] = { 0, 0, 0 };
74 float eps = 0.000001f;
75 ASSERT_NEAR(0, Rne[0][0], eps);
76 ASSERT_NEAR(0, Rne[0][1], eps);
77 ASSERT_NEAR(1, Rne[0][2], eps);
79 ASSERT_NEAR(0, Rne[1][0], eps);
80 ASSERT_NEAR(1, Rne[1][1], eps);
81 ASSERT_NEAR(0, Rne[1][2], eps);
83 ASSERT_NEAR(-1, Rne[2][0], eps);
84 ASSERT_NEAR(0, Rne[2][1], eps);
85 ASSERT_NEAR(0, Rne[2][2], eps);
103 rpy[0] = 1; rpy[1] = 1; rpy[2] = 1;
108 for (
int i = 0;
i < 3;
i++) {
109 ASSERT_NEAR(rpy[
i], rpy_out[i], eps);
112 rpy[0] = 179; rpy[1] = 1; rpy[2] = 1;
117 for (
int i = 0;
i < 3;
i++) {
118 ASSERT_NEAR(rpy[
i], rpy_out[i], eps);
121 rpy[0] = 40; rpy[1] = 89; rpy[2] = 0;
126 for (
int i = 0;
i < 3;
i++) {
127 ASSERT_NEAR(rpy[
i], rpy_out[i], eps);
130 rpy[0] = 45; rpy[1] = 89; rpy[2] = 0;
135 for (
int i = 0;
i < 3;
i++) {
136 ASSERT_NEAR(rpy[
i], rpy_out[i], eps);
139 rpy[0] = -179; rpy[1] = -89; rpy[2] = 0;
144 for (
int i = 0;
i < 3;
i++) {
145 ASSERT_NEAR(rpy[
i], rpy_out[i], eps);
148 rpy[0] = 0; rpy[1] = -90; rpy[2] = 0;
153 for (
int i = 0;
i < 3;
i++) {
154 ASSERT_NEAR(rpy[
i], rpy_out[i], eps);
157 rpy[0] = 90; rpy[1] = -90; rpy[2] = 0;
162 for (
int i = 0;
i < 3;
i++) {
163 ASSERT_NEAR(rpy[
i], rpy_out[i], eps);
166 rpy[0] = -130; rpy[1] = -90; rpy[2] = 90;
171 ASSERT_NEAR(rpy[1], rpy_out[1], eps);
173 for (
float f = -179.5;
f < 179.5f;
f += 0.1f) {
174 rpy[0] =
f; rpy[1] = -90; rpy[2] = 0;
179 for (
int i = 0;
i < 3;
i++) {
180 ASSERT_NEAR(rpy[
i], rpy_out[i], eps);
TEST_F(RneFromLLATest, Equator)
void RPY2Quaternion(const float rpy[3], float q[4])
void RneFromLLA(float LLA[3], float Rne[3][3])
Header for Coordinate conversions library in coordinate_conversions.c.
void Quaternion2RPY(const float q[4], float rpy[3])