diff --git a/src/C++/Driver/src/CKobuki.cpp b/src/C++/Driver/src/CKobuki.cpp index b581725..4c27fe9 100755 --- a/src/C++/Driver/src/CKobuki.cpp +++ b/src/C++/Driver/src/CKobuki.cpp @@ -589,21 +589,21 @@ long CKobuki::loop(void *user_data, TKobukiData &Kobuki_data) { -// povie kobukimu ze ma ist niekolko metrov dopredu alebo dozadu, rozhoduje znamienko -// funkcia kompenzuje chodenie rovno pomocou regulatora, interne vyuziva setArcSpeed a -// ako spatnu vazbu pouziva data z enkoderov +// tells the kobuki to go a few meters forward or backward, the sign decides +// the function compensates for walking straight with the controller, internally it uses setArcSpeed and +// uses encoder data as feedback void CKobuki::goStraight(long double distance){ - long double u_translation = 0; // riadena velicina, rychlost robota pri pohybe - long double w_translation = distance; // pozadovana hodnota + long double u_translation = 0; // controlled magnitude, speed of the robot in motion + long double w_translation = distance; // requested value - // parametre regulatora + // controller parameters long double Kp_translation = 4500; long double e_translation = 0; int upper_thresh_translation = 600; int lower_thresh_translation = 40; int translation_start_gain = 20; - long double u_rotation = 0; // riadena velicina + long double u_rotation = 0; // controlled magnitude long double w_rotation = 0; long double Kp_rotation = 57; long double e_rotation = 0; @@ -613,7 +613,7 @@ void CKobuki::goStraight(long double distance){ theta = 0; long i = 5; - + //send command and hold until robot reaches point while (fabs(x - w_translation) > 0.005 && xsetArcSpeed(u_translation, u_rotation); - usleep(25*1000); // increment starting speed i = i + translation_start_gain; } @@ -705,8 +704,7 @@ void CKobuki::doRotation(long double th) { } } - std::cout << "stop the fuck!" << std::endl; - // usleep(25*1000); + std::cout << "Rotation done" << std::endl; this->setRotationSpeed(0); usleep(25*1000); } diff --git a/src/C++/Driver/src/main.cpp b/src/C++/Driver/src/main.cpp index a12d8b9..d922d69 100644 --- a/src/C++/Driver/src/main.cpp +++ b/src/C++/Driver/src/main.cpp @@ -36,7 +36,7 @@ int movement() if (text == 1) { - robot.goStraight(10); + robot.goStraight(1); } else if (text == 2) {