29 #include <QSocketNotifier>
31 #include <QSplashScreen>
33 #include <QtCore/QCoreApplication>
91 static void exitQt(
int sig)
96 QCoreApplication::quit();
117 Direcs(
bool bConsoleMode,
bool bForceSmallGUI,
bool bForceLargeGUI);
129 bool simulationMode()
const;
147 void drive(
const int command);
152 void increaseDrivingSpeed(
void);
161 void logicalUnit(
int sensorAlarm, QDateTime timestamp);
167 void faceTracking(
int faces,
int faceX,
int faceY,
int faceRadius);
173 void enableFaceTracking(
int state);
179 void showSensorData();
185 void showExitDialog();
192 void enableRemoteControlListening(
bool status);
197 void executeRemoteCommand(QString command);
204 void setNetworkState();
209 void executeJoystickCommand(
int axisNumber,
int axisValue);
210 void executeJoystickCommand(
int buttonNumber,
bool buttonState);
216 void setSimulationMode(
bool status);
222 void setDemoMode(
bool status);
227 void nextDemoPhase(
int phase);
232 void mediaPlayerFinished();
237 void showSplashMessage(QString text);
261 void systemerrorcatcher(
int errorlevel);
274 void showPreferredDirection(QString direction);
280 void publishConsoleMode(
bool state);
285 void showFaceTrackDirection(QString direction);
291 void look(QString direction);
297 void speak(QString text,
int phase=0);
307 void sendNetworkString(QString text);
317 void message(QString text,
bool CR=
true,
bool sayIt=
false,
bool addTimestamp=
true);
323 void splashMessage(QString text);
335 void checkArguments();
342 void resetDrivingSpeedTimer(
void);
349 void drivingLight(
unsigned char color);
357 #ifndef _ARM_ // only include on _non_ ARM environments!
362 #ifndef BUILDFORROBOT
367 #ifndef _ARM_ // only include on _non_ ARM environments!
449 static const unsigned int SPLASHTIME = 2000;
452 static const unsigned int DRIVINGSPEEDINCREASER = 10;
454 static const bool ON =
true;
455 static const bool OFF =
false;
458 static const int FORWARD = 10;
459 static const int BACKWARD = 20;
460 static const int LEFT = 30;
461 static const int RIGHT = 40;
462 static const int TURNLEFT = 50;
463 static const int TURNRIGHT = 60;
464 static const int START = 70;
465 static const int STOP = 80;
466 static const int WAIT = 90;
472 static const int SAME = 200;
473 static const int MOTOR1 = 210;
474 static const int MOTOR2 = 220;
475 static const int MOTOR3 = 230;
476 static const int MOTOR4 = 240;
477 static const int ALLMOTORS = 250;
479 static const int MOTOR1FW = 300;
480 static const int MOTOR1BW = 310;
481 static const int MOTOR1OFF = 320;
482 static const int MOTOR2FW = 330;
483 static const int MOTOR2BW = 340;
484 static const int MOTOR2OFF = 350;
485 static const int MOTOR3FW = 360;
486 static const int MOTOR3BW = 370;
487 static const int MOTOR3OFF = 380;
488 static const int MOTOR4FW = 390;
489 static const int MOTOR4BW = 400;
490 static const int MOTOR4OFF = 410;
492 static const int READ_AXIS_X = 500;
493 static const int READ_AXIS_Y = 510;
494 static const int READ_AXIS_Z = 520;
501 static const short int SENSOR1 = 1;
502 static const short int SENSOR2 = 2;
503 static const short int SENSOR3 = 4;
504 static const short int SENSOR4 = 8;
505 static const short int SENSOR5 = 16;
506 static const short int SENSOR6 = 32;
507 static const short int SENSOR7 = 64;
508 static const short int SENSOR8 = 128;
511 static const short int SENSOR16 = 256;
514 static const short int NONE = 0;
516 static const short int OBSTACLEFRONTLEFT = 512;
517 static const short int OBSTACLEFRONTRIGHT = 1024;
518 static const short int OBSTACLESEVERYWHEREINFRONT = 2048;
520 static const short int MAXFALSEALARMS = 2;
524 static const short int MOTORSENSOR1 = 0;
525 static const short int MOTORSENSOR2 = 1;
528 static const short int VOLTAGESENSOR1 = 0;
529 static const short int VOLTAGESENSOR2 = 1;
532 static const float MINIMUMVOLTAGE1 = 10.80;
533 static const float MINIMUMVOLTAGE2 = 21.60;
536 static const unsigned char NUMBEROFSERVOS = 6;
538 static const unsigned char SERVO1 = 0;
539 static const unsigned char SERVO2 = 1;
540 static const unsigned char SERVO3 = 2;
541 static const unsigned char SERVO4 = 3;
542 static const unsigned char SERVO5 = 4;
543 static const unsigned char SERVO6 = 5;
545 static const unsigned char SVSTART = 0;
546 static const unsigned char SVEND = 1;
547 static const unsigned char SVDEFAULT = 2;
548 static const unsigned char SVCURRENT = 3;
549 static const unsigned char SVMIN = 4;
550 static const unsigned char SVMAX = 5;
553 static const unsigned char NUMBEROFRGBLEDS = 6;
554 static const unsigned char RGBLED1 = 0;
555 static const unsigned char RGBLED2 = 1;
556 static const unsigned char RGBLED3 = 2;
557 static const unsigned char RGBLED4 = 3;
558 static const unsigned char RGBLED5 = 4;
559 static const unsigned char RGBLED6 = 5;
561 static const unsigned char RGBLEDDEFAULT = 0;
562 static const unsigned char RGBLEDACTUAL = 1;
563 static const unsigned char RGBLEDMIN = 2;
564 static const unsigned char RGBLEDMAX = 3;
565 static const int MINPWM = 1;
566 static const int MAXPWM = 99;
571 static const int JOYSTICKAXISY2 = 2;
572 static const int JOYSTICKAXISX3 = 3;
573 static const int JOYSTICKAXISX4 = 4;
574 static const int JOYSTICKAXISY5 = 5;
576 static const int JOYSTICKDIVISOR = 128;
581 static const short int LASER1 = 1;
582 static const short int LASER2 = 2;
583 static const short int LASER3 = 4;
584 static const short int LASER4 = 8;
585 static const short int LASER5 = 16;
590 static const int AREA1 = 1;
591 static const int AREA2 = 2;
596 static const unsigned char LEDOFF = 0;
597 static const unsigned char RED = 1;
598 static const unsigned char GREEN = 2;
599 static const unsigned char BLUE = 3;
600 static const unsigned char WHITE = 4;