11 Pid(0.2, 0.5, 0.0, 30.0),
16 for(
int i = 0; i < 25; i++) speed_value[i] = 0;
28 speed_value[speedCount] = speed_value_thistime;
32 if(speedCount >= 25) speedCount = 0;
33 forward += (pid_value - pid_value_old) / 10;
34 pid_value_old = pid_value;
41 float distance4msFloat = 0.0;
45 = ((2 * 3.14 * 81) / 360.0) * (float)(curAngleL - preAngleL);
47 = ((2 * 3.14 * 81) / 360.0) * (float)(curAngleR - preAngleR);
48 distance4msFloat = (distance4msL + distance4msR) / 2.0;
51 preAngleL = curAngleL;
52 preAngleR = curAngleR;
54 distance4ms = (int)distance4msFloat;
void calculate(double light_value)
std::int8_t calcDistance4ms(std::int32_t curAngleL, std::int32_t curAngleR)
std::int32_t calculateSpeedForPid(std::int32_t curAngleL, std::int32_t curAngleR)
std::int16_t speed_value_all
double limitOutput(double pid_value)
std::int16_t getSpeed100ms()