42 schedGraph::iterator it, it2;
43 for (it = graph.begin(); it != graph.end(); it++){
45 if (it->second.empty()){
50 for (it2 = graph.begin(); it2 != graph.end(); it2++){
51 list<string>::iterator l=it2->second.begin();
52 while(l!=it2->second.end()){
54 l = it2->second.erase(l);
70 schedGraph::iterator it;
72 schedule.resize(c.size());
75 for (
size_t i=0; i<c.size(); i++){
77 for (
size_t b=0; b<c[i].c->before_list_.size(); b++)
78 graph[c[i].name].push_back(c[i].c->before_list_[b]);
79 for (
size_t a=0; a<c[i].c->after_list_.size(); a++){
80 it = graph.find(c[i].c->after_list_[a]);
81 if (it == graph.end())
return false;
82 it->second.push_back(c[i].name);
89 while (!graph.empty()){
93 for (
size_t i=0; i<c.size(); i++)
94 if (c[i].name == name)
100 string schedule_list;
101 for (
size_t i=0; i<schedule.size(); i++)
102 schedule_list += c[schedule[i]].name +
", ";
103 ROS_DEBUG(
"Controller schedule: %s", schedule_list.c_str());
bool getNextController(string &c, schedGraph &graph)
bool scheduleControllers(const vector< ControllerSpec > &c, vector< size_t > &schedule)
map< string, list< string > > schedGraph