38 stdrInformationTree->header()->setDefaultSectionSize(20);
39 stdrInformationTree->header()->setMinimumSectionSize(10);
41 stdrInformationTree->setColumnCount(4);
42 stdrInformationTree->setColumnWidth(0,200);
43 stdrInformationTree->setColumnWidth(1,100);
44 stdrInformationTree->setColumnWidth(2,20);
45 stdrInformationTree->setColumnWidth(3,20);
47 QStringList ColumnNames;
48 ColumnNames <<
"" <<
"" <<
"" <<
"" <<
"";
50 stdrInformationTree->setHeaderLabels(ColumnNames);
61 mapOcgd.setText(0,
"Resolution");
66 stdrInformationTree->addTopLevelItem(&
robotsInfo);
73 std::string(
"/resources/images/visible.png")).c_str()));
77 std::string(
"/resources/images/visible_on.png")).c_str()));
80 std::string(
"/resources/images/visible_off.png")).c_str()));
83 std::string(
"/resources/images/visible_transparent.png")).c_str()));
102 int count = item->childCount();
103 for(
int i = count - 1 ; i >= 0 ; i--)
106 QTreeWidgetItem *child = item->child(i);
107 item->removeChild(item->child(i));
119 for(
int i = count - 1 ; i >= 0 ; i--)
137 mapWidth.setText(1,(QString().setNum(width) + QString(
" m")));
138 mapHeight.setText(1,(QString().setNum(height) + QString(
" m")));
139 mapOcgd.setText(1,(QString().setNum(ocgd) + QString(
" m/px")));
149 for(
unsigned int i = 0 ; i < msg.robots.size() ; i++)
151 QTreeWidgetItem *rnode =
new QTreeWidgetItem();
152 rnode->setText(0,QString(msg.robots[i].name.c_str()));
155 rnode->setToolTip(2,
"Visibility status");
156 rnode->setToolTip(3,
"Visualize robot topics");
158 QTreeWidgetItem *radius =
new QTreeWidgetItem();
159 radius->setText(0,
"Radius");
160 radius->setText(1,(QString().setNum(
161 msg.robots[i].robot.footprint.radius) + QString(
"m")));
162 rnode->addChild(radius);
164 QTreeWidgetItem *lasers =
new QTreeWidgetItem(),
165 *sonars =
new QTreeWidgetItem(),
166 *rfids =
new QTreeWidgetItem(),
167 *co2_sensors =
new QTreeWidgetItem(),
168 *thermal_sensors =
new QTreeWidgetItem(),
169 *sound_sensors =
new QTreeWidgetItem(),
170 *kinematics =
new QTreeWidgetItem();
172 lasers->setText(0,
"Lasers");
173 sonars->setText(0,
"Sonars");
174 rfids->setText(0,
"RFID readers");
175 co2_sensors->setText(0,
"CO2 sensors");
176 thermal_sensors->setText(0,
"Thermal sensors");
177 sound_sensors->setText(0,
"Sound sensors");
178 kinematics->setText(0,
"Kinematic");
179 kinematics->setText(1,
180 QString(msg.robots[i].robot.kinematicModel.type.c_str()));
182 for(
unsigned int l = 0 ; l < msg.robots[i].robot.laserSensors.size() ;
185 QTreeWidgetItem *lname;
186 lname=
new QTreeWidgetItem();
188 msg.robots[i].robot.laserSensors[l].frame_id.c_str());
191 lname->setToolTip(2,
"Visibility status");
193 lname->setToolTip(3,
"Visualize topic");
195 QTreeWidgetItem *lrays =
new QTreeWidgetItem();
196 QTreeWidgetItem *lmaxrange =
new QTreeWidgetItem();
197 QTreeWidgetItem *lminrange =
new QTreeWidgetItem();
198 QTreeWidgetItem *lmaxangle =
new QTreeWidgetItem();
199 QTreeWidgetItem *lminangle =
new QTreeWidgetItem();
200 QTreeWidgetItem *lnoisemean =
new QTreeWidgetItem();
201 QTreeWidgetItem *lnoisestd =
new QTreeWidgetItem();
202 QTreeWidgetItem *lfreq =
new QTreeWidgetItem();
203 QTreeWidgetItem *lposex =
new QTreeWidgetItem();
204 QTreeWidgetItem *lposey =
new QTreeWidgetItem();
205 QTreeWidgetItem *lorientation =
new QTreeWidgetItem();
207 lrays->setText(0,
"Rays");
208 lrays->setText(1,QString().setNum(
209 msg.robots[i].robot.laserSensors[l].numRays));
210 lmaxrange->setText(0,
"Max dist");
211 lmaxrange->setText(1,(QString().setNum(
212 msg.robots[i].robot.laserSensors[l].maxRange) + QString(
" m")));
213 lminrange->setText(0,
"Min dist");
214 lminrange->setText(1,(QString().setNum(
215 msg.robots[i].robot.laserSensors[l].minRange) + QString(
" m")));
216 lmaxangle->setText(0,
"Max angle");
217 lmaxangle->setText(1,(QString().setNum(
218 msg.robots[i].robot.laserSensors[l].maxAngle) + QString(
" rad")));
219 lminangle->setText(0,
"Min angle");
220 lminangle->setText(1,(QString().setNum(
221 msg.robots[i].robot.laserSensors[l].minAngle) + QString(
" rad")));
222 lnoisemean->setText(0,
"Noise (mean)");
223 lnoisemean->setText(1,(QString().setNum(
224 msg.robots[i].robot.laserSensors[l].noise.noiseMean) + QString(
" m")));
225 lnoisestd->setText(0,
"Noise (std)");
226 lnoisestd->setText(1,(QString().setNum(
227 msg.robots[i].robot.laserSensors[l].noise.noiseStd) + QString(
" m")));
228 lfreq->setText(0,
"Frequency");
229 lfreq->setText(1,(QString().setNum(
230 msg.robots[i].robot.laserSensors[l].frequency) + QString(
" Hz")));
232 lposex->setText(0,
"x pose");
233 lposex->setText(1,(QString().setNum(
234 msg.robots[i].robot.laserSensors[l].pose.x) + QString(
" m")));
235 lposey->setText(0,
"y pose");
236 lposey->setText(1,(QString().setNum(
237 msg.robots[i].robot.laserSensors[l].pose.y) + QString(
" m")));
238 lorientation->setText(0,
"Orientation");
239 lorientation->setText(1,(QString().setNum(
240 msg.robots[i].robot.laserSensors[l].pose.theta) + QString(
" rad")));
242 lname->addChild(lrays);
243 lname->addChild(lmaxrange);
244 lname->addChild(lminrange);
245 lname->addChild(lmaxangle);
246 lname->addChild(lminangle);
247 lname->addChild(lnoisemean);
248 lname->addChild(lnoisestd);
249 lname->addChild(lfreq);
250 lname->addChild(lposex);
251 lname->addChild(lposey);
252 lname->addChild(lorientation);
254 lasers->addChild(lname);
257 for(
unsigned int l = 0; l < msg.robots[i].robot.sonarSensors.size() ;
260 QTreeWidgetItem *sname;
261 sname =
new QTreeWidgetItem();
263 msg.robots[i].robot.sonarSensors[l].frame_id.c_str());
267 sname->setToolTip(2,
"Visibility status");
268 sname->setToolTip(3,
"Visualize topic");
270 QTreeWidgetItem *smaxrange =
new QTreeWidgetItem();
271 QTreeWidgetItem *sminrange =
new QTreeWidgetItem();
272 QTreeWidgetItem *scone =
new QTreeWidgetItem();
273 QTreeWidgetItem *sorientation =
new QTreeWidgetItem();
274 QTreeWidgetItem *snoisemean =
new QTreeWidgetItem();
275 QTreeWidgetItem *snoisestd =
new QTreeWidgetItem();
276 QTreeWidgetItem *sfreq =
new QTreeWidgetItem();
277 QTreeWidgetItem *sposex =
new QTreeWidgetItem();
278 QTreeWidgetItem *sposey =
new QTreeWidgetItem();
280 smaxrange->setText(0,
"Max dist");
281 smaxrange->setText(1,(QString().setNum(
282 msg.robots[i].robot.sonarSensors[l].maxRange) + QString(
" m")));
283 sminrange->setText(0,
"Min dist");
284 sminrange->setText(1,(QString().setNum(
285 msg.robots[i].robot.sonarSensors[l].minRange) + QString(
" m")));
286 scone->setText(0,
"Cone");
287 scone->setText(1,(QString().setNum(
288 msg.robots[i].robot.sonarSensors[l].coneAngle) + QString(
" rad")));
289 sorientation->setText(0,
"Orientation");
290 sorientation->setText(1,(QString().setNum(
291 msg.robots[i].robot.sonarSensors[l].pose.theta) + QString(
" rad")));
292 snoisemean->setText(0,
"Noise (mean)");
293 snoisemean->setText(1,(QString().setNum(
294 msg.robots[i].robot.sonarSensors[l].noise.noiseMean) +
296 snoisestd->setText(0,
"Noise (std)");
297 snoisestd->setText(1,(QString().setNum(
298 msg.robots[i].robot.sonarSensors[l].noise.noiseStd) + QString(
" m")));
299 sfreq->setText(0,
"Frequency");
300 sfreq->setText(1,(QString().setNum(
301 msg.robots[i].robot.sonarSensors[l].frequency) + QString(
" Hz")));
303 sposex->setText(0,
"x pose");
304 sposex->setText(1,(QString().setNum(
305 msg.robots[i].robot.sonarSensors[l].pose.x) + QString(
" m")));
306 sposey->setText(0,
"y pose");
307 sposey->setText(1,(QString().setNum(
308 msg.robots[i].robot.sonarSensors[l].pose.y) + QString(
" m")));
310 sname->addChild(smaxrange);
311 sname->addChild(sminrange);
312 sname->addChild(scone);
313 sname->addChild(sorientation);
314 sname->addChild(snoisemean);
315 sname->addChild(snoisestd);
316 sname->addChild(sfreq);
317 sname->addChild(sposex);
318 sname->addChild(sposey);
320 sonars->addChild(sname);
323 for(
unsigned int l = 0; l < msg.robots[i].robot.rfidSensors.size() ;
326 QTreeWidgetItem *sname;
327 sname =
new QTreeWidgetItem();
329 msg.robots[i].robot.rfidSensors[l].frame_id.c_str());
333 sname->setToolTip(2,
"Visibility status");
336 QTreeWidgetItem *smaxrange =
new QTreeWidgetItem();
337 QTreeWidgetItem *sspan =
new QTreeWidgetItem();
338 QTreeWidgetItem *sorientation =
new QTreeWidgetItem();
339 QTreeWidgetItem *sfreq =
new QTreeWidgetItem();
340 QTreeWidgetItem *scutoff =
new QTreeWidgetItem();
341 QTreeWidgetItem *sposex =
new QTreeWidgetItem();
342 QTreeWidgetItem *sposey =
new QTreeWidgetItem();
344 smaxrange->setText(0,
"Max dist");
345 smaxrange->setText(1,(QString().setNum(
346 msg.robots[i].robot.rfidSensors[l].maxRange) + QString(
" m")));
348 sspan->setText(0,
"Angle span");
349 sspan->setText(1,(QString().setNum(
350 msg.robots[i].robot.rfidSensors[l].angleSpan)
353 sorientation->setText(0,
"Orientation");
354 sorientation->setText(1,(QString().setNum(
355 msg.robots[i].robot.rfidSensors[l].pose.theta) +
358 scutoff->setText(0,
"Signal Cutoff");
359 scutoff->setText(1,(QString().setNum(
360 msg.robots[i].robot.rfidSensors[l].signalCutoff) +
363 sfreq->setText(0,
"Frequency");
364 sfreq->setText(1,(QString().setNum(
365 msg.robots[i].robot.rfidSensors[l].frequency) + QString(
" Hz")));
367 sposex->setText(0,
"x pose");
368 sposex->setText(1,(QString().setNum(
369 msg.robots[i].robot.rfidSensors[l].pose.x) + QString(
" m")));
371 sposey->setText(0,
"y pose");
372 sposey->setText(1,(QString().setNum(
373 msg.robots[i].robot.rfidSensors[l].pose.y) + QString(
" m")));
375 sname->addChild(smaxrange);
376 sname->addChild(sspan);
377 sname->addChild(sorientation);
378 sname->addChild(scutoff);
379 sname->addChild(sfreq);
380 sname->addChild(sposex);
381 sname->addChild(sposey);
383 rfids->addChild(sname);
385 for(
unsigned int l = 0; l < msg.robots[i].robot.co2Sensors.size() ;
388 QTreeWidgetItem *sname;
389 sname =
new QTreeWidgetItem();
391 msg.robots[i].robot.co2Sensors[l].frame_id.c_str());
395 sname->setToolTip(2,
"Visibility status");
398 QTreeWidgetItem *smaxrange =
new QTreeWidgetItem();
400 QTreeWidgetItem *sorientation =
new QTreeWidgetItem();
401 QTreeWidgetItem *sfreq =
new QTreeWidgetItem();
403 QTreeWidgetItem *sposex =
new QTreeWidgetItem();
404 QTreeWidgetItem *sposey =
new QTreeWidgetItem();
406 smaxrange->setText(0,
"Max dist");
407 smaxrange->setText(1,(QString().setNum(
408 msg.robots[i].robot.co2Sensors[l].maxRange) + QString(
" m")));
415 sorientation->setText(0,
"Orientation");
416 sorientation->setText(1,(QString().setNum(
417 msg.robots[i].robot.co2Sensors[l].pose.theta) +
425 sfreq->setText(0,
"Frequency");
426 sfreq->setText(1,(QString().setNum(
427 msg.robots[i].robot.co2Sensors[l].frequency) + QString(
" Hz")));
429 sposex->setText(0,
"x pose");
430 sposex->setText(1,(QString().setNum(
431 msg.robots[i].robot.co2Sensors[l].pose.x) + QString(
" m")));
433 sposey->setText(0,
"y pose");
434 sposey->setText(1,(QString().setNum(
435 msg.robots[i].robot.co2Sensors[l].pose.y) + QString(
" m")));
437 sname->addChild(smaxrange);
439 sname->addChild(sorientation);
441 sname->addChild(sfreq);
442 sname->addChild(sposex);
443 sname->addChild(sposey);
445 co2_sensors->addChild(sname);
447 for(
unsigned int l = 0; l < msg.robots[i].robot.thermalSensors.size() ;
450 QTreeWidgetItem *sname;
451 sname =
new QTreeWidgetItem();
453 msg.robots[i].robot.thermalSensors[l].frame_id.c_str());
457 sname->setToolTip(2,
"Visibility status");
460 QTreeWidgetItem *smaxrange =
new QTreeWidgetItem();
461 QTreeWidgetItem *sspan =
new QTreeWidgetItem();
462 QTreeWidgetItem *sorientation =
new QTreeWidgetItem();
463 QTreeWidgetItem *sfreq =
new QTreeWidgetItem();
465 QTreeWidgetItem *sposex =
new QTreeWidgetItem();
466 QTreeWidgetItem *sposey =
new QTreeWidgetItem();
468 smaxrange->setText(0,
"Max dist");
469 smaxrange->setText(1,(QString().setNum(
470 msg.robots[i].robot.thermalSensors[l].maxRange) + QString(
" m")));
472 sspan->setText(0,
"Angle span");
473 sspan->setText(1,(QString().setNum(
474 msg.robots[i].robot.thermalSensors[l].angleSpan)
477 sorientation->setText(0,
"Orientation");
478 sorientation->setText(1,(QString().setNum(
479 msg.robots[i].robot.thermalSensors[l].pose.theta) +
487 sfreq->setText(0,
"Frequency");
488 sfreq->setText(1,(QString().setNum(
489 msg.robots[i].robot.thermalSensors[l].frequency) + QString(
" Hz")));
491 sposex->setText(0,
"x pose");
492 sposex->setText(1,(QString().setNum(
493 msg.robots[i].robot.thermalSensors[l].pose.x) + QString(
" m")));
495 sposey->setText(0,
"y pose");
496 sposey->setText(1,(QString().setNum(
497 msg.robots[i].robot.thermalSensors[l].pose.y) + QString(
" m")));
499 sname->addChild(smaxrange);
500 sname->addChild(sspan);
501 sname->addChild(sorientation);
503 sname->addChild(sfreq);
504 sname->addChild(sposex);
505 sname->addChild(sposey);
507 thermal_sensors->addChild(sname);
509 for(
unsigned int l = 0; l < msg.robots[i].robot.soundSensors.size() ;
512 QTreeWidgetItem *sname;
513 sname =
new QTreeWidgetItem();
515 msg.robots[i].robot.soundSensors[l].frame_id.c_str());
519 sname->setToolTip(2,
"Visibility status");
522 QTreeWidgetItem *smaxrange =
new QTreeWidgetItem();
523 QTreeWidgetItem *sspan =
new QTreeWidgetItem();
524 QTreeWidgetItem *sorientation =
new QTreeWidgetItem();
525 QTreeWidgetItem *sfreq =
new QTreeWidgetItem();
527 QTreeWidgetItem *sposex =
new QTreeWidgetItem();
528 QTreeWidgetItem *sposey =
new QTreeWidgetItem();
530 smaxrange->setText(0,
"Max dist");
531 smaxrange->setText(1,(QString().setNum(
532 msg.robots[i].robot.soundSensors[l].maxRange) + QString(
" m")));
534 sspan->setText(0,
"Angle span");
535 sspan->setText(1,(QString().setNum(
536 msg.robots[i].robot.soundSensors[l].angleSpan)
539 sorientation->setText(0,
"Orientation");
540 sorientation->setText(1,(QString().setNum(
541 msg.robots[i].robot.soundSensors[l].pose.theta) +
549 sfreq->setText(0,
"Frequency");
550 sfreq->setText(1,(QString().setNum(
551 msg.robots[i].robot.soundSensors[l].frequency) + QString(
" Hz")));
553 sposex->setText(0,
"x pose");
554 sposex->setText(1,(QString().setNum(
555 msg.robots[i].robot.soundSensors[l].pose.x) + QString(
" m")));
557 sposey->setText(0,
"y pose");
558 sposey->setText(1,(QString().setNum(
559 msg.robots[i].robot.soundSensors[l].pose.y) + QString(
" m")));
561 sname->addChild(smaxrange);
562 sname->addChild(sspan);
563 sname->addChild(sorientation);
565 sname->addChild(sfreq);
566 sname->addChild(sposex);
567 sname->addChild(sposey);
569 sound_sensors->addChild(sname);
572 rnode->addChild(lasers);
573 rnode->addChild(sonars);
574 rnode->addChild(rfids);
575 rnode->addChild(co2_sensors);
576 rnode->addChild(thermal_sensors);
577 rnode->addChild(sound_sensors);
578 rnode->addChild(kinematics);
~CInfoLoader(void)
Default destructor.
QIcon visible_icon_off_
Icon of visibility medium (orange)
QIcon visible_icon_on_
< Icon of visibility on (green)
CInfoLoader(int argc, char **argv)
Default contructor.
void deleteTree(void)
Deletes the information tree.
QTreeWidgetItem robotsInfo
Tree item : Map height.
QTreeWidgetItem mapHeight
Tree item : Map width.
void updateRobots(const stdr_msgs::RobotIndexedVectorMsg &msg)
Updates the information tree according to the ensemble of robots.
The main namespace for STDR GUI.
QIcon visible_icon_trans_
Tree item : Root.
void deleteTreeNode(QTreeWidgetItem *item)
Deletes a specific tree node. Recursive function.
QTreeWidgetItem mapWidth
Tree item : Map resolution.
QTreeWidgetItem generalInfo
Tree item : Robot root.
void updateMapInfo(float width, float height, float ocgd)
Updates the information tree according to the specific map.