This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/Concept/Framework/modules/input/ir_sensor.h

70 lines
1.2 KiB
C
Raw Permalink Normal View History

2007-02-18 00:14:00 +00:00
#ifndef _IR_SENSOR_H
#define _IR_SENSOR_H
#include "../../defines.h"
#include "../../robot.h"
#include "sensor.h"
class IR_Sensor : public Sensor
{
public:
IR_Sensor()
{
this->parent = NULL;
this->moduleId = 0;
2007-02-22 13:12:03 +00:00
this->intensityCorrection = 0;
2007-02-18 00:14:00 +00:00
}
IR_Sensor(uint32 sensorId)
{
this->parent = NULL;
this->moduleId = sensorId;
2007-02-22 13:12:03 +00:00
this->intensityCorrection = 0;
2007-02-18 00:14:00 +00:00
switch(sensorId)
{
case IO_SENSOR_IR_0_DEG:
this->channel = 0;
break;
case IO_SENSOR_IR_30_DEG:
this->channel = 1;
break;
case IO_SENSOR_IR_60_DEG:
this->channel = 2;
break;
case IO_SENSOR_IR_100_DEG:
this->channel = 3;
2007-02-22 20:59:02 +00:00
this->intensityCorrection = 80;
2007-02-18 00:14:00 +00:00
break;
case IO_SENSOR_IR_180_DEG:
this->channel = 4;
2007-02-22 20:59:02 +00:00
this->intensityCorrection = 70;
2007-02-18 00:14:00 +00:00
break;
case IO_SENSOR_IR_260_DEG:
this->channel = 5;
2007-02-22 13:12:03 +00:00
this->intensityCorrection = 70;
2007-02-18 00:14:00 +00:00
break;
case IO_SENSOR_IR_300_DEG:
this->channel = 6;
break;
case IO_SENSOR_IR_330_DEG:
this->channel = 7;
break;
default:
this->channel = 8;
break;
}
}
protected:
//Hardware
uint8 channel;
2007-02-22 13:12:03 +00:00
uint8 intensityCorrection;
2007-02-18 00:14:00 +00:00
public:
uint16 GetIRIntensity();
};
#endif