void ETBalanceRunner::Run(int forward, int turn)\r
{\r
S8 r,l;\r
- balance_control(forward,turn,m_gyro.get(),m_gyrooffset,m_motorL.getCount(),m_motorR.getCount(),m_nxt.getBattMv(),&l,&r);\r
+ balance_control(forward,0,m_gyro.get(),m_gyrooffset,m_motorL.getCount(),m_motorR.getCount(),m_nxt.getBattMv(),&l,&r);\r
+ l = l + turn;\r
+ r = r - turn;\r
+ if(100 < l){\r
+ r = r + (l - 100);\r
+ l = 100;\r
+ }else if(r < -100){\r
+ l = l - (r - (-100));\r
+ r = -100;\r
+ }\r
m_motorL.setPWM(l);\r
m_motorR.setPWM(r);\r
}\r
}\r
void ETLineTracer::CalcOutput(int speed, int linepos, int& forward, int& turn)\r
{\r
- forward = speed * 3 / 10; // \82Æ\82è\82 \82¦\82¸\82Ì\8eÀ\91\95\r
+ forward = speed * 7 / 10; // \82Æ\82è\82 \82¦\82¸\82Ì\8eÀ\91\95\r
turn =static_cast<int>(m_pid.CalcControlValue(static_cast<float>(linepos)));\r
}\r