11 #include <gtest/gtest.h>
13 namespace etrobocon2018_test {
17 for(
int i = 0; i < kyori; i++) {
27 if(sub_degree < 0) angle_one = 3;
28 sub_degree = sub_degree / 90;
29 for(
int i = 0; i < 120 * std::abs(sub_degree); i++) {
35 TEST(SelfLocalizationTest, CalculateTest1)
45 TEST(SelfLocalizationTest, calculateBetweenEv3AndBorder1)
49 ASSERT_FLOAT_EQ(distance, 0.0);
52 TEST(SelfLocalizationTest, calculateBetweenEv3AndBorder2)
56 ASSERT_NEAR(distance, 7.809, 0.001);
59 TEST(SelfLocalizationTest, calculateBetweenEv3AndBorder3)
63 ASSERT_NEAR(distance, -0.83205, 0.001);
66 TEST(SelfLocalizationTest, calculateBetweenEv3AndBorder4)
70 ASSERT_NEAR(distance, 0.0, 0.001);
73 TEST(SelfLocalizationTest, calculateBetweenEv3AndBorder5)
77 ASSERT_NEAR(distance, 0.0, 0.001);
80 TEST(SelfLocalizationTest, calculateCurrentAngleTest1)
94 TEST(SelfLocalizationTest, calculateCurrentAngleTest2)
101 curve(sl, -45, l, r);
108 TEST(SelfLocalizationTest, calculateCurrentAngleTest3)
117 curve(sl, -90, l, r);
124 TEST(SelfLocalizationTest, isOverNormalVectorTest1)
131 TEST(SelfLocalizationTest, isOverNormalVectorTest2)
138 TEST(SelfLocalizationTest, isOverNormalVectorTest3)
145 TEST(SelfLocalizationTest, isOverNormalVectorTest4)
void straight(SelfLocalization &sl, int kyori, int &l, int &r)
void init_normal_vector(float _start_x, float _start_y, float _goal_x, float _goal_y, float _current_x, float _current_y)
void curve(SelfLocalization &sl, float sub_degree, int &l, int &r)
TEST(AIAnswerArrayTest, construct)
void update(std::int32_t left_motor_sl, std::int32_t right_motor_sl)
float calculate_between_ev3_and_border(float _start_x, float _start_y, float _goal_x, float _goal_y, float _current_x, float _current_y)
void calculate_current_angle()
bool is_over_normal_vector(float _current_x, float _current_y)