mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
movement test
This commit is contained in:
@@ -9,19 +9,27 @@ CKobuki robot;
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
unsigned char * null_ptr(0);
|
unsigned char * null_ptr(0);
|
||||||
|
int text;
|
||||||
robot.startCommunication("/dev/ttyUSB0", true, null_ptr);
|
robot.startCommunication("/dev/ttyUSB0", true, null_ptr);
|
||||||
usleep(1*1000*1000);
|
usleep(1*1000*1000);
|
||||||
|
cout << "Enter commando";
|
||||||
robot.goStraight(1);
|
cin >> text;
|
||||||
|
if (text == 1) {
|
||||||
|
robot.goStraight(10);
|
||||||
|
}
|
||||||
|
if (text == 2) {
|
||||||
|
robot.doRotation(90);
|
||||||
|
}
|
||||||
|
if (text == 3) {
|
||||||
|
robot.doRotation(90);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cout << "no text specified";
|
||||||
|
}
|
||||||
|
|
||||||
usleep(30*1000*1000);
|
usleep(30*1000*1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int checkCenterCliff() {
|
int checkCenterCliff() {
|
||||||
while(true) {
|
while(true) {
|
||||||
std::cout << "cliffsensordata:" << robot.data.CliffSensorCenter << std::endl;
|
std::cout << "cliffsensordata:" << robot.data.CliffSensorCenter << std::endl;
|
||||||
|
Reference in New Issue
Block a user