6 #include <std_msgs/String.h>
11 #include <webots_ros/robot_get_device_list.h>
12 #include <webots_ros/robot_get_device_list.h>
30 ROS_INFO(
"User stopped the 'robot_information_parser' node.");
35 int main(
int argc,
char **argv) {
38 std::vector<std::string> controllerName;
39 std::vector<std::string> deviceList;
42 ros::init(argc, argv,
"robot");
44 ros::Rate loop_rate(30);
48 std::vector<int> robot_list;
49 if (n.getParam(
"robot_list", robot_list))
51 ROS_INFO(
"Got param: robot_list");
55 ROS_ERROR(
"Failed to get param 'robot_list'");
67 std::stringstream robot_name_;
71 for (
int j = 0; j<robot_list.size(); j++){
72 robot_name_.str(std::string());
73 robot_name_ <<
"robot_" << robot_list.at(j);
75 if (
controllerList[i].find(robot_name_.str()) != std::string::npos) {
83 for (
int i=0; i<controllerName.size(); i++)
85 robots[i].
setName(std::string(1, (controllerName.at(i)).at(6)), n);
86 robots[i].
init(n, controllerName.at(i));
104 std::vector<Point_2> points;
112 points.push_back(p1);
113 points.push_back(p2);
114 points.push_back(p3);
115 points.push_back(p11);
116 points.push_back(p4);
117 points.push_back(p5);
121 std::vector<Point_2> points_2;
125 points_2.push_back(p6);
126 points_2.push_back(p7);
143 for (
int i=0; i<robot_list.size(); i++)
149 for (
int i=0; i<robot_list.size(); i++)