Revision 60b98383
Committing some clean ups done in the linefollowing behaviours
scout/libscout/src/behaviors/lineDrive.cpp | ||
---|---|---|
1 | 1 |
/** |
2 |
* @file lineDrive.cpp
|
|
2 |
* @file line_drive.cpp
|
|
3 | 3 |
* |
4 | 4 |
* Provides functions to implement line driving behavior. This program extends |
5 | 5 |
* the behavior of the line-following program by following lines automatically |
6 |
* and implementing behaviors to deal with commands passed to lineDrive.
|
|
6 |
* and implementing behaviors to deal with commands passed to line_drive.
|
|
7 | 7 |
* |
8 | 8 |
* Specific implementation for the colony scout robots in a warehouse behaviour |
9 | 9 |
* setting. |
... | ... | |
13 | 13 |
* @date 2-6-2012 |
14 | 14 |
*/ |
15 | 15 |
|
16 |
#include "lineDrive.h" |
|
17 |
|
|
18 |
int state[5]; //! Stores a queue of sub-commands to be executed |
|
19 |
int stateCounter; |
|
20 |
int stateLength; |
|
21 |
|
|
22 |
//! Whether lineDrive is currently paused. Set to 0 on initialization. |
|
23 |
int stopped=1; |
|
16 |
#include "line_drive.h" |
|
24 | 17 |
|
18 |
line_drive::line_drive(String scoutname): Behavior(scoutname) |
|
19 |
{ |
|
20 |
line_drive_init(); |
|
21 |
line_follow_init(); |
|
22 |
return; |
|
23 |
}; |
|
25 | 24 |
|
26 | 25 |
/** |
27 | 26 |
* Starts the line following procedure. Must be called before other |
28 | 27 |
* line-following functions will work. This function essentially resets the |
29 | 28 |
* state of line-following. |
30 | 29 |
*/ |
31 |
void lineDrive_init()
|
|
30 |
void line_drive_init()
|
|
32 | 31 |
{ |
33 | 32 |
lineFollow_init(); |
34 | 33 |
for(int i=0; i<5; i++)state[i]=0; |
Also available in: Unified diff