diff options
author | masterm <devnull@localhost> | 2007-02-15 21:33:05 +0100 |
---|---|---|
committer | masterm <devnull@localhost> | 2007-02-15 21:33:05 +0100 |
commit | 91b2508dc92a97802353bd2e96f2849c835f0b2a (patch) | |
tree | afd641c692dbe1acd46a5d194302ae66879fe81d /source/Concept | |
parent | 8d7053ca84a48fe63736b1ae6225624da7b9be44 (diff) | |
download | rc2007-soccer-91b2508dc92a97802353bd2e96f2849c835f0b2a.tar rc2007-soccer-91b2508dc92a97802353bd2e96f2849c835f0b2a.zip |
+++ many updates to sources
Diffstat (limited to 'source/Concept')
-rw-r--r-- | source/Concept/Framework/Concept.vcproj | 72 | ||||
-rw-r--r-- | source/Concept/Framework/defines.h | 38 | ||||
-rw-r--r-- | source/Concept/Framework/distance_sensor.cpp | 1 | ||||
-rw-r--r-- | source/Concept/Framework/distance_sensor.h | 27 | ||||
-rw-r--r-- | source/Concept/Framework/engine.h | 102 | ||||
-rw-r--r-- | source/Concept/Framework/io_module.h | 1 | ||||
-rw-r--r-- | source/Concept/Framework/ir_sensor.cpp | 9 | ||||
-rw-r--r-- | source/Concept/Framework/ir_sensor.h | 62 | ||||
-rw-r--r-- | source/Concept/Framework/kicker.cpp | 1 | ||||
-rw-r--r-- | source/Concept/Framework/kicker.h | 84 | ||||
-rw-r--r-- | source/Concept/Framework/led.cpp | 1 | ||||
-rw-r--r-- | source/Concept/Framework/led.h | 65 | ||||
-rw-r--r-- | source/Concept/Framework/main.cpp | 45 | ||||
-rw-r--r-- | source/Concept/Framework/robot.cpp | 80 | ||||
-rw-r--r-- | source/Concept/Framework/robot.h | 2 | ||||
-rw-r--r-- | source/Concept/Framework/sensor.h | 12 | ||||
-rw-r--r-- | source/Concept/Framework/stdafx.h | 4 |
17 files changed, 579 insertions, 27 deletions
diff --git a/source/Concept/Framework/Concept.vcproj b/source/Concept/Framework/Concept.vcproj index fd22f8d..1348191 100644 --- a/source/Concept/Framework/Concept.vcproj +++ b/source/Concept/Framework/Concept.vcproj @@ -201,6 +201,78 @@ </File>
</Filter>
</Filter>
+ <Filter
+ Name="Led"
+ Filter="">
+ <Filter
+ Name="Source Files"
+ Filter="">
+ <File
+ RelativePath=".\led.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="">
+ <File
+ RelativePath=".\led.h">
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Distance_Sensor"
+ Filter="">
+ <Filter
+ Name="Source Files"
+ Filter="">
+ <File
+ RelativePath=".\distance_sensor.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="">
+ <File
+ RelativePath=".\distance_sensor.h">
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="IR_Sensor"
+ Filter="">
+ <Filter
+ Name="Source Files"
+ Filter="">
+ <File
+ RelativePath=".\ir_sensor.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="">
+ <File
+ RelativePath=".\ir_sensor.h">
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Kicker"
+ Filter="">
+ <Filter
+ Name="Source Files"
+ Filter="">
+ <File
+ RelativePath=".\kicker.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="">
+ <File
+ RelativePath=".\kicker.h">
+ </File>
+ </Filter>
+ </Filter>
</Filter>
<Filter
Name="Hardware Interface"
diff --git a/source/Concept/Framework/defines.h b/source/Concept/Framework/defines.h index 9eac05d..15e6c35 100644 --- a/source/Concept/Framework/defines.h +++ b/source/Concept/Framework/defines.h @@ -55,12 +55,8 @@ #define uint64 unsigned int64
#endif
-//Sensor types
-enum SensorTypes
-{
- SENSOR_TYPE_ANALOG,
- SENSOR_TYPE_DIGITAL,
-};
+//Constants
+#define SPEED_PER_PWM 1
//IO Module Names
enum IOModuleNames
@@ -74,18 +70,42 @@ enum IOModuleNames IO_ENGINE_DRIVE_LEFT = IO_ENGINE_START,
IO_ENGINE_DRIVE_RIGHT,
IO_ENGINE_DRIVE_BACK,
+ IO_ENGINE_DRIBBLER,
IO_ENGINE_END,
+
+ //Kicker
+
+ IO_KICKER_START = IO_ENGINE_END,
+
+ IO_KICKER_MAIN = IO_KICKER_START,
+
+ IO_KICKER_END,
//Sensors
- IO_SENSOR_START = IO_ENGINE_END,
+ IO_SENSOR_START = IO_KICKER_END,
- IO_SENSOR_MOUSE = IO_SENSOR_START,
+ IO_SENSOR_IR_0_DEG = IO_SENSOR_START,
+ IO_SENSOR_IR_30_DEG,
+ IO_SENSOR_IR_60_DEG,
+ IO_SENSOR_IR_100_DEG,
+ IO_SENSOR_IR_180_DEG,
+ IO_SENSOR_IR_260_DEG,
+ IO_SENSOR_IR_300_DEG,
+ IO_SENSOR_IR_330_DEG,
IO_SENSOR_END,
+ //Leds
+
+ IO_LED_START = IO_SENSOR_END,
+
+ IO_LED_MAIN = IO_LED_START,
+
+ IO_LED_END,
+
//General
- IO_END = IO_SENSOR_END,
+ IO_END = IO_LED_END,
};
#endif diff --git a/source/Concept/Framework/distance_sensor.cpp b/source/Concept/Framework/distance_sensor.cpp new file mode 100644 index 0000000..a11460c --- /dev/null +++ b/source/Concept/Framework/distance_sensor.cpp @@ -0,0 +1 @@ +#include "distance_sensor.h"
\ No newline at end of file diff --git a/source/Concept/Framework/distance_sensor.h b/source/Concept/Framework/distance_sensor.h new file mode 100644 index 0000000..7690ab4 --- /dev/null +++ b/source/Concept/Framework/distance_sensor.h @@ -0,0 +1,27 @@ +#ifndef _DISTANCE_SENSOR_H
+#define _DISTANCE_SENSOR_H
+
+//#include "stdafx.h"
+#include "sensor.h"
+
+class Distance_Sensor : public Sensor
+{
+public:
+ Distance_Sensor()
+ {
+ this->parent = NULL;
+ this->moduleId = 0;
+ }
+
+ Distance_Sensor(uint32 sensorId)
+ {
+ this->parent = NULL;
+ this->moduleId = sensorId;
+ }
+
+protected:
+
+public:
+};
+
+#endif diff --git a/source/Concept/Framework/engine.h b/source/Concept/Framework/engine.h index 2736a7a..6454a32 100644 --- a/source/Concept/Framework/engine.h +++ b/source/Concept/Framework/engine.h @@ -9,20 +9,105 @@ public: Engine()
{
this->enabled = false;
+ this->curSpeed = 0;
this->parent = NULL;
+ this->moduleId = 0;
+ this->hardwarePort = NULL;
+ this->pwmSpeed = NULL;
+ this->pwmPort = NULL;
+ this->pinForward = 0;
+ this->pinReverse = 0;
+ this->pinPwm = 0;
}
Engine(uint32 engineId)
{
this->enabled = false;
+ this->curSpeed = 0;
this->parent = NULL;
this->moduleId = engineId;
+ this->pwmSpeed = NULL;
+ this->pwmPort = NULL;
+ this->pinPwm = 0;
+
+ switch(engineId)
+ {
+ case IO_ENGINE_DRIVE_LEFT:
+ this->hardwarePort = &PORTB;
+ this->pwmSpeed = &OCR1A;
+ this->pinForward = (1 << 0);
+ this->pinReverse = (1 << 1);
+ break;
+ case IO_ENGINE_DRIVE_RIGHT:
+ this->hardwarePort = &PORTB;
+ this->pwmSpeed = &OCR1B;
+ this->pinForward = (1 << 2);
+ this->pinReverse = (1 << 3);
+ break;
+ case IO_ENGINE_DRIVE_BACK:
+ this->hardwarePort = &PORTD;
+ this->pwmSpeed = &OCR3A;
+ this->pinForward = (1 << 5);
+ this->pinReverse = (1 << 4);
+ break;
+ case IO_ENGINE_DRIBBLER:
+ this->hardwarePort = &PORTD;
+ this->pwmPort = &PORTA;
+ this->pinForward = (1 << 6);
+ this->pinReverse = (1 << 7);
+ this->pinPwm = (1 << 5);
+ break;
+ default:
+ this->hardwarePort = NULL;
+ this->pwmSpeed = NULL;
+ this->pinForward = 0;
+ this->pinReverse = 0;
+ break;
+ }
+
+ *this->pwmSpeed = 0;
}
protected:
bool enabled;
float curSpeed;
+ //Hardware
+ volatile uint8* hardwarePort;
+ volatile uint16* pwmSpeed;
+ uint8 pinForward;
+ uint8 pinReverse;
+ //Dribbler only
+ volatile uint8* pwmPort;
+ uint8 pinPwm;
+
+ void UpdateDirection()
+ {
+ if(enabled)
+ {
+ if(curSpeed > 0)
+ {
+ *hardwarePort |= pinForward;
+ *hardwarePort &= ~pinReverse;
+ }
+ else if(curSpeed < 0)
+ {
+ *hardwarePort |= pinReverse;
+ *hardwarePort &= ~pinForward;
+ }
+ else
+ {
+ *hardwarePort |= pinForward;
+ *hardwarePort |= pinReverse;
+ }
+ }
+ else
+ {
+ *hardwarePort &= ~pinForward;
+ *hardwarePort &= ~pinReverse;
+ }
+ }
+
public:
float GetSpeed()
{
@@ -32,6 +117,21 @@ public: void SetSpeed(float newSpeed)
{
curSpeed = newSpeed;
+
+ if(pwmSpeed)
+ {
+ *pwmSpeed = uint16(abs(newSpeed / SPEED_PER_PWM));
+ }
+ else if(pwmPort && uint16(abs(newSpeed / SPEED_PER_PWM)))
+ {
+ *pwmPort |= pinPwm;
+ }
+ else if(pwmPort)
+ {
+ *pwmPort &= ~pinPwn;
+ }
+
+ UpdateDirection();
}
bool GetEnabled()
@@ -42,6 +142,8 @@ public: void SetEnabled(bool newStatus)
{
enabled = newStatus;
+
+ UpdateDirection();
}
};
diff --git a/source/Concept/Framework/io_module.h b/source/Concept/Framework/io_module.h index af5d611..f1fecd3 100644 --- a/source/Concept/Framework/io_module.h +++ b/source/Concept/Framework/io_module.h @@ -11,6 +11,7 @@ public: IO_Module()
{
this->parent = NULL;
+ this->moduleId = 0;
}
IO_Module(uint32 moduleId)
diff --git a/source/Concept/Framework/ir_sensor.cpp b/source/Concept/Framework/ir_sensor.cpp new file mode 100644 index 0000000..065143e --- /dev/null +++ b/source/Concept/Framework/ir_sensor.cpp @@ -0,0 +1,9 @@ +#include "ir_sensor.h"
+
+//-----------------------------------------------------------------------------
+uint16 IR_Sensor::GetIRIntensity()
+{ + if(!parent) return 0;
+
+ return parent->GetADCValue(channel);
+}
\ No newline at end of file diff --git a/source/Concept/Framework/ir_sensor.h b/source/Concept/Framework/ir_sensor.h new file mode 100644 index 0000000..f267644 --- /dev/null +++ b/source/Concept/Framework/ir_sensor.h @@ -0,0 +1,62 @@ +#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;
+ }
+
+ IR_Sensor(uint32 sensorId)
+ {
+ this->parent = NULL;
+ this->moduleId = sensorId;
+
+ 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;
+ break;
+ case IO_SENSOR_IR_180_DEG:
+ this->channel = 4;
+ break;
+ case IO_SENSOR_IR_260_DEG:
+ this->channel = 5;
+ 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;
+
+public:
+ uint16 GetIRIntensity();
+};
+
+#endif diff --git a/source/Concept/Framework/kicker.cpp b/source/Concept/Framework/kicker.cpp new file mode 100644 index 0000000..94bd711 --- /dev/null +++ b/source/Concept/Framework/kicker.cpp @@ -0,0 +1 @@ +#include "kicker.h"
\ No newline at end of file diff --git a/source/Concept/Framework/kicker.h b/source/Concept/Framework/kicker.h new file mode 100644 index 0000000..fa9718e --- /dev/null +++ b/source/Concept/Framework/kicker.h @@ -0,0 +1,84 @@ +#ifndef _KICKER_H
+#define _KICKER_H
+
+#include "stdafx.h"
+
+class Kicker : public IO_Module
+{
+public:
+ Kicker()
+ {
+ this->enabled = false;
+ this->parent = NULL;
+ this->moduleId = 0;
+ this->portPower = NULL;
+ this->portForward = NULL;
+ this->portReverse = NULL;
+ this->pinPower = 0;
+ this->pinForward = 0;
+ this->pinReverse = 0;
+ }
+
+ Kicker(uint32 kickerId)
+ {
+ this->enabled = false;
+ this->parent = NULL;
+ this->moduleId = kickerId;
+
+ switch(kickerId)
+ {
+ case IO_KICKER_MAIN:
+ this->portPower = &PORTG;
+ this->portForward = &PORTA;
+ this->portReverse = &PORTE;
+ this->pinPower = (1 << 3);
+ this->pinForward = (1 << 2);
+ this->pinReverse = (1 << 6);
+ break;
+ default:
+ this->portPower = NULL;
+ this->portForward = NULL;
+ this->portReverse = NULL;
+ this->pinPower = 0;
+ this->pinForward = 0;
+ this->pinReverse = 0;
+ break;
+ }
+
+ *this->portForward |= this->pinForward;
+ *this->portReverse &= ~this->pinReverse;
+ }
+
+protected:
+ bool enabled;
+
+ //Hardware
+ volatile uint8* portPower;
+ volatile uint8* portForward;
+ volatile uint8* portReverse;
+ uint8 pinPower;
+ uint8 pinForward;
+ uint8 pinReverse;
+
+public:
+ bool GetEnabled()
+ {
+ return enabled;
+ }
+
+ void SetEnabled(bool newStatus)
+ {
+ enabled = newStatus;
+
+ if(enabled)
+ {
+ *portPower |= pinPower;
+ }
+ else
+ {
+ *portPower &= ~pinPower;
+ }
+ }
+};
+
+#endif diff --git a/source/Concept/Framework/led.cpp b/source/Concept/Framework/led.cpp new file mode 100644 index 0000000..a81aaf4 --- /dev/null +++ b/source/Concept/Framework/led.cpp @@ -0,0 +1 @@ +#include "led.h"
\ No newline at end of file diff --git a/source/Concept/Framework/led.h b/source/Concept/Framework/led.h new file mode 100644 index 0000000..f0f3982 --- /dev/null +++ b/source/Concept/Framework/led.h @@ -0,0 +1,65 @@ +#ifndef _LED_H
+#define _LED_H
+
+#include "stdafx.h"
+
+class Led : public IO_Module
+{
+public:
+ Led()
+ {
+ this->enabled = false;
+ this->parent = NULL;
+ this->moduleId = 0;
+ this->hardwarePort = NULL;
+ this->pinPower = 0;
+ }
+
+ Led(uint32 ledId)
+ {
+ this->enabled = false;
+ this->parent = NULL;
+ this->moduleId = ledId;
+
+ switch(ledId)
+ {
+ case IO_LED_MAIN:
+ this->hardwarePort = &PORTB;
+ this->pinPower = (1 << 1);
+ break;
+ default:
+ this->hardwarePort = NULL;
+ this->pinPower = 0;
+ break;
+ }
+ }
+
+protected:
+ bool enabled;
+
+ //Hardware
+ volatile uint8* hardwarePort;
+ uint8 pinPower;
+
+public:
+ bool GetEnabled()
+ {
+ return enabled;
+ }
+
+ void SetEnabled(bool newStatus)
+ {
+ enabled = newStatus;
+
+ if(enabled)
+ {
+ *hardwarePort &= ~pinPower;
+ }
+ else
+ {
+ *hardwarePort |= pinPower;
+ }
+ }
+};
+
+#endif diff --git a/source/Concept/Framework/main.cpp b/source/Concept/Framework/main.cpp index cf80770..d6e1d92 100644 --- a/source/Concept/Framework/main.cpp +++ b/source/Concept/Framework/main.cpp @@ -13,26 +13,51 @@ int main() newEngine = NULL;
}
+ //Init Kicker
+ for(uint8 i = IO_KICKER_START; i < IO_KICKER_END; i++)
+ {
+ Kicker* newKicker = new Kicker(i);
+ localRobot->AddModule(newKicker);
+ newKicker = NULL;
+ }
+
//Init Sensors
for(uint8 i = IO_SENSOR_START; i < IO_SENSOR_END; i++)
{
- SensorTypes newSensorType;
-
switch(i)
{
- //Cases when sensor is digital:
- // newSensorType = SENSOR_TYPE_DIGITAL;
- // break;
-
+ //Create correct type of sensor
+ case IO_SENSOR_IR_0_DEG:
+ case IO_SENSOR_IR_30_DEG:
+ case IO_SENSOR_IR_60_DEG:
+ case IO_SENSOR_IR_100_DEG:
+ case IO_SENSOR_IR_180_DEG:
+ case IO_SENSOR_IR_260_DEG:
+ case IO_SENSOR_IR_300_DEG:
+ case IO_SENSOR_IR_330_DEG:
+ {
+ IR_Sensor* newSensor = new IR_Sensor(i);
+ localRobot->AddModule(newSensor);
+ newSensor = NULL;
+ break;
+ }
//Other cases
default:
- newSensorType = SENSOR_TYPE_ANALOG;
+ {
+ Sensor* newSensor = new Sensor(i);
+ localRobot->AddModule(newSensor);
+ newSensor = NULL;
break;
+ }
}
+ }
- Sensor* newSensor = new Sensor(i, newSensorType);
- localRobot->AddModule(newSensor);
- newSensor = NULL;
+ //Init Leds
+ for(uint8 i = IO_LED_START; i < IO_LED_END; i++)
+ {
+ Led* newLed = new Led(i);
+ localRobot->AddModule(newLed);
+ newLed = NULL;
}
//Run
diff --git a/source/Concept/Framework/robot.cpp b/source/Concept/Framework/robot.cpp index f982be6..3d3ae48 100644 --- a/source/Concept/Framework/robot.cpp +++ b/source/Concept/Framework/robot.cpp @@ -3,6 +3,48 @@ //-----------------------------------------------------------------------------
Robot::Robot()
{
+ //Hardware
+
+ //Set pin 1-6 output, 0 and 7 input
+ DDRA = (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6);
+ PORTA = 0;
+
+ //All output
+ DDRB = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7);
+ PORTB = (1 << 1);
+
+ //All output except PC4/PC5 (mousesensor SDA)
+ DDRC = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 6) | (1 << 7);
+ PORTC = 0;
+
+ //All output except PD0+1(I2C) + 2+3(RS232)
+ DDRD = (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7);
+ PORTD = (1 << 0) | (1 << 1);//Activate pullup at PD0+1
+
+ //PE5 for input
+ DDRE = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 6) | (1 << 7);
+ PORTE = 0;
+
+ //All input with pullup
+ DDRF = 0;
+ PORTF = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7);
+
+ //All input
+ DDRG = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4);
+ PORTG = (1 << 0) | (1 << 1);
+
+ // activate channel A+B on PWM1 at 8Bit
+ TCCR1A = (1 << COM1A1) | (1 << COM1B1) | (1 << WGM10);
+ TCCR1B = (1 <<ICNC1) | (1 <<CS12) | (1 <<CS10); // set clock/prescaler 1/1024 -> enable counter
+
+ // activate Kanal A+B on PWM3 at 8Bit
+ TCCR3A = (1 << COM3A1) | (1 << COM3B1) | (1 << WGM10);
+ TCCR3B = (1 <<ICNC3) | (1 <<CS32) | (1 <<CS30); // set clock/prescaler 1/1024 -> enable counter
+
+ //Activate interrupt
+ sei();
+
+ //Interface
memset(modules, NULL, sizeof(modules));
}
@@ -43,4 +85,42 @@ void Robot::Update() //insert code here
}
+//-----------------------------------------------------------------------------
+uint16 Robot::GetADCValue(uint8 channel)
+{
+ if(channel > 7) return 0;
+
+ uint32 result = 0;
+
+ //Activate ADC and set division factor to 64
+ ADCSRA = (1 << ADEN) | (1 << ADPS2) | (1 << ADPS1);
+
+ //Set multiplexer channel
+ ADMUX = channel;
+ //Use internal referencevoltage (2,56 V for atmega32)
+ ADMUX |= (1 << REFS1) | (1 << REFS0);
+
+ //Initialise ADC and start dummyreadout
+ ADCSRA |= (1 << ADSC);
+ while(ADCSRA & (1 << ADSC));
+
+ //Get voltage three times and calculate average value
+ for(uint8 i = 0; i < 3; i++)
+ {
+ // Eine Wandlung
+ ADCSRA |= (1 << ADSC);
+ // Auf Ergebnis warten...
+ while(ADCSRA & (1 << ADSC));
+
+ result += ADCW;
+ }
+
+ //Disable ADC
+ ADCSRA &= ~(1 << ADEN);
+
+ result /= 3;
+
+ return uint16(result);
+}
+
//--- EOF --- diff --git a/source/Concept/Framework/robot.h b/source/Concept/Framework/robot.h index db7fe15..13aa696 100644 --- a/source/Concept/Framework/robot.h +++ b/source/Concept/Framework/robot.h @@ -38,6 +38,8 @@ public: bool RemoveModule(IO_Module* oldModule);
void Update();
+
+ uint16 GetADCValue(uint8 channel);
};
#endif diff --git a/source/Concept/Framework/sensor.h b/source/Concept/Framework/sensor.h index 117f446..62f2165 100644 --- a/source/Concept/Framework/sensor.h +++ b/source/Concept/Framework/sensor.h @@ -1,7 +1,8 @@ #ifndef _SENSOR_H
#define _SENSOR_H
-#include "stdafx.h"
+#include "defines.h"
+#include "io_module.h"
class Sensor : public IO_Module
{
@@ -9,23 +10,18 @@ public: Sensor()
{
this->parent = NULL;
+ this->moduleId = 0;
}
- Sensor(uint32 sensorId, SensorTypes sensorType)
+ Sensor(uint32 sensorId)
{
this->parent = NULL;
this->moduleId = sensorId;
- this->sensorType = sensorType;
}
protected:
- SensorTypes sensorType;
public:
- SensorTypes GetType()
- {
- return sensorType;
- }
};
#endif diff --git a/source/Concept/Framework/stdafx.h b/source/Concept/Framework/stdafx.h index 5a50add..436f117 100644 --- a/source/Concept/Framework/stdafx.h +++ b/source/Concept/Framework/stdafx.h @@ -9,4 +9,8 @@ #include "io_module.h"
#include "sensor.h"
#include "engine.h"
+#include "kicker.h"
+#include "led.h"
+#include "distance_sensor.h"
+#include "ir_sensor.h"
#include "robot.h" |