direcs  2012-09-30
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Direcs Class Reference

The main class of the whole robot programm. More...

#include <direcs.h>

Collaboration diagram for Direcs:

List of all members.

Public Slots

void drive (const int command)
void enableFaceTracking (int state)
void enableRemoteControlListening (bool status)
void executeJoystickCommand (int axisNumber, int axisValue)
void executeJoystickCommand (int buttonNumber, bool buttonState)
void executeRemoteCommand (QString command)
void faceTracking (int faces, int faceX, int faceY, int faceRadius)
void finishSplash ()
void increaseDrivingSpeed (void)
void logicalUnit (int sensorAlarm, QDateTime timestamp)
void mediaPlayerFinished ()
void nextDemoPhase (int phase)
void setDemoMode (bool status)
void setNetworkState ()
void setSimulationMode (bool status)
void showExitDialog ()
void showSensorData ()
void showSplashMessage (QString text)
void shutdown ()
void systemerrorcatcher (int errorlevel)
void test ()

Signals

void initCircuit ()
void look (QString direction)
void message (QString text, bool CR=true, bool sayIt=false, bool addTimestamp=true)
void publishConsoleMode (bool state)
void sendNetworkString (QString text)
void showFaceTrackDirection (QString direction)
void showPreferredDirection (QString direction)
void speak (QString text, int phase=0)
void splashMessage (QString text)

Public Member Functions

 Direcs (bool bConsoleMode, bool bForceSmallGUI, bool bForceLargeGUI)
void init ()
bool simulationMode () const
 ~Direcs ()

Public Attributes

bool exitDialog
bool noHardwareErrorMessages

Private Member Functions

void checkArguments ()
void drivingLight (unsigned char color)
void readSettings ()
void resetDrivingSpeedTimer (void)

Private Attributes

AboutDialogaboutDialog
 The joystick dialog.
QStringList arguments
 The splash screen text color.
bool cameraTestMode
CamThreadcamThread
Circuitcircuit1
 contains the list of command-line arguments
QString commaSeparator
ConsoleGuiconsoleGui
bool consoleMode
int currentPreferredDirection
 is enabled, when the robot is controlled via joystick and should use special mecanum wheel driving
int currentTestServo
bool demoMode
 A Phonon media player for e.g. playing a mp3 file.
DemoThreaddemoThread
QTimer * drivingSpeedTimer
bool endSpeedMotor1Reached
bool endSpeedMotor2Reached
bool endSpeedMotor3Reached
bool endSpeedMotor4Reached
bool eyeTestMode
bool faceTrackingIsEnabled
bool firstDataReceived
 Indicates if this program is the master and sends data from the robot over the network.
float floatValue
bool forceLargeGUI
 is enabled if the argument 'small' was passed by command-line. This will result in a startup with the small GUI - regardless of the hostname.
bool forceShutdown
bool forceSmallGUI
 is enabled if the argument 'console' was passed by command-line. Sends all GUI messages to the command line.
