Revision 4026134b
Added Behavior::wait() to spinOnce for a duration.
Also added maze_solve_simple which always turns right.
scout/libscout/src/Behavior.cpp | ||
---|---|---|
106 | 106 |
ros::spinOnce(); |
107 | 107 |
return; |
108 | 108 |
} |
109 |
|
|
110 |
/** |
|
111 |
* Calls ros::spinOnce() in a loop until the duration is up. |
|
112 |
*/ |
|
113 |
void Behavior::wait(float duration) |
|
114 |
{ |
|
115 |
ros::Rate r(WAIT_HZ); |
|
116 |
int ticks = int(duration * 100); |
|
117 |
for (int i = 0; i < ticks; i++) |
|
118 |
{ |
|
119 |
spinOnce(); |
|
120 |
r.sleep(); |
|
121 |
} |
|
122 |
} |
Also available in: Unified diff