Checks if there is an obstacle in front the robot.
More...
#include <obstacleCheckThread.h>
List of all members.
Detailed Description
Checks if there is an obstacle in front the robot.
- Author:
- Markus Knapp If there is an obstacle in front of the robot the robot ("forward"), the signal
- See also:
- obstacleDetected() will be emitted which contains the direction, where the obstacle is. e.g. OBSTACLEFRONTLEFT. If there is no obstacle, NONE is emitted. If there is no free way, OBSTACLESEVERYWHEREINFRONT is emitted. The signal
-
newDrivingAngleSet() with all some from the laserscanner is also emmited which shows where we should drive to. This for displaying them in the GUI.
Definition at line 49 of file obstacleCheckThread.h.
Constructor & Destructor Documentation
ObstacleCheckThread::~ObstacleCheckThread |
( |
| ) |
|
Member Function Documentation
double ObstacleCheckThread::calculateDriveThroughWidth |
( |
short int |
laserscanner, |
|
|
int |
alpha, |
|
|
float |
b, |
|
|
float |
c |
|
) |
| |
|
private |
Calculate the width of the estimated drive-trough direction/area with the 'Kosinussatz' (a² = b² + c² - 2bc * cos alpha) where 'a' is the width
- Parameters:
-
laserscanner | can be LASER1 or LASER2 |
alpha | is the angle |
b | is one length |
c | is the other length |
- Returns:
- width
Definition at line 633 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::init |
( |
| ) |
|
Init all important class members, get settings/parameters from laser or sensor thread.
Definition at line 73 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::message |
( |
QString |
text | ) |
|
|
signal |
Emits a info or error message to a slot. This slot can be used to display a text on a splash screen, log file, to print it to a console...
- Parameters:
-
text | is the message to be emitted |
void ObstacleCheckThread::newDrivingAngleSet |
( |
int |
largestFreeAreaStart, |
|
|
int |
largestFreeAreaEnd, |
|
|
int |
centerOfFreeWay, |
|
|
float |
width |
|
) |
| |
|
signal |
Emits a signal to set the angle where the robot can drive through.
- Parameters:
-
largestFreeAreaStart | is the start angle of the largest free area. |
largestFreeAreaEnd | is the end angle of the largest free area. |
centerOfFreeWay | is the center of the largest free area. |
width | of the estimated drive-trough area |
void ObstacleCheckThread::obstacleDetected |
( |
int |
sensors, |
|
|
QDateTime |
timestamp |
|
) |
| |
|
signal |
Emits a signal to the logical unit of
- See also:
- Direcs
- Parameters:
-
sensors | consists of the sum of all infrared and ultrasonic sensor numbers, which had an alarm. |
timestamp | is the timestmap when the signal was emitted. |
void ObstacleCheckThread::run |
( |
| ) |
|
|
virtual |
holds the first angle index
holds the last last angle index
this is for detecting the driving direction ("drive left" means "drive left from the middle of the laser")
- Todo:
- correct to reset the centerOfFreeway here?!?
Definition at line 116 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::setIgnoreArea |
( |
short int |
laser, |
|
|
int |
area, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
|
slot |
Set the laser area which will be ignored when checking for an obstacle.
- Parameters:
-
laser | is the number of the laser |
area | is the number of the area |
start | is the start angle in degrees |
end | is the end angle in degrees |
Definition at line 667 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::setMinObstacleDistance |
( |
int |
distance | ) |
|
|
slot |
This slot set the minimum distance, which the robot needs. Used by the infrared and ultra sonic sensors.
- Parameters:
-
Definition at line 649 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::setMinObstacleDistanceLaserFront |
( |
int |
distance | ) |
|
|
slot |
This slot set the minimum distance, which the robot needs. Used by the laser scanner. Has to be a seperate method because of the signal from the GUI slider for each laser!
- Parameters:
-
Definition at line 655 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::setMinObstacleDistanceLaserRear |
( |
int |
distance | ) |
|
|
slot |
This slot set the minimum distance, which the robot needs. Used by the laser scanner.
Has to be a seperate method because of the signal from the GUI slider for each laser!
- Parameters:
-
Definition at line 661 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::setPassageWidth |
( |
int |
width | ) |
|
|
slot |
This slot sets the width in centimeters (cm), where the robots has to fit through.
Definition at line 708 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::setSimulationMode |
( |
bool |
status | ) |
|
|
slot |
void ObstacleCheckThread::setStraightForwardDeviation |
( |
int |
deviation | ) |
|
|
slot |
This slot sets the deviation to 90 degrees when the robot drives forward. When the laser angle is 180 degrees, the middle is 90 degrees, at 270 degrees it's 135.
- Parameters:
-
deviation | is the angle in degrees. |
Definition at line 714 of file obstacleCheckThread.cpp.
void ObstacleCheckThread::stop |
( |
| ) |
|
void ObstacleCheckThread::systemerrorcatcher |
( |
int |
errorlevel | ) |
|
|
slot |
Member Data Documentation
int ObstacleCheckThread::actualFreeAreaEnd |
|
private |
int ObstacleCheckThread::actualFreeAreaStart |
|
private |
const int ObstacleCheckThread::AREA1 = 1 |
|
staticprivate |
const int ObstacleCheckThread::AREA2 = 2 |
|
staticprivate |
int ObstacleCheckThread::centerOfFreeWayFront |
|
private |
int ObstacleCheckThread::centerOfFreeWayRear |
|
private |
const int ObstacleCheckThread::CENTEROFLARGESTFREEWAY = 3 |
|
staticprivate |
QString ObstacleCheckThread::className |
|
private |
QList<int> ObstacleCheckThread::freeEndAreas |
|
private |
This stores the free areas after a scan. These will than be analysed and the "best" is chosen.
Definition at line 195 of file obstacleCheckThread.h.
QList<int> ObstacleCheckThread::freeStartAreas |
|
private |
const int ObstacleCheckThread::FREEWAY = 0 |
|
staticprivate |
This stores the free areas after a scan. These will than be analysed and the "best" is chosen.
the tags for the laser lines
- See also:
- Gui
Definition at line 198 of file obstacleCheckThread.h.
const int ObstacleCheckThread::IGNORETHIS = 4 |
|
staticprivate |
bool ObstacleCheckThread::initCompleted |
|
private |
const int ObstacleCheckThread::LARGESTFREEWAY = 2 |
|
staticprivate |
const short int ObstacleCheckThread::LASER1 = 1 |
|
staticprivate |
const short int ObstacleCheckThread::LASER2 = 2 |
|
staticprivate |
const short int ObstacleCheckThread::LASER3 = 4 |
|
staticprivate |
const short int ObstacleCheckThread::LASER4 = 8 |
|
staticprivate |
const short int ObstacleCheckThread::LASER5 = 16 |
|
staticprivate |
float ObstacleCheckThread::laserAngleFront |
|
private |
stores the laser resolution when getting the value from the laser thread
Definition at line 187 of file obstacleCheckThread.h.
float ObstacleCheckThread::laserAngleRear |
|
private |
stores the laser angle when getting the value from the laser thread
Definition at line 188 of file obstacleCheckThread.h.
float ObstacleCheckThread::laserResolutionFront |
|
private |
float ObstacleCheckThread::laserResolutionRear |
|
private |
stores the laser resolution when getting the value from the laser thread
Definition at line 186 of file obstacleCheckThread.h.
int ObstacleCheckThread::laserscannerFrontIgnoreArea1End |
|
private |
int ObstacleCheckThread::laserscannerFrontIgnoreArea1Start |
|
private |
int ObstacleCheckThread::laserscannerFrontIgnoreArea2End |
|
private |
int ObstacleCheckThread::laserscannerFrontIgnoreArea2Start |
|
private |
int ObstacleCheckThread::laserscannerRearIgnoreArea1End |
|
private |
int ObstacleCheckThread::laserscannerRearIgnoreArea1Start |
|
private |
int ObstacleCheckThread::laserscannerRearIgnoreArea2End |
|
private |
int ObstacleCheckThread::laserscannerRearIgnoreArea2Start |
|
private |
int ObstacleCheckThread::minObstacleDistance |
|
private |
int ObstacleCheckThread::minObstacleDistanceLaserFront |
|
private |
if the measured distance from a sensor is smaller than this value, than we have an obstacle! This is for the old infrared sensors.
Definition at line 164 of file obstacleCheckThread.h.
int ObstacleCheckThread::minObstacleDistanceLaserRear |
|
private |
if the measured distance from a sensor is smaller than this value, than we have an obstacle! This is for laser scanner 1.
Definition at line 165 of file obstacleCheckThread.h.
const short int ObstacleCheckThread::NONE = 0 |
|
staticprivate |
const int ObstacleCheckThread::OBSTACLE = 1 |
|
staticprivate |
const short int ObstacleCheckThread::OBSTACLEFRONTLEFT = 512 |
|
staticprivate |
const short int ObstacleCheckThread::OBSTACLEFRONTRIGHT = 1024 |
|
staticprivate |
const short int ObstacleCheckThread::OBSTACLESEVERYWHEREINFRONT = 2048 |
|
staticprivate |
int ObstacleCheckThread::robotSlotWidth |
|
private |
stores the laser angle when getting the value from the laser thread
Definition at line 190 of file obstacleCheckThread.h.
const short int ObstacleCheckThread::SENSOR1 = 1 |
|
staticprivate |
const short int ObstacleCheckThread::SENSOR16 = 256 |
|
staticprivate |
const short int ObstacleCheckThread::SENSOR2 = 2 |
|
staticprivate |
const short int ObstacleCheckThread::SENSOR3 = 4 |
|
staticprivate |
const short int ObstacleCheckThread::SENSOR4 = 8 |
|
staticprivate |
const short int ObstacleCheckThread::SENSOR5 = 16 |
|
staticprivate |
const short int ObstacleCheckThread::SENSOR6 = 32 |
|
staticprivate |
const short int ObstacleCheckThread::SENSOR7 = 64 |
|
staticprivate |
const short int ObstacleCheckThread::SENSOR8 = 128 |
|
staticprivate |
unsigned char ObstacleCheckThread::sensorValue |
|
private |
if the measured distance from a sensor is smaller than this value, than we have an obstacle! This is for laser scanner 2.
Definition at line 166 of file obstacleCheckThread.h.
this will contain the name of this class at runtime for debug messages
Definition at line 159 of file obstacleCheckThread.h.
bool ObstacleCheckThread::simulationMode |
|
private |
volatile bool ObstacleCheckThread::stopped |
|
private |
int ObstacleCheckThread::straightForwardDeviation |
|
private |
defines the minimum slot in centimeters (cm), where the robot has to fit through
Definition at line 192 of file obstacleCheckThread.h.
const unsigned long ObstacleCheckThread::THREADSLEEPTIME = 50 |
|
staticprivate |
The documentation for this class was generated from the following files: