SmartVehicle-Basis
SmartFactory
LineDetector Class Reference

Class LineDetector handels the Line detection-System. More...

#include <LineDetector.h>

Public Member Functions

 LineDetector (const int sensorPin_0, const int sensorPin_1, const int sensorPin_2, const int sensorPin_3, const int sensorPin_4)
 Construct a new Line Detector object. More...
 
const int deviation ()
 Recognise deviation from vehicle to line. More...
 

Private Attributes

const int pSensorPinLL
 Pin Sensor Far Left. More...
 
const int pSensorPinL
 Pin Sensor Left. More...
 
const int pSensorPinM
 Pin Sensor Middle. More...
 
const int pSensorPinR
 Pin Sensor Right. More...
 
const int pSensorPinRR
 Pin Sensor Far Right. More...
 
int pSensorLL
 Value Sensor Far Left. More...
 
int pSensorL
 Value Sensor Left. More...
 
int pSensorM
 Value Sensor Middle. More...
 
int pSensorR
 Value Sensor Right. More...
 
int pSensorRR
 Value Sensor Far Right. More...
 

Detailed Description

Class LineDetector handels the Line detection-System.

Definition at line 24 of file LineDetector.h.

Constructor & Destructor Documentation

◆ LineDetector()

LineDetector::LineDetector ( const int  sensorPin_0,
const int  sensorPin_1,
const int  sensorPin_2,
const int  sensorPin_3,
const int  sensorPin_4 
)

Construct a new Line Detector object.

Parameters
sensorPin_0- Pin Sensor Far Left
sensorPin_1- Pin Sensor Left
sensorPin_2- Pin Sensor Middle
sensorPin_3- Pin Sensor Right
sensorPin_4- Pin Sensor Far Right

Definition at line 17 of file LineDetector.cpp.

Member Function Documentation

◆ deviation()

const int LineDetector::deviation ( )

Recognise deviation from vehicle to line.

  • -10 Degree turn left
  • 10 Degree turn right
  • 180 full Line detected
  • 200 Line Lost or ErrorValues
  • 4 Line is on the right side
  • 0 Line is in the middle
  • -4 Line is on the left side
Returns
const int - deviation from middle sensor
Todo:
Use some Matrix Bit Magic for more efficency
Todo:
Improve handling in case of error of impossible sensor values

Definition at line 34 of file LineDetector.cpp.

Member Data Documentation

◆ pSensorPinLL

const int LineDetector::pSensorPinLL
private

Pin Sensor Far Left.

Definition at line 56 of file LineDetector.h.

◆ pSensorPinL

const int LineDetector::pSensorPinL
private

Pin Sensor Left.

Definition at line 57 of file LineDetector.h.

◆ pSensorPinM

const int LineDetector::pSensorPinM
private

Pin Sensor Middle.

Definition at line 58 of file LineDetector.h.

◆ pSensorPinR

const int LineDetector::pSensorPinR
private

Pin Sensor Right.

Definition at line 59 of file LineDetector.h.

◆ pSensorPinRR

const int LineDetector::pSensorPinRR
private

Pin Sensor Far Right.

Definition at line 60 of file LineDetector.h.

◆ pSensorLL

int LineDetector::pSensorLL
private

Value Sensor Far Left.

Definition at line 62 of file LineDetector.h.

◆ pSensorL

int LineDetector::pSensorL
private

Value Sensor Left.

Definition at line 63 of file LineDetector.h.

◆ pSensorM

int LineDetector::pSensorM
private

Value Sensor Middle.

Definition at line 64 of file LineDetector.h.

◆ pSensorR

int LineDetector::pSensorR
private

Value Sensor Right.

Definition at line 65 of file LineDetector.h.

◆ pSensorRR

int LineDetector::pSensorRR
private

Value Sensor Far Right.

Definition at line 66 of file LineDetector.h.


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