Guigui
Headhead
bool iAmTheMaster
 Stores the state, if the remote mode is enabled (control via LAN or joystick es enabled.
Inifileinifile1
InterfaceAvrinterface1
Joystickjoystick
JoystickDialogjoystickDialog
 The settings dialog.
int laserscannerAngleFront
int laserscannerAngleRear
bool laserScannerFrontFound
 if a camera is connected, but should not be used (just for testing, for a faster program start)
int laserscannerIgnoreAreaEnd
int laserscannerIgnoreAreaStart
QString laserscannerMounting
bool laserScannerRearFound
QString laserscannerTypeFront
QString laserscannerTypeRear
LaserThreadlaserThread
Logfilelogfile
int maximumSpeed
bool mecanumDriveMode
 is enabled, when the robot is controlled via joystick
Phonon::MediaObject * mediaObject
 A list of obstacle alarms that occured right the last n times.
int minimumSpeed
int mot1Speed
int mot2Speed
int mot3Speed
int mot4Speed
Motormotors
QMutex * mutex
NetworkThreadnetThread
unsigned int networkPortListen
 Indicates that network data were received already and we do not check if we are master or slave.
unsigned int networkPortSend
QList< QDateTime > obstacleAlarmFrontLeftList
 if true, we will use a small GUI for fitting on a small onboard TFT. By default this is decided by the local hostname of the system.
QList< QDateTime > obstacleAlarmFrontRightList
 A list of obstacle alarms that occured left the last n times.
ObstacleCheckThreadobstCheckThread
PlotThreadplotThread
 The about dialog.
int preferredDrivingDirection
RgbLedrgbLeds
bool robotDrives
bool robotRemoteMode
 Stores the robots simulation state.
bool robotSimulationMode
 Stores the robots driving state. TRUE, when the robot drives.
SensorThreadsensorThread
QString serialPortLaserscannerFront
QString serialPortLaserscannerRear
QString serialPortMicrocontroller
Servoservos
bool servoTestMode
SettingsDialogsettingsDialog
bool shutdownAlreadyCalled
 is enabled if the argument 'large' was passed by command-line. This will result in a startup with the large GUI - regardless of the hostname.
SpeakThreadspeakThread
QSplashScreen * splash
QColor splashTextColor
bool testDriveMode
TimerThreadtimerThread
bool useCamera
 if true, a logfile is written of all pgm messages (see ini-file)
bool useSmallGUI
 this is set to true, when no ini-file was found at startup. This make the program leave without the stupid AreYouSure-Question.
unsigned int value
bool writeLogFile

Static Private Attributes

static const int ALLMOTORS = 250
 Motor 4 back right.
static const int AREA1 = 1
static const int AREA2 = 2
static const int BACKWARD = 20
 Motor direction (formerly "clockwise")
static const unsigned char BLUE = 3
static const unsigned int DRIVINGSPEEDINCREASER = 10
 The time between one de/increase of the motor speed (to its minimum/maximum) and the next in ms.
static const int FORWARD = 10
 Some driving directions and motor directions for the robot.
static const unsigned char GREEN = 2
static const int JOYSTICKAXISX3 = 3
static const int JOYSTICKAXISX4 = 4
static const int JOYSTICKAXISY2 = 2
 this is analog to the value in microcontroller software
static const int JOYSTICKAXISY5 = 5
static const int JOYSTICKDIVISOR = 128
 Joystick conversion divisor. Converts the joystick axis value to the robot speed.
static const short int LASER1 = 1
static const short int LASER2 = 2
static const short int LASER3 = 4
static const short int LASER4 = 8
static const short int LASER5 = 16
static const unsigned char LEDOFF = 0
static const int LEFT = 30
 Motor direction (formerly "counterclockwise".
static const short int MAXFALSEALARMS = 2
static const int MAXPWM = 99
 this is analog to the value in microcontroller software
static const float MINIMUMVOLTAGE1 = 10.80
 The minimum voltages for an acoustic and optical alarm.
static const float MINIMUMVOLTAGE2 = 21.60
static const int MINPWM = 1
static const int MOTOR1 = 210
 Motor direction/power "same like before".
static const int MOTOR1BW = 310
static const int MOTOR1FW = 300
 used for letting the robot getting only one command for all motors (like 'forward all'). This is to reduce commands on the serial line.
static const int MOTOR1OFF = 320
static const int MOTOR2 = 220
 Motor 1 front left.
static const int MOTOR2BW = 340
static const int MOTOR2FW = 330
static const int MOTOR2OFF = 350
static const int MOTOR3 = 230
 Motor 2 front right.
static const int MOTOR3BW = 370
static const int MOTOR3FW = 360
static const int MOTOR3OFF = 380
static const int MOTOR4 = 240
 Motor 3 back left.
static const int MOTOR4BW = 400
static const int MOTOR4FW = 390
static const int MOTOR4OFF = 410
static const short int MOTORSENSOR1 = 0
 number of false alarms which are allowed in the logical unit
static const short int MOTORSENSOR2 = 1
static const short int NONE = 0
 Value, if no sensor has a value to react.
static const unsigned char NUMBEROFRGBLEDS = 6
 the RGB LED numbers
static const unsigned char NUMBEROFSERVOS = 6
static const short int OBSTACLEFRONTLEFT = 512
static const short int OBSTACLEFRONTRIGHT = 1024
static const short int OBSTACLESEVERYWHEREINFRONT = 2048
static const bool OFF = false
static const bool ON = true
static const int READ_AXIS_X = 500
static const int READ_AXIS_Y = 510
static const int READ_AXIS_Z = 520
static const unsigned char RED = 1
static const unsigned char RGBLED1 = 0
static const unsigned char RGBLED2 = 1
static const unsigned char RGBLED3 = 2
static const unsigned char RGBLED4 = 3
static const unsigned char RGBLED5 = 4
static const unsigned char RGBLED6 = 5
static const unsigned char RGBLEDACTUAL = 1
static const unsigned char RGBLEDDEFAULT = 0
 the possible rgbLed data
static const unsigned char RGBLEDMAX = 3
static const unsigned char RGBLEDMIN = 2
static const int RIGHT = 40
static const int SAME = 200
static const short int SENSOR1 = 1
static const short int SENSOR16 = 256
static const short int SENSOR2 = 2
static const short int SENSOR3 = 4
static const short int SENSOR4 = 8
static const short int SENSOR5 = 16
static const short int SENSOR6 = 32
static const short int SENSOR7 = 64
static const short int SENSOR8 = 128
static const unsigned char SERVO1 = 0
 the servo numbers
static const unsigned char SERVO2 = 1
static const unsigned char SERVO3 = 2
static const unsigned char SERVO4 = 3
static const unsigned char SERVO5 = 4
static const unsigned char SERVO6 = 5
static const unsigned int SPLASHTIME = 2000
 The splash screen time of view in ms.
static const int START = 70
static const int STOP = 80
static const unsigned char SVCURRENT = 3
static const unsigned char SVDEFAULT = 2
static const unsigned char SVEND = 1
static const unsigned char SVMAX = 5
static const unsigned char SVMIN = 4
static const unsigned char SVSTART = 0
 the possible servo data
static const int TURNLEFT = 50
static const int TURNRIGHT = 60
static const short int VOLTAGESENSOR1 = 0
 The voltage sensors.
static const short int VOLTAGESENSOR2 = 1
static const int WAIT = 90
static const unsigned char WHITE = 4

Detailed Description

The main class of the whole robot programm.

Author:
Markus Knapp All objects are created here. This method also starts the GUI and its splash screen.

Definition at line 108 of file direcs.h.


Constructor & Destructor Documentation

Direcs::Direcs ( bool  bConsoleMode,
bool  bForceSmallGUI,
bool  bForceLargeGUI 
)

The parameters are given from a main method which gets them from the console (startup arguments).

Todo:
install an event filter to grab CTRL+C
   \xrefitem todo 2.

Definition at line 114 of file direcs.cpp.

Here is the call graph for this function:

Direcs::~Direcs ( )

Definition at line 1901 of file direcs.cpp.


Member Function Documentation

void Direcs::checkArguments ( )
private

Checks the command-line arguments passed to the program.

Definition at line 5147 of file direcs.cpp.

Here is the call graph for this function:

void Direcs::drive ( const int  command)
slot

Instructs the robot to drive FORWARD, BACKWARD, LEFT, RIGHT, TURNLEFT and TURNRIGHT. The commands START, STOP or WAIT are also possible.

Parameters:
command

Definition at line 2466 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::drivingLight ( unsigned char  color)
private

Turns the driving light to RED, GREEN, BLUE, WHITE or LEDOFF.

Parameters:
color
Todo:
Move the drivingLight method to a better file/place.

Definition at line 5303 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::enableFaceTracking ( int  state)
slot

Enables or disables the face tracking. When activated, a face will be tracked by the camera.

Parameters:
statehas to be Qt::Checked to enable the detection. All other states disable.

Definition at line 2214 of file direcs.cpp.

Here is the caller graph for this function:

void Direcs::enableRemoteControlListening ( bool  state)
slot

Enables or disables the listening for the robot remote control. This slot is called from an event from the GUI (enable remote button).

Parameters:
status
Todo:
check if we still need the enableRemoteControlListening method

Definition at line 4144 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::executeJoystickCommand ( int  axisNumber,
int  axisValue 
)
slot

This slot executes commands from a connected joystick.

Todo:
check if this makes sense...
Todo:
check if this makes sense...
Todo:
check if this makes sense...
Todo:
check if this makes sense...
Todo:
check if this makes sense...
Todo:
check if this makes sense...
Todo:
check if this makes sense...
Todo:
check if this makes sense...

Definition at line 4373 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::executeJoystickCommand ( int  buttonNumber,
bool  buttonState 
)
slot
See also:
Gui::showJoystickButtons
Todo:
put button numbers to ini-file

Definition at line 4936 of file direcs.cpp.

Here is the call graph for this function:

void Direcs::executeRemoteCommand ( QString  command)
slot

This slot executes remote commands it receives via network (e.g. WLAN).

Todo:
add *master# string to ini-file

Definition at line 4208 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::faceTracking ( int  faces,
int  faceX,
int  faceY,
int  faceRadius 
)
slot

This method moves the camera and/or the robots eyes in the direction of a detected face.

See also:
camThread::faceDetected()

Definition at line 2227 of file direcs.cpp.

Here is the caller graph for this function:

void Direcs::finishSplash ( )
slot

Finishes the splash screen and displays the main window.

Definition at line 2014 of file direcs.cpp.

Here is the caller graph for this function:

void Direcs::increaseDrivingSpeed ( void  )
slot

Increases the driving speed to its maximum speed. This is used to have a smooth driveaway of the robot and works together with a timer.

increase interval is 10%.

Todo:
start with which minimumSpeed?

Definition at line 2865 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::init ( )

Initalises the complete program and robot. Conntect all signals and slots.

Todo:
put this at a nicer place // this is also shown in the about dialog
Todo:
not in use anymore! connect(this, SIGNAL(publishConsoleMode(bool)), gui, SLOT(setConsoleMode(bool)));
Todo:
implement signal forwarding for second laser!
Todo:
check if this is okay for the logfile writer in case of error TO FAST for logfile!!!
Todo:
start heartbeat thread and see, whats going on there! Also to do: define atmel code for an "heartbeat answer / action" !!!!!
           connect(camThread, SIGNAL( disableFaceDetection() ), gui, SLOT( disableFaceDetection() )); \xrefitem todo 8.
            connect(camThread, SIGNAL( disableCamera() ), gui, SLOT( disableCamera() )); \xrefitem todo 9.
Todo:
the signal for setting the camera angle
Todo:
the signal for resetting the camera angle
Todo:
nice exit point and error message
Todo:
put media filename or list somewehre else

Definition at line 225 of file direcs.cpp.

Here is the caller graph for this function:

void Direcs::initCircuit ( )
signal

Initialize the robots basic circuit.

Here is the caller graph for this function:

void Direcs::logicalUnit ( int  sensorAlarm,
QDateTime  timestamp 
)
slot

The locialUnit handles the behavior of the robot. This slot is called if an obstacle is detected from the obstacleCheckThread. It lets the robot "react" depending on which sensor made the alarm. The number of alarms are also counted. The class member preferredDrivingDirection is also set here and will be used when the robot gets the

See also:
drive() command START.
Parameters:
sensorAlarmconsists of the sum of all infrared and ultrasonic sensor numbers, which had an alarm or if we use a laser scanner, a value like OBSTACLEFRONTLEFT.
timestampis the timestmap when the signal was emitted.

Definition at line 2023 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::look ( QString  direction)
signal

This is for the robots head.

Parameters:
directionwhere to look can be LEFT, RIGHT...
void Direcs::mediaPlayerFinished ( )
slot

Restarts the mediaplayer because this Slot recevied the 'finished' Signal from the mediaplayer

same file again

Todo:
put media filename or list somewehre else

Definition at line 5244 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::message ( QString  text,
bool  CR = true,
bool  sayIt = false,
bool  addTimestamp = true 
)
signal

Emits a string to the GUI log / console.

See also:
Gui::appendLog()
Parameters:
textis the message to be emitted
CRis true when a CR/LF should be added at the end of the line (default)
sayItis true when the text for the log also should be spoken (default=false)
addTimestampIf true, the a timestamp is added in front of the text. This parameter is optional.

Here is the caller graph for this function:

void Direcs::nextDemoPhase ( int  phase)
slot

Enters the next demo phase and says some more text, drives around or whatever.

Definition at line 5158 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::publishConsoleMode ( bool  state)
signal

Let the other classes know if we are in the console mode (activated via command-line argument)

See also:
Gui::setConsoleMode()

Here is the caller graph for this function:

void Direcs::readSettings ( )
private

Reads all settings for the robot from an ini-file.

Todo:
add this: consoleGui->setLaserscannerAngle(LASER1, laserscanner...Front);
Todo:
gui->setLaserscannerAngle(LASER1, laserscanner...Front);
Todo:
add this: consoleGui->setLaserscannerAngle(LASER1, laserscanner...Front);
Todo:
gui->setLaserscannerAngle(LASER1, laserscanner...Front);
Todo:
add this: consoleGui->setLaserscannerAngle(LASER2, laserscanner...Rear);
Todo:
gui->setLaserscannerAngle(LASER1, laserscanner...Rear);
Todo:
add this: consoleGui->setLaserscannerAngle(LASER2, laserscanner...Rear);
Todo:
gui->setLaserscannerAngle(LASER1, laserscanner...Rear);

camThread->setCameraDevice(-2);

Todo:
kinect stuff

camThread->setCameraDevice(-2);

Todo:
kinect stuff
                                   camThread->setCameraDevice(cameraDevice); \xrefitem todo 28.

camThread->setCascadePath("none");

Todo:
kinect stuff

camThread->setCascadePath("none");

Todo:
kinect stuff

camThread->setCascadePath(haarClassifierCascade);

Todo:
kinect stuff
Todo:
kinect stuff

Definition at line 2932 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::resetDrivingSpeedTimer ( void  )
private

Resets the driving speed timer, so at the next drive command, the robots start with a smooth drive - not with maximum speed.

See also:
drive()
increaseDrivingSpeed()

Definition at line 2856 of file direcs.cpp.

void Direcs::sendNetworkString ( QString  text)
signal

Sends a string over the network.

Here is the caller graph for this function:

void Direcs::setDemoMode ( bool  status)
slot

This slot enables or disables the demo mode.

Parameters:
status

Definition at line 5205 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::setNetworkState ( )
slot

Sets the network state of this program. If it receives / received a 'master' strin form another direcs program, running on a robot, it sets this program to slave mode. Otherwise we will run in (normal) master mode.

Definition at line 4185 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::setSimulationMode ( bool  status)
slot

This slot enables or disables the simulation mode.

Parameters:
status

Definition at line 5082 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::showExitDialog ( )
slot

Shows the yes-no exit dialog for the main program. This slot is called when massive communication errors occur while talking to the robots interface!

Definition at line 1954 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::showFaceTrackDirection ( QString  direction)
signal

Shows the face tracking direction in a lable.

Here is the caller graph for this function:

void Direcs::showPreferredDirection ( QString  direction)
signal

Shows the preferred driving direction of the robot in the GUI

See also:
logicalUnit()

Here is the caller graph for this function:

void Direcs::showSensorData ( )
slot

Shows the sensor data in a graphical way (progressBars) and as a number in the GUI. This slot is called from the Signal sensorDataComplete from the sensorThread.

Definition at line 2380 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::showSplashMessage ( QString  text)
slot

Shows a text on the current splash screen.

Definition at line 1978 of file direcs.cpp.

Here is the caller graph for this function:

void Direcs::shutdown ( )
slot

Ends the programm, after asking "really?". Calls the destructor of this class, after saving settings and some other exit stuff.

Todo:
ask for exit on console!
Todo:
a universal quit-threads-method
Todo:
what, if the robote serial communication hangs here? timeout check?

Definition at line 1282 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Direcs::simulationMode ( ) const

Returns the status of the main program. True, if the simulationMode ist active.

Definition at line 5076 of file direcs.cpp.

void Direcs::speak ( QString  text,
int  phase = 0 
)
signal

Emits a speak signal. This signal is sent to the speakThread.

Parameters:
phaseis an optional value. This could be a special phase which could be returned when the speech ends or so.

Here is the caller graph for this function:

void Direcs::splashMessage ( QString  text)
signal

Emits a string to the splash screen.

Parameters:
textis the message to be emitted

Here is the caller graph for this function:

void Direcs::systemerrorcatcher ( int  errorlevel)
slot

This slot catches all signals from the signal

See also:
systemerror
Todo:
why stopping plot thread here?

Definition at line 5268 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Direcs::test ( )
slot

The method for the test button in the GUI.

Definition at line 5354 of file direcs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

AboutDialog* Direcs::aboutDialog
private

The joystick dialog.

Definition at line 360 of file direcs.h.

const int Direcs::ALLMOTORS = 250
staticprivate

Motor 4 back right.

Definition at line 477 of file direcs.h.

const int Direcs::AREA1 = 1
staticprivate

For the obstacleCheckThread

Definition at line 590 of file direcs.h.

const int Direcs::AREA2 = 2
staticprivate

Definition at line 591 of file direcs.h.

QStringList Direcs::arguments
private

The splash screen text color.

Definition at line 370 of file direcs.h.

const int Direcs::BACKWARD = 20
staticprivate

Motor direction (formerly "clockwise")

Definition at line 459 of file direcs.h.

const unsigned char Direcs::BLUE = 3
staticprivate

Definition at line 599 of file direcs.h.

bool Direcs::cameraTestMode
private

Definition at line 421 of file direcs.h.

CamThread* Direcs::camThread
private

Definition at line 383 of file direcs.h.

Circuit* Direcs::circuit1
private

contains the list of command-line arguments

Definition at line 372 of file direcs.h.

QString Direcs::commaSeparator
private

Definition at line 400 of file direcs.h.

ConsoleGui* Direcs::consoleGui
private

Definition at line 356 of file direcs.h.

bool Direcs::consoleMode
private

Definition at line 435 of file direcs.h.

int Direcs::currentPreferredDirection
private

is enabled, when the robot is controlled via joystick and should use special mecanum wheel driving

Definition at line 417 of file direcs.h.

int Direcs::currentTestServo
private

Definition at line 420 of file direcs.h.

bool Direcs::demoMode
private

A Phonon media player for e.g. playing a mp3 file.

Definition at line 446 of file direcs.h.

DemoThread* Direcs::demoThread
private

Definition at line 389 of file direcs.h.

const unsigned int Direcs::DRIVINGSPEEDINCREASER = 10
staticprivate

The time between one de/increase of the motor speed (to its minimum/maximum) and the next in ms.

Definition at line 452 of file direcs.h.

QTimer* Direcs::drivingSpeedTimer
private

Definition at line 401 of file direcs.h.

bool Direcs::endSpeedMotor1Reached
private

Definition at line 429 of file direcs.h.

bool Direcs::endSpeedMotor2Reached
private

Definition at line 430 of file direcs.h.

bool Direcs::endSpeedMotor3Reached
private

Definition at line 431 of file direcs.h.

bool Direcs::endSpeedMotor4Reached
private

Definition at line 432 of file direcs.h.

bool Direcs::exitDialog

Configures if an exit dialog should be shown, when exiting the main program.

Definition at line 139 of file direcs.h.

bool Direcs::eyeTestMode
private

Definition at line 419 of file direcs.h.

bool Direcs::faceTrackingIsEnabled
private

Definition at line 422 of file direcs.h.

bool Direcs::firstDataReceived
private

Indicates if this program is the master and sends data from the robot over the network.

Definition at line 408 of file direcs.h.

float Direcs::floatValue
private

Definition at line 434 of file direcs.h.

bool Direcs::forceLargeGUI
private

is enabled if the argument 'small' was passed by command-line. This will result in a startup with the small GUI - regardless of the hostname.

Definition at line 437 of file direcs.h.

bool Direcs::forceShutdown
private

Definition at line 439 of file direcs.h.

bool Direcs::forceSmallGUI
private

is enabled if the argument 'console' was passed by command-line. Sends all GUI messages to the command line.

Definition at line 436 of file direcs.h.

const int Direcs::FORWARD = 10
staticprivate

Some driving directions and motor directions for the robot.

For motor or robot "OFF"

See also:
Direcs::drive() [Slot]

Definition at line 458 of file direcs.h.

const unsigned char Direcs::GREEN = 2
staticprivate

Definition at line 598 of file direcs.h.

Gui* Direcs::gui
private

Definition at line 355 of file direcs.h.

Head* Direcs::head
private

Definition at line 386 of file direcs.h.

bool Direcs::iAmTheMaster
private

Stores the state, if the remote mode is enabled (control via LAN or joystick es enabled.

Definition at line 407 of file direcs.h.

Inifile* Direcs::inifile1
private

Definition at line 380 of file direcs.h.

InterfaceAvr* Direcs::interface1
private

Definition at line 373 of file direcs.h.

Joystick* Direcs::joystick
private

Definition at line 385 of file direcs.h.

const int Direcs::JOYSTICKAXISX3 = 3
staticprivate

Definition at line 572 of file direcs.h.

const int Direcs::JOYSTICKAXISX4 = 4
staticprivate

Definition at line 573 of file direcs.h.

const int Direcs::JOYSTICKAXISY2 = 2
staticprivate

this is analog to the value in microcontroller software

See also:
direcsSTM
Todo:
put axis numbers to ini-file Joystick axis numbers
See also:
Joystick()

Definition at line 571 of file direcs.h.

const int Direcs::JOYSTICKAXISY5 = 5
staticprivate

Definition at line 574 of file direcs.h.

JoystickDialog* Direcs::joystickDialog
private

The settings dialog.

Definition at line 359 of file direcs.h.

const int Direcs::JOYSTICKDIVISOR = 128
staticprivate

Joystick conversion divisor. Converts the joystick axis value to the robot speed.

Definition at line 576 of file direcs.h.

const short int Direcs::LASER1 = 1
staticprivate

For the laserThread

Definition at line 581 of file direcs.h.

const short int Direcs::LASER2 = 2
staticprivate

Definition at line 582 of file direcs.h.

const short int Direcs::LASER3 = 4
staticprivate

Definition at line 583 of file direcs.h.

const short int Direcs::LASER4 = 8
staticprivate

Definition at line 584 of file direcs.h.

const short int Direcs::LASER5 = 16
staticprivate

Definition at line 585 of file direcs.h.

int Direcs::laserscannerAngleFront
private

Definition at line 395 of file direcs.h.

int Direcs::laserscannerAngleRear
private

Definition at line 396 of file direcs.h.

bool Direcs::laserScannerFrontFound
private

if a camera is connected, but should not be used (just for testing, for a faster program start)

Definition at line 413 of file direcs.h.

int Direcs::laserscannerIgnoreAreaEnd
private

Definition at line 398 of file direcs.h.

int Direcs::laserscannerIgnoreAreaStart
private

Definition at line 397 of file direcs.h.

QString Direcs::laserscannerMounting
private

Definition at line 399 of file direcs.h.

bool Direcs::laserScannerRearFound
private

Definition at line 414 of file direcs.h.

QString Direcs::laserscannerTypeFront
private

Definition at line 393 of file direcs.h.

QString Direcs::laserscannerTypeRear
private

Definition at line 394 of file direcs.h.

LaserThread* Direcs::laserThread
private

Definition at line 382 of file direcs.h.

const unsigned char Direcs::LEDOFF = 0
staticprivate

The GUI LED colors. Also used for

See also:
drivingLight()

Definition at line 596 of file direcs.h.

const int Direcs::LEFT = 30
staticprivate

Motor direction (formerly "counterclockwise".

Definition at line 460 of file direcs.h.

Logfile* Direcs::logfile
private

Definition at line 387 of file direcs.h.

const short int Direcs::MAXFALSEALARMS = 2
staticprivate

Definition at line 520 of file direcs.h.

int Direcs::maximumSpeed
private

Definition at line 428 of file direcs.h.

const int Direcs::MAXPWM = 99
staticprivate

this is analog to the value in microcontroller software

See also:
direcsSTM

Definition at line 566 of file direcs.h.

bool Direcs::mecanumDriveMode
private

is enabled, when the robot is controlled via joystick

Definition at line 416 of file direcs.h.

Phonon::MediaObject* Direcs::mediaObject
private

A list of obstacle alarms that occured right the last n times.

Definition at line 445 of file direcs.h.

int Direcs::minimumSpeed
private

Definition at line 427 of file direcs.h.

const float Direcs::MINIMUMVOLTAGE1 = 10.80
staticprivate

The minimum voltages for an acoustic and optical alarm.

See also:
Gui::showVoltage

Definition at line 532 of file direcs.h.

const float Direcs::MINIMUMVOLTAGE2 = 21.60
staticprivate
Todo:
put min. voltage 1 in the ini-file

Definition at line 533 of file direcs.h.

const int Direcs::MINPWM = 1
staticprivate

Definition at line 565 of file direcs.h.

int Direcs::mot1Speed
private

Definition at line 423 of file direcs.h.

int Direcs::mot2Speed
private

Definition at line 424 of file direcs.h.

int Direcs::mot3Speed
private

Definition at line 425 of file direcs.h.

int Direcs::mot4Speed
private

Definition at line 426 of file direcs.h.

const int Direcs::MOTOR1 = 210
staticprivate

Motor direction/power "same like before".

Definition at line 473 of file direcs.h.

const int Direcs::MOTOR1BW = 310
staticprivate

Definition at line 480 of file direcs.h.

const int Direcs::MOTOR1FW = 300
staticprivate

used for letting the robot getting only one command for all motors (like 'forward all'). This is to reduce commands on the serial line.

Definition at line 479 of file direcs.h.

const int Direcs::MOTOR1OFF = 320
staticprivate

Definition at line 481 of file direcs.h.

const int Direcs::MOTOR2 = 220
staticprivate

Motor 1 front left.

Definition at line 474 of file direcs.h.

const int Direcs::MOTOR2BW = 340
staticprivate

Definition at line 483 of file direcs.h.

const int Direcs::MOTOR2FW = 330
staticprivate

Definition at line 482 of file direcs.h.

const int Direcs::MOTOR2OFF = 350
staticprivate

Definition at line 484 of file direcs.h.

const int Direcs::MOTOR3 = 230
staticprivate

Motor 2 front right.

Definition at line 475 of file direcs.h.

const int Direcs::MOTOR3BW = 370
staticprivate

Definition at line 486 of file direcs.h.

const int Direcs::MOTOR3FW = 360
staticprivate

Definition at line 485 of file direcs.h.

const int Direcs::MOTOR3OFF = 380
staticprivate

Definition at line 487 of file direcs.h.

const int Direcs::MOTOR4 = 240
staticprivate

Motor 3 back left.

Definition at line 476 of file direcs.h.

const int Direcs::MOTOR4BW = 400
staticprivate

Definition at line 489 of file direcs.h.

const int Direcs::MOTOR4FW = 390
staticprivate

Definition at line 488 of file direcs.h.

const int Direcs::MOTOR4OFF = 410
staticprivate

Definition at line 490 of file direcs.h.

Motor* Direcs::motors
private

Definition at line 376 of file direcs.h.

const short int Direcs::MOTORSENSOR1 = 0
staticprivate

number of false alarms which are allowed in the logical unit

The motor sensors

Definition at line 524 of file direcs.h.

const short int Direcs::MOTORSENSOR2 = 1
staticprivate

Definition at line 525 of file direcs.h.

QMutex* Direcs::mutex
mutableprivate

Definition at line 352 of file direcs.h.

NetworkThread* Direcs::netThread
private

Definition at line 381 of file direcs.h.

unsigned int Direcs::networkPortListen
private

Indicates that network data were received already and we do not check if we are master or slave.

Definition at line 409 of file direcs.h.

unsigned int Direcs::networkPortSend
private

Definition at line 410 of file direcs.h.

bool Direcs::noHardwareErrorMessages

Currently not in use...

Definition at line 134 of file direcs.h.

const short int Direcs::NONE = 0
staticprivate

Value, if no sensor has a value to react.

Definition at line 514 of file direcs.h.

const unsigned char Direcs::NUMBEROFRGBLEDS = 6
staticprivate

the RGB LED numbers

Definition at line 553 of file direcs.h.

const unsigned char Direcs::NUMBEROFSERVOS = 6
staticprivate
Todo:
put min. voltage 2 in the ini-file

The servos

Definition at line 536 of file direcs.h.

QList<QDateTime> Direcs::obstacleAlarmFrontLeftList
private

if true, we will use a small GUI for fitting on a small onboard TFT. By default this is decided by the local hostname of the system.

See also:
Gui::Gui()

Definition at line 441 of file direcs.h.

QList<QDateTime> Direcs::obstacleAlarmFrontRightList
private

A list of obstacle alarms that occured left the last n times.

Definition at line 442 of file direcs.h.

const short int Direcs::OBSTACLEFRONTLEFT = 512
staticprivate

Definition at line 516 of file direcs.h.

const short int Direcs::OBSTACLEFRONTRIGHT = 1024
staticprivate

Definition at line 517 of file direcs.h.

const short int Direcs::OBSTACLESEVERYWHEREINFRONT = 2048
staticprivate

Definition at line 518 of file direcs.h.

ObstacleCheckThread* Direcs::obstCheckThread
private

Definition at line 379 of file direcs.h.

const bool Direcs::OFF = false
staticprivate

For motor or robot "ON"

Definition at line 455 of file direcs.h.

const bool Direcs::ON = true
staticprivate

Definition at line 454 of file direcs.h.

PlotThread* Direcs::plotThread
private

The about dialog.

Definition at line 363 of file direcs.h.

int Direcs::preferredDrivingDirection
private

Definition at line 402 of file direcs.h.

const int Direcs::READ_AXIS_X = 500
staticprivate

Definition at line 492 of file direcs.h.

const int Direcs::READ_AXIS_Y = 510
staticprivate

Definition at line 493 of file direcs.h.

const int Direcs::READ_AXIS_Z = 520
staticprivate

Definition at line 494 of file direcs.h.

const unsigned char Direcs::RED = 1
staticprivate

Definition at line 597 of file direcs.h.

const unsigned char Direcs::RGBLED1 = 0
staticprivate
Todo:
also defined in rgbled.h !!!

Definition at line 554 of file direcs.h.

const unsigned char Direcs::RGBLED2 = 1
staticprivate

Definition at line 555 of file direcs.h.

const unsigned char Direcs::RGBLED3 = 2
staticprivate

Definition at line 556 of file direcs.h.

const unsigned char Direcs::RGBLED4 = 3
staticprivate

Definition at line 557 of file direcs.h.

const unsigned char Direcs::RGBLED5 = 4
staticprivate

Definition at line 558 of file direcs.h.

const unsigned char Direcs::RGBLED6 = 5
staticprivate

Definition at line 559 of file direcs.h.

const unsigned char Direcs::RGBLEDACTUAL = 1
staticprivate

Definition at line 562 of file direcs.h.

const unsigned char Direcs::RGBLEDDEFAULT = 0
staticprivate

the possible rgbLed data

Definition at line 561 of file direcs.h.

const unsigned char Direcs::RGBLEDMAX = 3
staticprivate

Definition at line 564 of file direcs.h.

const unsigned char Direcs::RGBLEDMIN = 2
staticprivate

Definition at line 563 of file direcs.h.

RgbLed* Direcs::rgbLeds
private

Definition at line 377 of file direcs.h.

const int Direcs::RIGHT = 40
staticprivate

Definition at line 461 of file direcs.h.

bool Direcs::robotDrives
private
See also:
logicalUnit

Definition at line 404 of file direcs.h.

bool Direcs::robotRemoteMode
private

Stores the robots simulation state.

Definition at line 406 of file direcs.h.

bool Direcs::robotSimulationMode
private

Stores the robots driving state. TRUE, when the robot drives.

Definition at line 405 of file direcs.h.

const int Direcs::SAME = 200
staticprivate

Definition at line 472 of file direcs.h.

const short int Direcs::SENSOR1 = 1
staticprivate

Give the sensors some names DONT CHANGE THIS NUMBERS! THEY ARE ALSO USED TO ADRESS THE ARRAY "iRSensorValue[]" !!

Definition at line 501 of file direcs.h.

const short int Direcs::SENSOR16 = 256
staticprivate

Definition at line 511 of file direcs.h.

const short int Direcs::SENSOR2 = 2
staticprivate

Definition at line 502 of file direcs.h.

const short int Direcs::SENSOR3 = 4
staticprivate

Definition at line 503 of file direcs.h.

const short int Direcs::SENSOR4 = 8
staticprivate

Definition at line 504 of file direcs.h.

const short int Direcs::SENSOR5 = 16
staticprivate

Definition at line 505 of file direcs.h.

const short int Direcs::SENSOR6 = 32
staticprivate

Definition at line 506 of file direcs.h.

const short int Direcs::SENSOR7 = 64
staticprivate

Definition at line 507 of file direcs.h.

const short int Direcs::SENSOR8 = 128
staticprivate

Definition at line 508 of file direcs.h.

SensorThread* Direcs::sensorThread
private
Todo:
Heartbeat *heartbeat;

Definition at line 375 of file direcs.h.

QString Direcs::serialPortLaserscannerFront
private

Definition at line 391 of file direcs.h.

QString Direcs::serialPortLaserscannerRear
private

Definition at line 392 of file direcs.h.

QString Direcs::serialPortMicrocontroller
private

Definition at line 390 of file direcs.h.

const unsigned char Direcs::SERVO1 = 0
staticprivate

the servo numbers

Todo:
also defined in servo.h !!!

Definition at line 538 of file direcs.h.

const unsigned char Direcs::SERVO2 = 1
staticprivate

Definition at line 539 of file direcs.h.

const unsigned char Direcs::SERVO3 = 2
staticprivate

Definition at line 540 of file direcs.h.

const unsigned char Direcs::SERVO4 = 3
staticprivate

Definition at line 541 of file direcs.h.

const unsigned char Direcs::SERVO5 = 4
staticprivate

Definition at line 542 of file direcs.h.

const unsigned char Direcs::SERVO6 = 5
staticprivate

Definition at line 543 of file direcs.h.

Servo* Direcs::servos
private

Definition at line 378 of file direcs.h.

bool Direcs::servoTestMode
private

Definition at line 418 of file direcs.h.

SettingsDialog* Direcs::settingsDialog
private

Definition at line 358 of file direcs.h.

bool Direcs::shutdownAlreadyCalled
private

is enabled if the argument 'large' was passed by command-line. This will result in a startup with the large GUI - regardless of the hostname.

Definition at line 438 of file direcs.h.

SpeakThread* Direcs::speakThread
private

Definition at line 384 of file direcs.h.

QSplashScreen* Direcs::splash
private

Definition at line 366 of file direcs.h.

QColor Direcs::splashTextColor
private

Definition at line 368 of file direcs.h.

const unsigned int Direcs::SPLASHTIME = 2000
staticprivate

The splash screen time of view in ms.

Definition at line 449 of file direcs.h.

const int Direcs::START = 70
staticprivate

Definition at line 464 of file direcs.h.

const int Direcs::STOP = 80
staticprivate

Definition at line 465 of file direcs.h.

const unsigned char Direcs::SVCURRENT = 3
staticprivate

Definition at line 548 of file direcs.h.

const unsigned char Direcs::SVDEFAULT = 2
staticprivate

Definition at line 547 of file direcs.h.

const unsigned char Direcs::SVEND = 1
staticprivate

Definition at line 546 of file direcs.h.

const unsigned char Direcs::SVMAX = 5
staticprivate

Definition at line 550 of file direcs.h.

const unsigned char Direcs::SVMIN = 4
staticprivate

Definition at line 549 of file direcs.h.

const unsigned char Direcs::SVSTART = 0
staticprivate

the possible servo data

Definition at line 545 of file direcs.h.

bool Direcs::testDriveMode
private

Definition at line 415 of file direcs.h.

TimerThread* Direcs::timerThread
private

Definition at line 388 of file direcs.h.

const int Direcs::TURNLEFT = 50
staticprivate

Definition at line 462 of file direcs.h.

const int Direcs::TURNRIGHT = 60
staticprivate

Definition at line 463 of file direcs.h.

bool Direcs::useCamera
private

if true, a logfile is written of all pgm messages (see ini-file)

Definition at line 412 of file direcs.h.

bool Direcs::useSmallGUI
private

this is set to true, when no ini-file was found at startup. This make the program leave without the stupid AreYouSure-Question.

Definition at line 440 of file direcs.h.

unsigned int Direcs::value
private

Definition at line 433 of file direcs.h.

const short int Direcs::VOLTAGESENSOR1 = 0
staticprivate

The voltage sensors.

Definition at line 528 of file direcs.h.

const short int Direcs::VOLTAGESENSOR2 = 1
staticprivate

Definition at line 529 of file direcs.h.

const int Direcs::WAIT = 90
staticprivate

Definition at line 466 of file direcs.h.

const unsigned char Direcs::WHITE = 4
staticprivate

Definition at line 600 of file direcs.h.

bool Direcs::writeLogFile
private

Definition at line 411 of file direcs.h.


The documentation for this class was generated from the following files: