Revision b2876335
ID | b2876335edd4f974c012a2e0847482eb5d5a96c8 |
fixed scheduler array access, no more segfaulting, but hangs
scout/libscout/src/behaviors/Scheduler.cpp | ||
---|---|---|
28 | 28 |
*/ |
29 | 29 |
void Scheduler::get_task(int robot) |
30 | 30 |
{ |
31 |
waitingRobots.push(robots[robot]); |
|
31 |
waitingRobots.push(robots[robot-1]);
|
|
32 | 32 |
} |
33 | 33 |
|
34 | 34 |
/** @Brief: Statically add orders to the Priority Queue Wrapper.*/ |
... | ... | |
146 | 146 |
string robot_name = msg->data.substr(9); |
147 | 147 |
for(unsigned int i=0; i<robots.size(); i++) |
148 | 148 |
{ |
149 |
if(robots[i].name.compare(robot_name) == 0) |
|
149 |
if(robots[i].name.compare(robot_name) == 0){
|
|
150 | 150 |
return; |
151 |
} |
|
151 | 152 |
} |
152 | 153 |
|
153 | 154 |
int id = robots.size() +1; |
scout/libscout/src/behaviors/WH_Robot.cpp | ||
---|---|---|
101 | 101 |
|
102 | 102 |
spinOnce(); |
103 | 103 |
|
104 |
while(curr_task == DEFAULT_TASK) |
|
104 |
while(curr_task == DEFAULT_TASK){
|
|
105 | 105 |
continue; |
106 |
} |
|
107 |
|
|
106 | 108 |
int error = exec_task(); |
107 | 109 |
if(error == TASK_COMPLETED) |
108 | 110 |
{ |
... | ... | |
126 | 128 |
} |
127 | 129 |
delete curr_task; |
128 | 130 |
curr_task = DEFAULT_TASK; |
131 |
|
|
129 | 132 |
} |
130 | 133 |
} |
131 | 134 |
|
Also available in: Unified diff