diff options
Diffstat (limited to 'source/Concept/Framework')
-rw-r--r-- | source/Concept/Framework/RoboCode.aps | 4 | ||||
-rw-r--r-- | source/Concept/Framework/defines.h | 8 | ||||
-rwxr-xr-x | source/Concept/Framework/main.c | 22 | ||||
-rwxr-xr-x | source/Concept/Framework/modules/executor/navigator.c | 298 | ||||
-rwxr-xr-x | source/Concept/Framework/modules/executor/navigator.h | 76 | ||||
-rwxr-xr-x | source/Concept/Framework/modules/input/distance_sensor.c | 8 | ||||
-rwxr-xr-x | source/Concept/Framework/modules/output/engine.h | 8 | ||||
-rw-r--r-- | source/Concept/Framework/tools.h | 19 |
8 files changed, 39 insertions, 404 deletions
diff --git a/source/Concept/Framework/RoboCode.aps b/source/Concept/Framework/RoboCode.aps index 01a1bea..0cae013 100644 --- a/source/Concept/Framework/RoboCode.aps +++ b/source/Concept/Framework/RoboCode.aps @@ -1,5 +1 @@ -<<<<<<< .mine <AVRStudio><MANAGEMENT><ProjectName>RoboCode</ProjectName><Created>16-Feb-2007 15:16:46</Created><LastEdit>19-Feb-2007 18:25:08</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>16-Feb-2007 15:16:46</Created><Version>4</Version><Build>4, 12, 0, 462</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\RoboCode.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>Y:\Concept\Framework\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>modules\io_module.c</SOURCEFILE><SOURCEFILE>atmega128io.c</SOURCEFILE><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>robot.c</SOURCEFILE><SOURCEFILE>tools.c</SOURCEFILE><SOURCEFILE>modules\input\distance_sensor.c</SOURCEFILE><SOURCEFILE>modules\input\ir_sensor.c</SOURCEFILE><SOURCEFILE>modules\input\keyboard.c</SOURCEFILE><SOURCEFILE>modules\input\mouse_sensor.c</SOURCEFILE><SOURCEFILE>modules\input\sensor.c</SOURCEFILE><SOURCEFILE>modules\interpreter\position_tracker.c</SOURCEFILE><SOURCEFILE>modules\output\display.c</SOURCEFILE><SOURCEFILE>modules\output\dribbler.c</SOURCEFILE><SOURCEFILE>modules\output\engine.c</SOURCEFILE><SOURCEFILE>modules\output\kicker.c</SOURCEFILE><SOURCEFILE>modules\output\led.c</SOURCEFILE><SOURCEFILE>modules\interpreter\ball_tracker.c</SOURCEFILE><SOURCEFILE>modules\executor\navigator.c</SOURCEFILE><HEADERFILE>stdafx.h</HEADERFILE><HEADERFILE>tools.h</HEADERFILE><HEADERFILE>atmega128io.h</HEADERFILE><HEADERFILE>defines.h</HEADERFILE><HEADERFILE>robot.h</HEADERFILE><HEADERFILE>modules\input\distance_sensor.h</HEADERFILE><HEADERFILE>modules\input\ir_sensor.h</HEADERFILE><HEADERFILE>modules\input\keyboard.h</HEADERFILE><HEADERFILE>modules\input\mouse_sensor.h</HEADERFILE><HEADERFILE>modules\input\sensor.h</HEADERFILE><HEADERFILE>modules\output\display.h</HEADERFILE><HEADERFILE>modules\output\dribbler.h</HEADERFILE><HEADERFILE>modules\output\engine.h</HEADERFILE><HEADERFILE>modules\output\kicker.h</HEADERFILE><HEADERFILE>modules\output\led.h</HEADERFILE><HEADERFILE>modules\interpreter\position_tracker.h</HEADERFILE><HEADERFILE>modules\io_module.h</HEADERFILE><HEADERFILE>modules\interpreter\ball_tracker.h</HEADERFILE><HEADERFILE>modules\executor\navigator.h</HEADERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>RoboCode.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS><OPTION><FILE>atmega128io.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>main.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\executor\navigator.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\distance_sensor.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\ir_sensor.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\keyboard.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\mouse_sensor.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\sensor.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\interpreter\ball_tracker.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\interpreter\position_tracker.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\io_module.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\display.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\dribbler.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\engine.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\kicker.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\led.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>robot.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>tools.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS><INCLUDE>modules\</INCLUDE><INCLUDE>modules\executor\</INCLUDE><INCLUDE>modules\input\</INCLUDE><INCLUDE>modules\interpreter\</INCLUDE><INCLUDE>modules\logic\</INCLUDE><INCLUDE>modules\output\</INCLUDE></INCDIRS><LIBDIRS/><LIBS><LIB>libm.a</LIB></LIBS><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=16000000ULUL -O3 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS>-lm</LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>0</USES_WINAVR><GCC_LOC>C:\WinAVR\bin\avr-g++.exe</GCC_LOC><MAKE_LOC>C:\WinAVR\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>Y:\Concept\Framework\stdafx.h</Name><Name>Y:\Concept\Framework\tools.h</Name><Name>Y:\Concept\Framework\atmega128io.h</Name><Name>Y:\Concept\Framework\defines.h</Name><Name>Y:\Concept\Framework\robot.h</Name><Name>Y:\Concept\Framework\modules\input\distance_sensor.h</Name><Name>Y:\Concept\Framework\modules\input\ir_sensor.h</Name><Name>Y:\Concept\Framework\modules\input\keyboard.h</Name><Name>Y:\Concept\Framework\modules\input\mouse_sensor.h</Name><Name>Y:\Concept\Framework\modules\input\sensor.h</Name><Name>Y:\Concept\Framework\modules\output\display.h</Name><Name>Y:\Concept\Framework\modules\output\dribbler.h</Name><Name>Y:\Concept\Framework\modules\output\engine.h</Name><Name>Y:\Concept\Framework\modules\output\kicker.h</Name><Name>Y:\Concept\Framework\modules\output\led.h</Name><Name>Y:\Concept\Framework\modules\interpreter\position_tracker.h</Name><Name>Y:\Concept\Framework\modules\io_module.h</Name><Name>Y:\Concept\Framework\modules\interpreter\ball_tracker.h</Name><Name>Y:\Concept\Framework\modules\executor\navigator.h</Name><Name>Y:\Concept\Framework\modules\io_module.c</Name><Name>Y:\Concept\Framework\atmega128io.c</Name><Name>Y:\Concept\Framework\main.c</Name><Name>Y:\Concept\Framework\robot.c</Name><Name>Y:\Concept\Framework\tools.c</Name><Name>Y:\Concept\Framework\modules\input\distance_sensor.c</Name><Name>Y:\Concept\Framework\modules\input\ir_sensor.c</Name><Name>Y:\Concept\Framework\modules\input\keyboard.c</Name><Name>Y:\Concept\Framework\modules\input\mouse_sensor.c</Name><Name>Y:\Concept\Framework\modules\input\sensor.c</Name><Name>Y:\Concept\Framework\modules\interpreter\position_tracker.c</Name><Name>Y:\Concept\Framework\modules\output\display.c</Name><Name>Y:\Concept\Framework\modules\output\dribbler.c</Name><Name>Y:\Concept\Framework\modules\output\engine.c</Name><Name>Y:\Concept\Framework\modules\output\kicker.c</Name><Name>Y:\Concept\Framework\modules\output\led.c</Name><Name>Y:\Concept\Framework\modules\interpreter\ball_tracker.c</Name><Name>Y:\Concept\Framework\modules\executor\navigator.c</Name></Files></ProjectFiles><Files><File00000><FileId>00000</FileId><FileName>stdafx.h</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>defines.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>robot.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>atmega128io.h</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>tools.h</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>modules\interpreter\position_tracker.h</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>modules\io_module.h</FileName><Status>1</Status></File00006><File00007><FileId>00007</FileId><FileName>modules\output\display.h</FileName><Status>1</Status></File00007><File00008><FileId>00008</FileId><FileName>modules\input\ir_sensor.h</FileName><Status>1</Status></File00008><File00009><FileId>00009</FileId><FileName>modules\output\engine.h</FileName><Status>1</Status></File00009><File00010><FileId>00010</FileId><FileName>modules\input\sensor.h</FileName><Status>1</Status></File00010><File00011><FileId>00011</FileId><FileName>modules\input\keyboard.h</FileName><Status>1</Status></File00011><File00012><FileId>00012</FileId><FileName>modules\io_module.c</FileName><Status>1</Status></File00012><File00013><FileId>00013</FileId><FileName>robot.c</FileName><Status>1</Status></File00013><File00014><FileId>00014</FileId><FileName>modules\input\ir_sensor.c</FileName><Status>1</Status></File00014><File00015><FileId>00015</FileId><FileName>modules\output\dribbler.h</FileName><Status>1</Status></File00015><File00016><FileId>00016</FileId><FileName>modules\output\kicker.h</FileName><Status>1</Status></File00016><File00017><FileId>00017</FileId><FileName>modules\output\led.h</FileName><Status>1</Status></File00017><File00018><FileId>00018</FileId><FileName>modules\input\distance_sensor.h</FileName><Status>1</Status></File00018><File00019><FileId>00019</FileId><FileName>modules\input\mouse_sensor.h</FileName><Status>1</Status></File00019><File00020><FileId>00020</FileId><FileName>modules\input\sensor.c</FileName><Status>1</Status></File00020><File00021><FileId>00021</FileId><FileName>main.c</FileName><Status>1</Status></File00021><File00022><FileId>00022</FileId><FileName>modules\interpreter\ball_tracker.h</FileName><Status>1</Status></File00022><File00023><FileId>00023</FileId><FileName>modules\interpreter\ball_tracker.c</FileName><Status>1</Status></File00023><File00024><FileId>00024</FileId><FileName>modules\interpreter\position_tracker.c</FileName><Status>1</Status></File00024><File00025><FileId>00025</FileId><FileName>modules\input\distance_sensor.c</FileName><Status>1</Status></File00025><File00026><FileId>00026</FileId><FileName>modules\output\engine.c</FileName><Status>1</Status></File00026><File00027><FileId>00027</FileId><FileName>modules\output\dribbler.c</FileName><Status>1</Status></File00027><File00028><FileId>00028</FileId><FileName>modules\executor\navigator.h</FileName><Status>1</Status></File00028><File00029><FileId>00029</FileId><FileName>modules\executor\navigator.c</FileName><Status>1</Status></File00029><File00030><FileId>00030</FileId><FileName>modules\output\display.c</FileName><Status>1</Status></File00030><File00031><FileId>00031</FileId><FileName>modules\input\mouse_sensor.c</FileName><Status>1</Status></File00031></Files><Workspace><File00000><Position>299 75 1025 556</Position><LineCol>6 0</LineCol></File00000><File00001><Position>33058 32861 33658 33107</Position><LineCol>155 0</LineCol></File00001><File00002><Position>33058 32861 33658 33107</Position><LineCol>45 0</LineCol></File00002><File00003><Position>33058 32861 33658 33107</Position><LineCol>16 0</LineCol></File00003><File00004><Position>33058 32861 33658 33107</Position><LineCol>11 0</LineCol></File00004><File00005><Position>33058 32861 33658 33107</Position><LineCol>43 0</LineCol></File00005><File00006><Position>32287 32091 33013 32546</Position><LineCol>8 0</LineCol></File00006><File00007><Position>33058 32861 33784 33316</Position><LineCol>73 0</LineCol></File00007><File00008><Position>33058 32861 33658 33107</Position><LineCol>2 0</LineCol></File00008><File00009><Position>32384 32233 33010 32534</Position><LineCol>109 0</LineCol></File00009><File00010><Position>32296 32117 32926 32422</Position><LineCol>27 0</LineCol></File00010><File00011><Position>32321 32148 32951 32453</Position><LineCol>6 0</LineCol></File00011><File00012><Position>32343 32177 32973 32482</Position><LineCol>1 0</LineCol></File00012><File00013><Position>32365 32206 32995 32511</Position><LineCol>16 71</LineCol></File00013><File00014><Position>32387 32235 33017 32540</Position><LineCol>9 0</LineCol></File00014><File00015><Position>32299 32119 32929 32424</Position><LineCol>3 0</LineCol></File00015><File00016><Position>32321 32148 32951 32453</Position><LineCol>21 0</LineCol></File00016><File00017><Position>32343 32177 32973 32482</Position><LineCol>1 0</LineCol></File00017><File00018><Position>32365 32206 32995 32511</Position><LineCol>71 0</LineCol></File00018><File00019><Position>299 72 1025 527</Position><LineCol>60 30</LineCol><State>Maximized</State></File00019><File00020><Position>32299 32119 32929 32424</Position><LineCol>1 0</LineCol></File00020><File00021><Position>293 68 1019 523</Position><LineCol>168 19</LineCol></File00021><File00022><Position>32343 32177 32973 32482</Position><LineCol>3 0</LineCol></File00022><File00023><Position>287 64 1013 519</Position><LineCol>65 0</LineCol></File00023><File00024><Position>32387 32235 33017 32540</Position><LineCol>7 0</LineCol></File00024><File00025><Position>32299 32119 32929 32424</Position><LineCol>1 0</LineCol></File00025><File00026><Position>32321 32148 32951 32453</Position><LineCol>1 0</LineCol></File00026><File00027><Position>32343 32177 32973 32482</Position><LineCol>1 0</LineCol></File00027><File00028><Position>32365 32206 32995 32511</Position><LineCol>39 0</LineCol></File00028><File00029><Position>296 70 1022 525</Position><LineCol>156 20</LineCol></File00029><File00030><Position>300 100 930 405</Position><LineCol>0 0</LineCol></File00030><File00031><Position>322 129 952 434</Position><LineCol>0 0</LineCol></File00031></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
-======= -<AVRStudio><MANAGEMENT><ProjectName>RoboCode</ProjectName><Created>16-Feb-2007 15:16:46</Created><LastEdit>18-Feb-2007 22:21:14</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>16-Feb-2007 15:16:46</Created><Version>4</Version><Build>4, 12, 0, 462</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\RoboCode.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>modules\io_module.c</SOURCEFILE><SOURCEFILE>atmega128io.c</SOURCEFILE><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>robot.c</SOURCEFILE><SOURCEFILE>tools.c</SOURCEFILE><SOURCEFILE>modules\input\distance_sensor.c</SOURCEFILE><SOURCEFILE>modules\input\ir_sensor.c</SOURCEFILE><SOURCEFILE>modules\input\keyboard.c</SOURCEFILE><SOURCEFILE>modules\input\mouse_sensor.c</SOURCEFILE><SOURCEFILE>modules\input\sensor.c</SOURCEFILE><SOURCEFILE>modules\interpreter\position_tracker.c</SOURCEFILE><SOURCEFILE>modules\output\display.c</SOURCEFILE><SOURCEFILE>modules\output\dribbler.c</SOURCEFILE><SOURCEFILE>modules\output\engine.c</SOURCEFILE><SOURCEFILE>modules\output\kicker.c</SOURCEFILE><SOURCEFILE>modules\output\led.c</SOURCEFILE><SOURCEFILE>modules\interpreter\ball_tracker.c</SOURCEFILE><SOURCEFILE>modules\executor\navigator.c</SOURCEFILE><HEADERFILE>stdafx.h</HEADERFILE><HEADERFILE>tools.h</HEADERFILE><HEADERFILE>atmega128io.h</HEADERFILE><HEADERFILE>defines.h</HEADERFILE><HEADERFILE>robot.h</HEADERFILE><HEADERFILE>modules\input\distance_sensor.h</HEADERFILE><HEADERFILE>modules\input\ir_sensor.h</HEADERFILE><HEADERFILE>modules\input\keyboard.h</HEADERFILE><HEADERFILE>modules\input\mouse_sensor.h</HEADERFILE><HEADERFILE>modules\input\sensor.h</HEADERFILE><HEADERFILE>modules\output\display.h</HEADERFILE><HEADERFILE>modules\output\dribbler.h</HEADERFILE><HEADERFILE>modules\output\engine.h</HEADERFILE><HEADERFILE>modules\output\kicker.h</HEADERFILE><HEADERFILE>modules\output\led.h</HEADERFILE><HEADERFILE>modules\interpreter\position_tracker.h</HEADERFILE><HEADERFILE>modules\io_module.h</HEADERFILE><HEADERFILE>modules\interpreter\ball_tracker.h</HEADERFILE><HEADERFILE>modules\executor\navigator.h</HEADERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega128</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>RoboCode.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS><OPTION><FILE>atmega128io.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>main.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\executor\navigator.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\distance_sensor.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\ir_sensor.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\keyboard.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\mouse_sensor.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\input\sensor.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\interpreter\ball_tracker.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\interpreter\position_tracker.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\io_module.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\display.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\dribbler.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\engine.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\kicker.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>modules\output\led.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>robot.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>tools.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS><INCLUDE>modules\</INCLUDE><INCLUDE>modules\executor\</INCLUDE><INCLUDE>modules\input\</INCLUDE><INCLUDE>modules\interpreter\</INCLUDE><INCLUDE>modules\logic\</INCLUDE><INCLUDE>modules\output\</INCLUDE></INCDIRS><LIBDIRS/><LIBS><LIB>libm.a</LIB></LIBS><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=16000000ULUL -O3 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS>-lm</LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>0</USES_WINAVR><GCC_LOC>C:\WinAVR\bin\avr-g++.exe</GCC_LOC><MAKE_LOC>C:\WinAVR\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\stdafx.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\tools.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\atmega128io.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\defines.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\robot.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\distance_sensor.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\ir_sensor.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\keyboard.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\mouse_sensor.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\sensor.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\display.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\dribbler.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\engine.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\kicker.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\led.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\interpreter\position_tracker.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\io_module.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\interpreter\ball_tracker.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\executor\navigator.h</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\io_module.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\atmega128io.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\main.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\robot.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\tools.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\distance_sensor.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\ir_sensor.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\keyboard.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\mouse_sensor.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\input\sensor.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\interpreter\position_tracker.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\display.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\dribbler.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\engine.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\kicker.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\output\led.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\interpreter\ball_tracker.c</Name><Name>I:\Projects\RoboCup WM 2006 07\trunk\rc2007-soccer\source\Concept\Framework\modules\executor\navigator.c</Name></Files></ProjectFiles><Files><File00000><FileId>00000</FileId><FileName>stdafx.h</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>defines.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>robot.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>atmega128io.h</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>tools.h</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>modules\interpreter\position_tracker.h</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>modules\io_module.h</FileName><Status>1</Status></File00006><File00007><FileId>00007</FileId><FileName>modules\output\display.h</FileName><Status>1</Status></File00007><File00008><FileId>00008</FileId><FileName>modules\input\ir_sensor.h</FileName><Status>1</Status></File00008><File00009><FileId>00009</FileId><FileName>modules\output\engine.h</FileName><Status>1</Status></File00009><File00010><FileId>00010</FileId><FileName>modules\input\sensor.h</FileName><Status>1</Status></File00010><File00011><FileId>00011</FileId><FileName>modules\input\keyboard.h</FileName><Status>1</Status></File00011><File00012><FileId>00012</FileId><FileName>modules\io_module.c</FileName><Status>1</Status></File00012><File00013><FileId>00013</FileId><FileName>robot.c</FileName><Status>1</Status></File00013><File00014><FileId>00014</FileId><FileName>modules\input\ir_sensor.c</FileName><Status>1</Status></File00014><File00015><FileId>00015</FileId><FileName>modules\output\dribbler.h</FileName><Status>1</Status></File00015><File00016><FileId>00016</FileId><FileName>modules\output\kicker.h</FileName><Status>1</Status></File00016><File00017><FileId>00017</FileId><FileName>modules\output\led.h</FileName><Status>1</Status></File00017><File00018><FileId>00018</FileId><FileName>modules\input\distance_sensor.h</FileName><Status>1</Status></File00018><File00019><FileId>00019</FileId><FileName>modules\input\mouse_sensor.h</FileName><Status>1</Status></File00019><File00020><FileId>00020</FileId><FileName>modules\input\sensor.c</FileName><Status>1</Status></File00020><File00021><FileId>00021</FileId><FileName>main.c</FileName><Status>1</Status></File00021><File00022><FileId>00022</FileId><FileName>modules\interpreter\ball_tracker.h</FileName><Status>1</Status></File00022><File00023><FileId>00023</FileId><FileName>modules\interpreter\ball_tracker.c</FileName><Status>1</Status></File00023><File00024><FileId>00024</FileId><FileName>modules\interpreter\position_tracker.c</FileName><Status>1</Status></File00024><File00025><FileId>00025</FileId><FileName>modules\input\distance_sensor.c</FileName><Status>1</Status></File00025><File00026><FileId>00026</FileId><FileName>modules\output\engine.c</FileName><Status>1</Status></File00026><File00027><FileId>00027</FileId><FileName>modules\output\dribbler.c</FileName><Status>1</Status></File00027><File00028><FileId>00028</FileId><FileName>modules\executor\navigator.h</FileName><Status>1</Status></File00028><File00029><FileId>00029</FileId><FileName>modules\executor\navigator.c</FileName><Status>1</Status></File00029></Files><Workspace><File00000><Position>232 74 958 555</Position><LineCol>6 0</LineCol></File00000><File00001><Position>267 72 1025 459</Position><LineCol>60 34</LineCol><State>Maximized</State></File00001><File00002><Position>32994 32862 33594 33108</Position><LineCol>45 0</LineCol></File00002><File00003><Position>32994 32862 33594 33108</Position><LineCol>16 0</LineCol></File00003><File00004><Position>32994 32862 33594 33108</Position><LineCol>11 0</LineCol></File00004><File00005><Position>32994 32862 33594 33108</Position><LineCol>5 0</LineCol></File00005><File00006><Position>32223 32093 32949 32548</Position><LineCol>8 0</LineCol></File00006><File00007><Position>32994 32862 33720 33317</Position><LineCol>102 0</LineCol></File00007><File00008><Position>32994 32862 33594 33108</Position><LineCol>2 0</LineCol></File00008><File00009><Position>32320 32235 32946 32536</Position><LineCol>55 0</LineCol></File00009><File00010><Position>32232 32119 32862 32424</Position><LineCol>27 0</LineCol></File00010><File00011><Position>32257 32150 32887 32455</Position><LineCol>6 0</LineCol></File00011><File00012><Position>32279 32179 32909 32484</Position><LineCol>1 0</LineCol></File00012><File00013><Position>32301 32208 32931 32513</Position><LineCol>17 0</LineCol></File00013><File00014><Position>32323 32237 32953 32542</Position><LineCol>9 0</LineCol></File00014><File00015><Position>32235 32121 32865 32426</Position><LineCol>3 0</LineCol></File00015><File00016><Position>32257 32150 32887 32455</Position><LineCol>18 0</LineCol></File00016><File00017><Position>32279 32179 32909 32484</Position><LineCol>1 0</LineCol></File00017><File00018><Position>32301 32208 32931 32513</Position><LineCol>71 0</LineCol></File00018><File00019><Position>32323 32237 32953 32542</Position><LineCol>16 0</LineCol></File00019><File00020><Position>32235 32121 32865 32426</Position><LineCol>1 0</LineCol></File00020><File00021><Position>229 70 955 525</Position><LineCol>177 0</LineCol></File00021><File00022><Position>32279 32179 32909 32484</Position><LineCol>3 0</LineCol></File00022><File00023><Position>223 66 949 521</Position><LineCol>52 0</LineCol></File00023><File00024><Position>32323 32237 32953 32542</Position><LineCol>7 0</LineCol></File00024><File00025><Position>32235 32121 32865 32426</Position><LineCol>1 0</LineCol></File00025><File00026><Position>32257 32150 32887 32455</Position><LineCol>1 0</LineCol></File00026><File00027><Position>32279 32179 32909 32484</Position><LineCol>1 0</LineCol></File00027><File00028><Position>32301 32208 32931 32513</Position><LineCol>1 0</LineCol></File00028><File00029><Position>32323 32237 32953 32542</Position><LineCol>214 5</LineCol></File00029></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
->>>>>>> .r199 diff --git a/source/Concept/Framework/defines.h b/source/Concept/Framework/defines.h index 6a88917..8cf2d7a 100644 --- a/source/Concept/Framework/defines.h +++ b/source/Concept/Framework/defines.h @@ -58,16 +58,10 @@ //Constants
#define SPEED_PER_PWM 1
#define DISTANCE_PER_VALUE 1
-<<<<<<< .mine + #define PI 3.14159265358979323846f
#define CYCLES_PER_CORRECTION 200
#define EMPTY_FLOAT 81188.1484f
-======= -#define PI 3.14159265358979323846f
-#define CYCLES_PER_CORRECTION 200
->>>>>>> .r199 -
-#define EMPTY_FLOAT 81188.1484f
//IO Module Names
enum IOModuleNames
diff --git a/source/Concept/Framework/main.c b/source/Concept/Framework/main.c index 306885b..8a7d90f 100755 --- a/source/Concept/Framework/main.c +++ b/source/Concept/Framework/main.c @@ -5,7 +5,7 @@ int main() //Init our robot
Robot* localRobot = new Robot();
- sleep(1); // Wait for LCD-Display
+ sleep(1);//Wait for Hardware
//Init Displays
for(uint8 i = IO_DISPLAY_START; i < IO_DISPLAY_END; i++)
@@ -15,9 +15,6 @@ int main() newDisplay = NULL;
}
- Display* ourDisplay = localRobot->GetModule<Display>(IO_DISPLAY_MAIN);
- // ourDisplay->Print("Starting..."); ourDisplay->NewLine(); // Debug output
-
//Init Engines
for(uint8 i = IO_ENGINE_START; i < IO_ENGINE_END; i++)
{
@@ -25,7 +22,6 @@ int main() localRobot->AddModule(newEngine);
newEngine = NULL;
}
- // ourDisplay->Print("Engines Ready"); ourDisplay->NewLine(); // Debug output
//Init Dribbler
for(uint8 i = IO_DRIBBLER_START; i < IO_DRIBBLER_END; i++)
@@ -34,7 +30,6 @@ int main() localRobot->AddModule(newDribbler);
newDribbler = NULL;
}
- // ourDisplay->Print("Dribbler Ready"); ourDisplay->NewLine(); // Debug output
//Init Kicker
for(uint8 i = IO_KICKER_START; i < IO_KICKER_END; i++)
@@ -43,7 +38,6 @@ int main() localRobot->AddModule(newKicker);
newKicker = NULL;
}
- // ourDisplay->Print("Kicker Ready"); ourDisplay->NewLine(); // Debug output
//Init Sensors
for(uint8 i = IO_SENSOR_START; i < IO_SENSOR_END; i++)
@@ -63,7 +57,6 @@ int main() IR_Sensor* newSensor = new IR_Sensor(i);
localRobot->AddModule(newSensor);
newSensor = NULL;
- // ourDisplay->Print("SensorIR Ready"); ourDisplay->NewLine(); // Debug output
break;
}
case IO_SENSOR_DISTANCE_0_DEG:
@@ -74,7 +67,6 @@ int main() Distance_Sensor* newSensor = new Distance_Sensor(i);
localRobot->AddModule(newSensor);
newSensor = NULL;
- // ourDisplay->Print("DistanceSensor Ready"); // Debug output
break;
}
@@ -84,7 +76,6 @@ int main() Mouse_Sensor* newSensor = new Mouse_Sensor(i);
localRobot->AddModule(newSensor);
newSensor = NULL;
- // ourDisplay->Print("MouseSensor Ready"); ourDisplay->NewLine(); // Debug output
break;
}
@@ -98,7 +89,6 @@ int main() }
}
}
- // ourDisplay->Print("Sensors Ready"); ourDisplay->NewLine(); // Debug output
//Init Leds
for(uint8 i = IO_LED_START; i < IO_LED_END; i++)
@@ -107,7 +97,6 @@ int main() localRobot->AddModule(newLed);
newLed = NULL;
}
- // ourDisplay->Print("LEDs Ready"); ourDisplay->NewLine(); // Debug output
//Init Keyboards
for(uint8 i = IO_KEYBOARD_START; i < IO_KEYBOARD_END; i++)
@@ -116,7 +105,6 @@ int main() localRobot->AddModule(newKeyboard);
newKeyboard = NULL;
}
- // ourDisplay->Print("Keyboard Ready"); ourDisplay->NewLine(); // Debug output
//Init Position Tracker
for(uint8 i = IO_POSITION_TRACKER_START; i < IO_POSITION_TRACKER_END; i++)
@@ -125,7 +113,6 @@ int main() localRobot->AddModule(newPositionTracker);
newPositionTracker = NULL;
}
- // ourDisplay->Print("PositionTracker Ready"); ourDisplay->NewLine(); // Debug output
//Init Ball Tracker
for(uint8 i = IO_BALL_TRACKER_START; i < IO_BALL_TRACKER_END; i++)
@@ -134,7 +121,6 @@ int main() localRobot->AddModule(newBallTracker);
newBallTracker = NULL;
}
- // ourDisplay->Print("Balltracker Ready"); ourDisplay->NewLine(); // Debug output
//Init Navigators
for(uint8 i = IO_NAVIGATOR_START; i < IO_NAVIGATOR_END; i++)
@@ -143,9 +129,11 @@ int main() localRobot->AddModule(newNavigator);
newNavigator = NULL;
}
- // ourDisplay->Print("Navigator Ready"); ourDisplay->NewLine(); // Debug output
- // ourDisplay->Print("All Ready"); ourDisplay->NewLine(); // Debug output
+
sleep(1);
+
+ //Debug code
+ Display* ourDisplay = localRobot->GetModule<Display>(IO_DISPLAY_MAIN);
ourDisplay->Clear();
diff --git a/source/Concept/Framework/modules/executor/navigator.c b/source/Concept/Framework/modules/executor/navigator.c index 47b1c69..a69c533 100755 --- a/source/Concept/Framework/modules/executor/navigator.c +++ b/source/Concept/Framework/modules/executor/navigator.c @@ -1,138 +1,3 @@ -<<<<<<< .mine -#include "navigator.h" - -//----------------------------------------------------------------------------- -void Navigator::Stop() -{ - this->direction = 0; - this->targetAngle = 0; - //this->targetX = EMPTY_FLOAT; - //this->targetY = EMPTY_FLOAT; - this->robotSpeed = 0; - this->rotationSpeed = 0; - - /*for(uint8 i = IO_ENGINE_START; i < IO_ENGINE_END; i++) - { - (parent->GetModule<Engine>(i))->SetSpeed(0); - (parent->GetModule<Engine>(i))->SetEnabled(true); - }*/ -} - -//----------------------------------------------------------------------------- -void Navigator::Rotate(float newTargetAngle,float newRotationSpeed) -{ - this->rotationSpeed = min(newRotationSpeed, 255.0f);; - this->direction = 0; - this->targetAngle = newTargetAngle; - //this->targetX = EMPTY_FLOAT; - //this->targetY = EMPTY_FLOAT; - this->robotSpeed = 0; - - /*for(uint8 i = IO_ENGINE_START; i < IO_ENGINE_END; i++) - { - (parent->GetModule<Engine>(i))->SetSpeed(rotationSpeed); - (parent->GetModule<Engine>(i))->SetEnabled(true); - }*/ -} - -//----------------------------------------------------------------------------- -void Navigator::Drive(float newDirection, float newAngle, float newSpeed, float rotationSpeed) -{ - this->rotationSpeed = min(rotationSpeed, 255.0f); - this->direction = newDirection*PI/180; - this->targetAngle = newAngle; - this->targetX = EMPTY_FLOAT; - this->targetY = EMPTY_FLOAT; - this->robotSpeed = newSpeed; - - if(targetAngle == EMPTY_FLOAT) - { - rotationSpeed = 0; - } - else - { - rotationSpeed = fabs(rotationSpeed) * sign(PI - (targetAngle - (parent->GetModule<Position_Tracker>(IO_POSITION_TRACKER_MAIN))->GetOrientation())); - } - - CalculateEngines(); -} - -//----------------------------------------------------------------------------- -void Navigator::DriveTo(float newX, float newY, float newAngle, float newSpeed, float rotationSpeed) -{ - if(newX < 0 || newY < 0) return; - - Position_Tracker* locationeer = parent->GetModule<Position_Tracker>(IO_POSITION_TRACKER_MAIN); - - this->rotationSpeed = min(rotationSpeed, 255.0f); - this->targetX = newX; - this->targetY = newY; - this->direction = direction2d(locationeer->GetPositionX(), locationeer->GetPositionY(), targetX, targetY);; - this->targetAngle = newAngle; - this->robotSpeed = newSpeed; - - if(targetAngle - locationeer->GetOrientation() > PI) - { - if(rotationSpeed > 0) - { - rotationSpeed = -rotationSpeed; - } - } - else - { - if(rotationSpeed < 0) - { - rotationSpeed = -rotationSpeed; - } - } - - CalculateDirection(); -} - -//----------------------------------------------------------------------------- -void Navigator::Update() -{ - Position_Tracker* locationeer = parent->GetModule<Position_Tracker>(IO_POSITION_TRACKER_MAIN); - - bool targetReached = false; - bool targetAngleReached = false; - - if(HasTarget() && distance2d(targetX, targetY, locationeer->GetPositionX(), locationeer->GetPositionY()) < 1.0f) - { - targetX = EMPTY_FLOAT; - targetY = EMPTY_FLOAT; - direction = EMPTY_FLOAT; - robotSpeed = 0; - - targetReached = true; - } - - if(targetAngle != EMPTY_FLOAT && fabs(targetAngle - locationeer->GetOrientation()) < 0.1f) - { - targetAngle = EMPTY_FLOAT; - rotationSpeed = 0; - - targetAngleReached = true; - } - - if(targetReached && targetAngleReached) - { - Stop(); - } - else if(targetReached || targetAngleReached) - { - CalculateDirection(); - } - - if(!(correctionCountdown--)) - { - CalculateDirection(); - } -} - -//----------------------------------------------------------------------------- -void Navigator::CalculateDirection() -======= #include "navigator.h"
//-----------------------------------------------------------------------------
@@ -150,140 +15,12 @@ void Navigator::Stop() (parent->GetModule<Engine>(i))->SetSpeed(0);
(parent->GetModule<Engine>(i))->SetEnabled(true);
}
-}
-
-//-----------------------------------------------------------------------------
-void Navigator::Rotate(float rotationSpeed)
->>>>>>> .r199 -{
-<<<<<<< .mine - Position_Tracker* locationeer = parent->GetModule<Position_Tracker>(IO_POSITION_TRACKER_MAIN); - correctionCountdown = CYCLES_PER_CORRECTION; - - if(targetAngle == EMPTY_FLOAT && !HasTarget()) return; - - if(HasTarget()) - { - direction = direction2d(locationeer->GetPositionX(), locationeer->GetPositionY(), targetX, targetY); - } - - if(targetAngle != EMPTY_FLOAT) - { - rotationSpeed = fabs(rotationSpeed) * sign(PI - (targetAngle - locationeer->GetOrientation())); - } - - CalculateEngines(); } -//----------------------------------------------------------------------------- -void Navigator::CalculateEngines() +//-----------------------------------------------------------------------------
+void Navigator::Rotate(float rotationSpeed) { - Position_Tracker* locationeer = parent->GetModule<Position_Tracker>(IO_POSITION_TRACKER_MAIN); - if(direction != EMPTY_FLOAT) - { - float relativeDirection = this->direction - locationeer->GetOrientation(); - - float xDrive = cos(relativeDirection + PI / 6.0f); - float yDrive = sin(relativeDirection + PI / 6.0f); - - float vLeft = xDrive; - float vBack = (-xDrive + sqrt(3) * yDrive) / 2.0f; - float vRight = (-xDrive - sqrt(3) * yDrive) / 2.0f; - - float speedCorrection = 1.0f; - - float maxEngineSpeed = 255.0f; - float minEngineSpeed = -255.0f; - - float maxSingleSpeed = max(max(fabs(vLeft), fabs(vBack)), fabs(vRight)); - - float calcSpeed = sqrt(vLeft * vLeft - vLeft * vRight + vRight * vRight + - vBack * (vBack + vLeft + vRight)); - - if(calcSpeed != 1.0f) - { - speedCorrection = 1.0f / calcSpeed; - } - - float maxOverallSpeed = robotSpeed * maxSingleSpeed * speedCorrection; - if(maxOverallSpeed > maxEngineSpeed) - { - robotSpeed = maxEngineSpeed / (maxSingleSpeed * speedCorrection); - } - - - vLeft = vLeft * this->robotSpeed * speedCorrection; - vBack = vBack * this->robotSpeed * speedCorrection; - vRight = vRight * this->robotSpeed * speedCorrection; - - maxSingleSpeed = max(max(fabs(vLeft), fabs(vBack)), fabs(vRight)); - float minSingleSpeed = min(min(vLeft, vBack), vRight); - - if(rotationSpeed) - { - if(this->rotationSpeed > 0) - { - if(maxEngineSpeed - maxSingleSpeed < this->rotationSpeed) - { - vLeft += maxEngineSpeed - maxSingleSpeed; - vBack += maxEngineSpeed - maxSingleSpeed; - vRight += maxEngineSpeed - maxSingleSpeed; - } - else - { - vLeft += this->rotationSpeed; - vBack += this->rotationSpeed; - vRight += this->rotationSpeed; - } - } - else - { - if((minEngineSpeed - minSingleSpeed) < this->rotationSpeed) - { - vLeft -= minEngineSpeed - minSingleSpeed; - vBack -= minEngineSpeed - minSingleSpeed; - vRight -= minEngineSpeed - minSingleSpeed; - } - else - { - vLeft -= this->rotationSpeed; - vBack -= this->rotationSpeed; - vRight -= this->rotationSpeed; - } - } - } - - Engine* curEngine = parent->GetModule<Engine>(IO_ENGINE_DRIVE_LEFT); - curEngine->SetSpeed(vLeft); - curEngine->SetEnabled(true); - curEngine = parent->GetModule<Engine>(IO_ENGINE_DRIVE_BACK); - curEngine->SetSpeed(vBack); - curEngine->SetEnabled(true); - curEngine = parent->GetModule<Engine>(IO_ENGINE_DRIVE_RIGHT); - curEngine->SetSpeed(vRight); - curEngine->SetEnabled(true); - curEngine = NULL; - } - else if(rotationSpeed) - { - Engine* curEngine = parent->GetModule<Engine>(IO_ENGINE_DRIVE_LEFT); - curEngine->SetSpeed(this->rotationSpeed); - curEngine->SetEnabled(true); - curEngine = parent->GetModule<Engine>(IO_ENGINE_DRIVE_BACK); - curEngine->SetSpeed(this->rotationSpeed); - curEngine->SetEnabled(true); - curEngine = parent->GetModule<Engine>(IO_ENGINE_DRIVE_RIGHT); - curEngine->SetSpeed(this->rotationSpeed); - curEngine->SetEnabled(true); - curEngine = NULL; - } - else - { - Stop(); - } -} -======= - this->rotationSpeed = min(rotationSpeed, 255.0f);;
+ this->rotationSpeed = min(fabs(rotationSpeed), 255.0f) * sign(rotationSpeed);
this->direction = EMPTY_FLOAT;
this->targetAngle = EMPTY_FLOAT;
this->targetX = EMPTY_FLOAT;
@@ -295,14 +32,14 @@ void Navigator::CalculateEngines() (parent->GetModule<Engine>(i))->SetSpeed(rotationSpeed);
(parent->GetModule<Engine>(i))->SetEnabled(true);
}
-}
-
+} + //-----------------------------------------------------------------------------
void Navigator::Drive(float newDirection, float newAngle, float newSpeed, float rotationSpeed)
{
this->rotationSpeed = min(rotationSpeed, 255.0f);
- this->direction = newDirection;
- this->targetAngle = newAngle;
+ this->direction = newDirection * PI / 180.0f;
+ this->targetAngle = newAngle * PI / 180.0f;
this->targetX = EMPTY_FLOAT;
this->targetY = EMPTY_FLOAT;
this->robotSpeed = newSpeed;
@@ -317,8 +54,8 @@ void Navigator::Drive(float newDirection, float newAngle, float newSpeed, float }
CalculateEngines();
-}
-
+} + //-----------------------------------------------------------------------------
void Navigator::DriveTo(float newX, float newY, float newAngle, float newSpeed, float rotationSpeed)
{
@@ -330,7 +67,7 @@ void Navigator::DriveTo(float newX, float newY, float newAngle, float newSpeed, this->targetX = newX;
this->targetY = newY;
this->direction = direction2d(locationeer->GetPositionX(), locationeer->GetPositionY(), targetX, targetY);;
- this->targetAngle = newAngle;
+ this->targetAngle = newAngle * PI / 180.0f;
this->robotSpeed = newSpeed;
if(targetAngle - locationeer->GetOrientation() > PI)
@@ -349,8 +86,8 @@ void Navigator::DriveTo(float newX, float newY, float newAngle, float newSpeed, }
CalculateDirection();
-}
-
+} + //-----------------------------------------------------------------------------
void Navigator::Update()
{
@@ -390,8 +127,8 @@ void Navigator::Update() {
CalculateDirection();
}
-}
-
+} + //-----------------------------------------------------------------------------
void Navigator::CalculateDirection()
{
@@ -412,8 +149,8 @@ void Navigator::CalculateDirection() }
CalculateEngines();
-}
-
+} + //-----------------------------------------------------------------------------
void Navigator::CalculateEngines()
{
@@ -519,5 +256,4 @@ void Navigator::CalculateEngines() {
Stop();
}
-}
->>>>>>> .r199 +} diff --git a/source/Concept/Framework/modules/executor/navigator.h b/source/Concept/Framework/modules/executor/navigator.h index 848c9fa..81919f9 100755 --- a/source/Concept/Framework/modules/executor/navigator.h +++ b/source/Concept/Framework/modules/executor/navigator.h @@ -1,79 +1,6 @@ -<<<<<<< .mine -#ifndef _NAVIGATOR_H -#define _NAVIGATOR_H - -//#include <math.h> -#include "../../stdafx.h" - -class Navigator : public IO_Module -{ -public: - Navigator() - { - this->parent = NULL; - this->moduleId = 0; - this->correctionCountdown = CYCLES_PER_CORRECTION; - this->direction = EMPTY_FLOAT; - this->targetAngle = EMPTY_FLOAT; - this->targetX = EMPTY_FLOAT; - this->targetY = EMPTY_FLOAT; - this->robotSpeed = 0; - this->rotationSpeed = 0; - } - - Navigator(uint32 navigatorId) - { - this->parent = NULL; - this->moduleId = navigatorId; - this->correctionCountdown = CYCLES_PER_CORRECTION; - this->direction = EMPTY_FLOAT; - this->targetAngle = EMPTY_FLOAT; - this->targetX = EMPTY_FLOAT; - this->targetY = EMPTY_FLOAT; - this->robotSpeed = 0; - this->rotationSpeed = 0; - } - -protected: - uint16 correctionCountdown; - float direction; - float targetAngle; - float targetX; - float targetY; - float robotSpeed; - float rotationSpeed; - -public: - void Update(); - - void Stop(); - - void Drive(float newDirection, float newAngle, float newSpeed, float rotationSpeed); - - void DriveTo(float newX, float newY, float newAngle, float newSpeed, float rotationSpeed); - - void Rotate(float rotationSpeed); - - void SetSpeed(float newSpeed) - { - this->robotSpeed = newSpeed; - } - - void CalculateDirection(); - - void CalculateEngines(); - - bool HasTarget() - { - return (targetX != EMPTY_FLOAT && targetY != EMPTY_FLOAT); - } -}; - -======= #ifndef _NAVIGATOR_H
#define _NAVIGATOR_H
-//#include <math.h>
#include "../../stdafx.h"
class Navigator : public IO_Module
@@ -139,6 +66,5 @@ public: return (targetX != EMPTY_FLOAT && targetY != EMPTY_FLOAT);
}
};
-
->>>>>>> .r199 + #endif diff --git a/source/Concept/Framework/modules/input/distance_sensor.c b/source/Concept/Framework/modules/input/distance_sensor.c index 508eeed..262d35f 100755 --- a/source/Concept/Framework/modules/input/distance_sensor.c +++ b/source/Concept/Framework/modules/input/distance_sensor.c @@ -12,12 +12,8 @@ float Distance_Sensor::GetDistance() *hardwarePort &= ~pin;//Deactivate port
*hardwareDDR &= ~pin;//Set pin input
- //(parent->GetModule<Display>(IO_DISPLAY_MAIN))->Print("pre 1", 4, 1);
-
//Wait for response
- for(int i=0;(!(PINC & pin))&&(i < 1000);i++) {asm volatile("nop");}
-
- //(parent->GetModule<Display>(IO_DISPLAY_MAIN))->Print("pre 2", 4, 1);
+ for(uint16 i = 0; (!(*hardwarePin & pin)) && (i < 1000); i++) { asm volatile("nop"); }
//Calculate duration of response
while((*hardwarePin & pin)&&(result < 300000))
@@ -26,7 +22,5 @@ float Distance_Sensor::GetDistance() asm volatile("nop");
}
- //(parent->GetModule<Display>(IO_DISPLAY_MAIN))->Print("pre 3", 4, 1);
-
return (float(result) * DISTANCE_PER_VALUE);
}
diff --git a/source/Concept/Framework/modules/output/engine.h b/source/Concept/Framework/modules/output/engine.h index 7b7a044..4c022bb 100755 --- a/source/Concept/Framework/modules/output/engine.h +++ b/source/Concept/Framework/modules/output/engine.h @@ -58,7 +58,7 @@ public: protected:
bool enabled;
- int curSpeed;
+ int16 curSpeed;
//Hardware
volatile uint8* hardwarePort;
@@ -94,16 +94,16 @@ protected: }
public:
- int GetSpeed()
+ int16 GetSpeed()
{
return curSpeed;
}
- void SetSpeed(int newSpeed)
+ void SetSpeed(int16 newSpeed)
{
curSpeed = newSpeed;
- int pwm = abs(newSpeed);
+ uint16 pwm = abs(newSpeed);
if(pwm > 255) pwm = 255;
*pwmSpeed = pwm;
diff --git a/source/Concept/Framework/tools.h b/source/Concept/Framework/tools.h index 25a63f2..735e773 100644 --- a/source/Concept/Framework/tools.h +++ b/source/Concept/Framework/tools.h @@ -3,6 +3,7 @@ #include <stdlib.h>
#include <math.h> +#include "defines.h" #ifndef new void* operator new(size_t sz); @@ -13,28 +14,28 @@ #define min(a, b) (((a) < (b)) ? (a) : (b))
#define sign(a) (((a) < 0) ? (-1) : (1))
-inline void sleep(int sec)
+inline void sleep(uint16 sec)
{
- for (int s=0; s<sec; s++) {
- for (long int i=0; i<1405678; i++) {
+ for (uint16 s = 0; s < sec; s++) {
+ for (uint32 i = 0; i < 1405678; i++) {
asm volatile("nop");
}
}
};
-inline void msleep(int msec)
+inline void msleep(uint16 msec)
{
- for (int s=0; s<msec; s++) {
- for (long int i=0; i<1405; i++) {
+ for (uint16 s = 0; s < msec; s++) {
+ for (uint16 i = 0; i < 1405; i++) {
asm volatile("nop");
}
}
};
-inline void usleep(int usec)
+inline void usleep(uint16 usec)
{
- for (int s=0; s<usec; s++) {
- for (long int i=0; i<3; i++) {
+ for (uint16 s = 0; s < usec; s++) {
+ for (uint8 i = 0; i < 3; i++) {
asm volatile("nop");
}
}
|