|
@@ -58,7 +58,7 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (right_roll_vec.size() > 9 && left_roll_vec.size() > 9)
|
|
|
+ if (right_roll_vec.size() > 1 && left_roll_vec.size() > 1)
|
|
|
{
|
|
|
int right_dist = right_roll_vec.back() - right_roll_vec.front();
|
|
|
|
|
@@ -69,11 +69,11 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
|
|
|
if (right_dist > 2000 || left_dist > 2000)
|
|
|
{
|
|
|
std::cout << "right_dist : " << right_dist << " left_dist :" << left_dist << endl;
|
|
|
- if (right_dist > left_dist + 500)
|
|
|
+ if (right_dist > left_dist)
|
|
|
{
|
|
|
right_cmd = MOTION_RIGHT;
|
|
|
}
|
|
|
- else if (left_dist > right_dist + 500)
|
|
|
+ else
|
|
|
{
|
|
|
left_cmd = MOTION_LEFT;
|
|
|
}
|
|
@@ -86,12 +86,14 @@ void RunGame::Process(int time_stamp, int* right_pos, int* right_att, int* right
|
|
|
if (left_cmd != last_left_cmd && left_cmd == MOTION_LEFT)
|
|
|
{
|
|
|
result[0] = MOTION_LEFT;
|
|
|
+ std::cout << " result[0] = MOTION_LEFT;" << endl;
|
|
|
}
|
|
|
|
|
|
result[1] = -1;
|
|
|
if (right_cmd != last_right_cmd && right_cmd == MOTION_RIGHT)
|
|
|
{
|
|
|
result[1] = MOTION_RIGHT;
|
|
|
+ std::cout << " result[1] = MOTION_RIGHT;" << endl;
|
|
|
}
|
|
|
|
|
|
last_left_cmd = left_cmd;
|