mainwindow.cpp
Go to the documentation of this file.
1 
18 #include "GUI/mainwindow.h"
19 #include <QLabel>
20 #include <string>
21 
22 using namespace std;
23 
24 MainWindow::MainWindow(QWidget *parent) :
25  QMainWindow(parent)
26 {
29  double top_angle_ab, top_angle_bc, top_angle_ca;
30  double side_a, side_b, side_c;
31  double marker_edge_size;
32  std::string marker_id_left, marker_id_right;
33  double marker_left_rotation_z, marker_left_transformation_z, marker_left_transformation_x,marker_left_rotation_x;
34  double laserscanner_segmentation_lambda, laserscanner_maxVariance, laserscanner_maxAngleDeviation, laserscanner_variationStep;
35  double marker_right_rotation_z, marker_right_transformation_z, marker_right_transformation_x,marker_right_rotation_x;
36  std::string tf_visualizer_camera_input_topic, tf_visualizer_camera_output_topic, tf_visualizer_frames;
37  int laserscanner_variationStepCount;
38  mNodeHandle.getParam("angle_ab", top_angle_ab);
39  mNodeHandle.getParam("angle_bc", top_angle_bc);
40  mNodeHandle.getParam("angle_ca", top_angle_ca);
41  mNodeHandle.getParam("side_a", side_a);
42  mNodeHandle.getParam("side_b", side_b);
43  mNodeHandle.getParam("side_c", side_c);
44  mNodeHandle.getParam("marker_edge_size", marker_edge_size);
45  mNodeHandle.getParam("marker_ID_left", marker_id_left);
46  mNodeHandle.getParam("marker_ID_right", marker_id_right);
47  mNodeHandle.getParam("marker_left_rotation_z", marker_left_rotation_z);
48  mNodeHandle.getParam("marker_left_transformation_z", marker_left_transformation_z);
49  mNodeHandle.getParam("marker_left_transformation_x", marker_left_transformation_x);
50  mNodeHandle.getParam("marker_left_rotation_x", marker_left_rotation_x);
51  mNodeHandle.getParam("marker_right_rotation_z", marker_right_rotation_z);
52  mNodeHandle.getParam("marker_right_transformation_z", marker_right_transformation_z);
53  mNodeHandle.getParam("marker_right_transformation_x", marker_right_transformation_x);
54  mNodeHandle.getParam("marker_right_rotation_x", marker_right_rotation_x);
55  mNodeHandle.getParam("laserscanner_segmentation_lambda", laserscanner_segmentation_lambda);
56  mNodeHandle.getParam("laserscanner_maxVariance", laserscanner_maxVariance);
57  mNodeHandle.getParam("laserscanner_maxAngleDeviation", laserscanner_maxAngleDeviation);
58  mNodeHandle.getParam("laserscanner_variationStep", laserscanner_variationStep);
59  mNodeHandle.getParam("tf_visualizer_camera_input_topic", tf_visualizer_camera_input_topic);
60  mNodeHandle.getParam("tf_visualizer_camera_output_topic", tf_visualizer_camera_output_topic);
61  mNodeHandle.getParam("tf_visualizer_frames", tf_visualizer_frames);
62  mNodeHandle.getParam("laserscanner_variationStepCount", laserscanner_variationStepCount);
63  calibrationObject->top_angle_ab = top_angle_ab;
64  calibrationObject->top_angle_bc = top_angle_bc;
65  calibrationObject->top_angle_ca = top_angle_ca;
66  calibrationObject->side_a = side_a;
67  calibrationObject->side_b = side_b;
68  calibrationObject->side_c = side_c;
69  calibrationObject->marker_edge_size = marker_edge_size;
70  calibrationObject->marker_id_left = marker_id_left;
71  calibrationObject->marker_id_right = marker_id_right;
72 
73  calibrationObject->marker_left_rotation_z = marker_left_rotation_z;
74  calibrationObject->marker_left_transformation_z = marker_left_transformation_z;
75  calibrationObject->marker_left_transformation_x = marker_left_transformation_x;
76  calibrationObject->marker_left_rotation_x = marker_left_rotation_x;
77 
78  calibrationObject->marker_right_rotation_z = marker_right_rotation_z;
79  calibrationObject->marker_right_transformation_z = marker_right_transformation_z;
80  calibrationObject->marker_right_transformation_x = marker_right_transformation_x;
81  calibrationObject->marker_right_rotation_x = marker_right_rotation_x;
82 
83  calibrationObject->calculateTransformationFrames();
84 
85  ROS_INFO_STREAM("MarkerIDs: " << marker_id_left << ", " << marker_id_right);
86 
87  double maxAngleDeviation;
88  mNodeHandle.getParam("feasibilityChecker_maxAngleDeviation", maxAngleDeviation);
89  feasibilityChecker = boost::shared_ptr<FeasibilityChecker>(new FeasibilityChecker(calibrationObject, Eigen::Vector3d(0.0,0.0,1.0), maxAngleDeviation));
91 
93  transformationPublisher->start();
94 
95  //tf visualization
96  std::vector<std::string> frame_ids;
97  frame_ids.push_back(tf_visualizer_frames);
98  tfVisualizer = boost::shared_ptr<TF_Visualizer>(new TF_Visualizer(frame_ids, tf_visualizer_camera_input_topic, tf_visualizer_camera_output_topic));
99  tfVisualizer->start();
100 
101  //Laserscan-thread starten
102  std::string laserscanner_type;
103  mNodeHandle.getParam("laserscanner_type", laserscanner_type);
104  ROS_INFO_STREAM("Using laserscanner: " << laserscanner_type);
105  if (laserscanner_type == "PLS101")
106  {
107  currentThread = new LaserScanThread(new Laserscanner_MILD(), laserscanner_segmentation_lambda,laserscanner_maxVariance,laserscanner_maxAngleDeviation,laserscanner_variationStep, laserscanner_variationStepCount);
108  }
109  else if (laserscanner_type == "LMS400")
110  {
111  std::string hostname = "192.168.0.1";
112  currentThread = new LaserScanThread(new LaserScanner_LMS400(hostname, 10), laserscanner_segmentation_lambda,laserscanner_maxVariance,laserscanner_maxAngleDeviation,laserscanner_variationStep, laserscanner_variationStepCount);
113  }
114  else
115  {
116  ROS_ERROR_STREAM("Unknown laserscanner type: " << laserscanner_type);
117  return;
118  }
119  //std::string port = "/dev/ttyS1";
120  currentThread->start();
121 
122  solutionFrames = new std::vector<Eigen::Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d> >();
123  selectedTriangle = new std::vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> >();
124 
125  showData = 1;
126  widget = new LaserScanWidget(this, 0, showData, currentThread);
127  widget->move(10,40);
128 
129  //Set labels
130  lblSolutions = new QLabel(this);
131  lblSolutions->setText("");
132 
133  lblTriangles = new QLabel(this);
134  lblTriangles->setText("<span style='color:red'>Waiting for data...</span>");
135  lblTriangles->setWordWrap(true);
136  lblTriangles->setAlignment(Qt::AlignTop);
137 
138  lblSolutionMatrix = new QLabel(this);
139  lblSolutionMatrix->setText("");
140  lblSolutionMatrix->setWordWrap(true);
141  lblSolutionMatrix->setAlignment(Qt::AlignTop);
142 
143  lblPossibleSolutions_Position = new QLabel(this);
144  lblPossibleSolutions_Position->setText("");
145  lblPossibleSolutions_Position->setWordWrap(true);
146  lblPossibleSolutions_Position->setAlignment(Qt::AlignTop);
147 
148  lblCurrentTriangle = new QLabel(this);
149  lblCurrentTriangle->setText("");
150  lblCurrentTriangle->setWordWrap(true);
151  lblCurrentTriangle->setAlignment(Qt::AlignTop);
152 
153  lblTriangles->resize(200, 60);
154  lblSolutions->resize(200, 20);
155  lblSolutionMatrix->resize(200, 150);
156  lblCurrentTriangle->resize(200, 60);
157 
158  //Set buttons
159  btnCapture = new QPushButton(this);
160  btnCapture->setText("Start capture");
161  btnCapture->resize(100, 25);
162  btnCapture->setEnabled(false);
163 
164  btnPossibleSolutions_Left = new QPushButton(this);
165  btnPossibleSolutions_Left->setText("<");
166  btnPossibleSolutions_Left->resize(20, 25);
167  btnPossibleSolutions_Left->setVisible(false);
168 
169  btnPossibleSolutions_Right = new QPushButton(this);
170  btnPossibleSolutions_Right->setText(">");
171  btnPossibleSolutions_Right->resize(20, 25);
172  btnPossibleSolutions_Right->setVisible(false);
173 
174  btnStartPTUCapture = new QPushButton(this);
175  btnStartPTUCapture->setText("Start PTU");
176  btnStartPTUCapture->resize(80, 25);
177  btnStartPTUCapture->setVisible(true);
178 
179  btnAddTopPose = new QPushButton(this);
180  btnAddTopPose->setText("Add");
181  btnAddTopPose->resize(60, 25);
182  btnAddTopPose->setVisible(true);
183  btnAddTopPose->setEnabled(false);
184 
185  btnDeleteTopPose = new QPushButton(this);
186  btnDeleteTopPose->setText("Delete");
187  btnDeleteTopPose->resize(60, 25);
188  btnDeleteTopPose->setVisible(true);
189  btnDeleteTopPose->setEnabled(false);
190 
191  btnClearTopPose = new QPushButton(this);
192  btnClearTopPose->setText("Clear");
193  btnClearTopPose->resize(60, 25);
194  btnClearTopPose->setVisible(true);
195  btnClearTopPose->setEnabled(false);
196 
197  //Set Listboxes
198  lstTopPose = new QListWidget(this);
199  lstTopPose->resize(180, 200);
200  lstTopPose->setVisible(true);
201  lstTopPose->setEnabled(false);
202 
203  //Set checkboxes
204  chk_rawdata = new QCheckBox(this);
205  chk_avgData = new QCheckBox(this);
206  chk_filteredData = new QCheckBox(this);
207  chk_segments = new QCheckBox(this);
208  chk_edges = new QCheckBox(this);
209  chk_avgData->setText("Average data");
210  chk_rawdata->setText("Raw data");
211  chk_filteredData->setText("Filtered data");
212  chk_segments->setText("Segments");
213  chk_edges->setText("Edges");
214  chk_rawdata->setChecked(true);
215 
216  //Set radio buttons
217  radio_polar = new QRadioButton(this);
218  radio_flat = new QRadioButton(this);
219  radio_polar->setText("Coordinates");
220  radio_flat->setText("Distance");
221  radio_polar->resize(180, 30);
222  radio_flat->resize(180,30);
223  radio_flat->setChecked(true);
224 
225  isCapturing = false;
226 
227  connect(currentThread, SIGNAL(trianglesFound(std::vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> > *)),this, SLOT(trianglesFound(std::vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> > *)));
228 
229  connect(this, SIGNAL(newTransform_Laserscan(const Eigen::Matrix4d, double)), transformationPublisher.get(), SLOT(newTransform_Laserscan(const Eigen::Matrix4d, double)));
230 
231  connect(btnCapture, SIGNAL(clicked()),this, SLOT(btnCapture_clicked()));
232  connect(btnPossibleSolutions_Left, SIGNAL(clicked()),this, SLOT(btnPossibleSolutions_Left_clicked()));
233  connect(btnPossibleSolutions_Right, SIGNAL(clicked()),this, SLOT(btnPossibleSolutions_Right_clicked()));
234  connect(btnStartPTUCapture, SIGNAL(clicked()),this, SLOT(btnStartPTUCapture_clicked()));
235 
236  connect(this, SIGNAL(setCurves(unsigned int)),widget, SLOT(setCurves(unsigned int)));
237 
238  connect(radio_flat, SIGNAL(clicked(bool)),this, SLOT(radio_flat_stateChanged(bool)));
239 
240  connect(radio_polar,SIGNAL(clicked(bool)),this, SLOT(radio_polar_stateChanged(bool)));
241  connect(radio_flat, SIGNAL(clicked(bool)),this, SLOT(radio_flat_stateChanged(bool)));
242 
243  connect(chk_rawdata, SIGNAL(clicked(bool)),this, SLOT(chk_rawData_stateChanged(bool)));
244  connect(chk_avgData, SIGNAL(clicked(bool)),this, SLOT(chk_avgData_stateChanged(bool)));
245  connect(chk_filteredData, SIGNAL(clicked(bool)),this, SLOT(chk_filteredData_stateChanged(bool)));
246  connect(chk_segments, SIGNAL(clicked(bool)),this, SLOT(chk_segments_stateChanged(bool)));
247  connect(chk_edges, SIGNAL(clicked(bool)),this, SLOT(chk_edges_stateChanged(bool)));
248 
250 }
251 void MainWindow::resizeEvent(QResizeEvent * event)
252 {
253  widget->resize(this->width()-220, this->height()-60);
254  radio_polar->move(this->width()-200,40);
255  radio_flat->move(this->width()-200,65);
256 
257  chk_rawdata->move(this->width()-200,100);
258  chk_avgData->move(this->width()-200,120);
259  chk_filteredData->move(this->width()-200,140);
260  chk_segments->move(this->width()-200,160);
261  chk_edges->move(this->width()-200,180);
262 
263  lblTriangles->move(this->width()-200,220);
264  btnCapture->move(this->width()-200,290);
265  lblSolutions->move(this->width()-200,320);
266 
267  lblSolutionMatrix->move(this->width()-200,340);
268 
269 
270  btnPossibleSolutions_Left->move(this->width()-97,424);
271  btnPossibleSolutions_Right->move(this->width()-77,424);
272  lblPossibleSolutions_Position->move(this->width()-200,427);
273  lblCurrentTriangle->move(this->width()-200,470);
274 
275  btnStartPTUCapture->move(this->width()-200,530);
276 
277  btnAddTopPose->move(this->width()-200,580);
278  btnDeleteTopPose->move(this->width()-140,580);
279  btnClearTopPose->move(this->width()-80,580);
280 
281  lstTopPose->move(this->width()-200,620);
282 
283  QMainWindow::resizeEvent(event);
284 }
285 
287 {
288  if (state == Qt::Unchecked) {showData = showData - (showData & 1);}
289  else {showData = showData | 1;}
291 }
293 {
294  if (state == Qt::Unchecked) {showData = showData - (showData & 2);}
295  else {showData = showData | 2;}
297 }
299 {
300  if (state == Qt::Unchecked) {showData = showData - (showData & 4);}
301  else {showData = showData | 4;}
303 }
305 {
306  if (state == Qt::Unchecked) {showData = showData - (showData & 8);}
307  else {showData = showData | 8;}
309 }
311 {
312  if (state == Qt::Unchecked) {showData = showData - (showData & 16);}
313  else {showData = showData | 16;}
315 }
317 {
318  if (state == true) widget->setGraph(1, showData);
319 }
321 {
322  if (state == true) widget->setGraph(0, showData);
323 }
324 
326 {
328 }
329 
331 {
332  if (solutionFrames->size() > 0)
333  {
334  Eigen::Matrix4d *temp;
336  QListWidgetItem *newItem = new QListWidgetItem;
337  QString text = QString::number((*temp)(0,3)) + ", " + QString::number((*temp)(1,3)) + ", " + QString::number((*temp)(2,3)) ;
338  newItem->setText(text);
339  lstTopPose->insertItem(lstTopPose->count(), newItem);
340  }
341 }
342 
344 {
345  QList<QListWidgetItem *> selected = lstTopPose->selectedItems();
346  if (selected.count() > 0)
347  {
348  for(int i = 0; i < selected.count(); i++)
349  {
350  //lstTopPose->takeItem(lstTopPose->indexFromItem(selected[i]));
351  }
352  }
353 }
354 
356 {
357  lstTopPose->clear();
358 }
359 
361 {
364 }
365 
367 {
370 }
371 
373 {
374  //Clean up
375  ROS_INFO("Main Window halting");
376  currentThread->stop();
378 
379  if (possibleSolutions_Position < 0 || possibleSolutions_Position >= (int)solutionFrames->size()) {possibleSolutions_Position = 0;}
380  Eigen::Matrix4d temp = solutionFrames->at(possibleSolutions_Position);
382  ptuWindow.resize( 1000, 600 );
383  ptuWindow.exec();
384  //Resume capturing when window is closed
385  ROS_INFO("Main Window resuming");
386  currentThread->start();
387 }
388 
390 {
391  if (isCapturing)
392  {
393  btnCapture->setText("Start capturing");
394  if (solutionFrames->size() > 0)
395  {
396  unsigned int size = solutionFrames->size();
397  QString si;
398 
399  if (size == 0)
400  {
401  si = "<span style='color:red'>No solutions found.";
402  }
403  else if (size == 1)
404  {
405  si = "<span style='color:green'>One solution found:";
406  }
407  else
408  {
409  si = "<span style='color:yellow'>";
410  si += QString::number(size);
411  si += " solutions found.";
412  }
413  si += "</span>";
414 
415  lblSolutions->setText(si);
416  btnStartPTUCapture->setVisible(size > 0);
419  si = "<span>Selected triangle: ";
420  for (unsigned int i = 0; i < selectedTriangle->size()/3; i++)
421  {
422  si = si + "<br/>";
423  for (unsigned int j = 0; j < 3; j++)
424  {
425  si += "[";
426  si += QString::number(selectedTriangle->at(i*3+j)[0],'.', 2);
427  si += ", ";
428  si += QString::number(selectedTriangle->at(i*3+j)[1],'.', 2);
429  si += "] ";
430  }
431  si = si + "<br/>";
432  double len = sqrt(pow(selectedTriangle->at(i*3)[0]-selectedTriangle->at(i*3+1)[0],2) + pow(selectedTriangle->at(i*3)[1]-selectedTriangle->at(i*3+1)[1],2));
433  si += QString::number(len,'.', 3);
434  si = si + " ";
435  len = sqrt(pow(selectedTriangle->at(i*3+2)[0]-selectedTriangle->at(i*3+1)[0],2) + pow(selectedTriangle->at(i*3+2)[1]-selectedTriangle->at(i*3+1)[1],2));
436  si += QString::number(len,'.', 3);
437  }
438  si += "</span>";
439  lblCurrentTriangle->setText(si);
440  }
441  isCapturing = false;
442  }
443  else
444  {
445  btnPossibleSolutions_Right->setVisible(false);
446  btnPossibleSolutions_Left->setVisible(false);
447  lblPossibleSolutions_Position->setVisible(false);
448  lblSolutionMatrix->setText("");
450  solutionFrames->clear();
451  lblSolutions->setText("Capturing...");
452  lblCurrentTriangle->setText("");
453  btnCapture->setText("Stop capturing");
454  isCapturing = true;
455  ROS_INFO("Capturing...");
456  }
457 }
458 
460 {
461  Eigen::Matrix4d temp;
462  solutionFrames->clear();
463  solver->solve(currentTriangles->at(0), currentTriangles->at(1), currentTriangles->at(2));
464  for (unsigned i = 0; i< solver->solutions.size(); i++)
465  {
466  temp = solver->calculateTransformationMatrix(currentTriangles->at(0), currentTriangles->at(1), currentTriangles->at(2), solver->solutions[i]);
467  if (feasibilityChecker->checkFeasibility_pose(temp))
468  {
469  ROS_INFO_STREAM("Triangle " << i << ": Feasability ok");
470  solutionFrames->push_back(temp);
471  }
472  }
473  if (solutionFrames->size() > 0)
474  {
475  ROS_INFO_STREAM("Found solution");
476  selectedTriangle->clear();
477  selectedTriangle->push_back(currentTriangles->at(0));
478  selectedTriangle->push_back(currentTriangles->at(1));
479  selectedTriangle->push_back(currentTriangles->at(2));
481  }
482 }
483 
485 {
486  QString siMatrix, siSolutionCounter;
487  if (solutionFrames->size() > 0)
488  {
489  if (possibleSolutions_Position < 0 || possibleSolutions_Position >= (int)solutionFrames->size()) {possibleSolutions_Position = 0;}
490  Eigen::Matrix4d *temp;
491  siMatrix = "<span> <table style='width:100%'>";
493  siMatrix += "<tr>";
494  addMatrixRow (&siMatrix, (*temp)(0,0) );
495  addMatrixRow (&siMatrix, (*temp)(0,1) );
496  addMatrixRow (&siMatrix, (*temp)(0,2) );
497  addMatrixRow (&siMatrix, (*temp)(0,3) );
498  siMatrix += "</tr>";
499  siMatrix += "<tr>";
500  addMatrixRow (&siMatrix, (*temp)(1,0) );
501  addMatrixRow (&siMatrix, (*temp)(1,1) );
502  addMatrixRow (&siMatrix, (*temp)(1,2) );
503  addMatrixRow (&siMatrix, (*temp)(1,3) );
504  siMatrix += "</tr>";
505  siMatrix += "<tr>";
506  addMatrixRow (&siMatrix, (*temp)(2,0) );
507  addMatrixRow (&siMatrix, (*temp)(2,1) );
508  addMatrixRow (&siMatrix, (*temp)(2,2) );
509  addMatrixRow (&siMatrix, (*temp)(2,3) );
510  siMatrix += "</tr>";
511  siMatrix += "<tr>";
512  addMatrixRow (&siMatrix, (*temp)(3,0) );
513  addMatrixRow (&siMatrix, (*temp)(3,1) );
514  addMatrixRow (&siMatrix, (*temp)(3,2) );
515  addMatrixRow (&siMatrix, (*temp)(3,3) );
516  siMatrix += "</tr>";
517  siMatrix += "</table></span>";
518  //Show distance to top point
519  siMatrix = siMatrix + "<br/>";
520  siMatrix = siMatrix + "Distance to top: ";
521  double distance1 = pow(selectedTriangle->at(0)[0] -(*temp)(0,3), 2);
522  distance1 += pow(selectedTriangle->at(0)[1] - (*temp)(1,3), 2);
523  distance1 += pow((*temp)(2,3), 2);
524  distance1 = sqrt(distance1);
525  double distance2 = pow(selectedTriangle->at(1)[0] -(*temp)(0,3), 2);
526  distance2 += pow(selectedTriangle->at(1)[1] - (*temp)(1,3), 2);
527  distance2 += pow((*temp)(2,3), 2);
528  distance2 = sqrt(distance2);
529  double distance3 = pow(selectedTriangle->at(2)[0] -(*temp)(0,3), 2);
530  distance3 += pow(selectedTriangle->at(2)[1] - (*temp)(1,3), 2);
531  distance3 += pow((*temp)(2,3), 2);
532  distance3 = sqrt(distance3);
533 
534  siMatrix += QString::number(distance1,'.', 3);
535  siMatrix += " ";
536  siMatrix += QString::number(distance2,'.', 3);
537  siMatrix += " ";
538  siMatrix += QString::number(distance3,'.', 3);
539 
540  btnPossibleSolutions_Right->setVisible((solutionFrames->size() > 1) && possibleSolutions_Position < (int)solutionFrames->size()-1);
541  btnPossibleSolutions_Left->setVisible((solutionFrames->size() > 1) && possibleSolutions_Position > 0);
542  lblPossibleSolutions_Position->setVisible((solutionFrames->size() > 1));
543  siSolutionCounter = "Solution ";
544  siSolutionCounter += QString::number(possibleSolutions_Position+1);
545  siSolutionCounter += " \\ ";
546  siSolutionCounter += QString::number(solutionFrames->size());
547 
548  this->newTransform_Laserscan(*temp, distance1);
549 
550  markerPublisher->publishTetrahedon(selectedTriangle->at(0), selectedTriangle->at(1), selectedTriangle->at(2), Eigen::Vector3d((*temp)(0,3), (*temp)(1,3), (*temp)(2,3)));
551  }
552  lblPossibleSolutions_Position->setText(siSolutionCounter);
553  lblSolutionMatrix->setText(siMatrix);
554 }
555 
556 void MainWindow::addMatrixRow(QString* text, double value)
557 {
558  (*text) += "<td style='width:25%'>";
559  (*text) += QString::number(value, ' ', 3);
560  (*text) += "</td>";
561 }
562 
563 void MainWindow::trianglesFound(std::vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> > *triangles)
564 {
565  currentTriangles = triangles;
566  unsigned int size = triangles->size();
567  if (size % 3 == 0) {
568  size = size / 3;
569  QString si;
570 
571  if (size == 0)
572  {
573  si = "<span style='color:red'>No triangles detected.";
574  btnCapture->setEnabled(false);
575  }
576  else if (size == 1)
577  {
578  si = "<span style='color:green'>One triangle detected:";
579  btnCapture->setEnabled(true);
580  }
581  else
582  {
583  si = "<span style='color:yellow'>";
584  si += QString::number(size);
585  si += " triangles found.";
586  btnCapture->setEnabled(false);
587  }
588  markerPublisher->publishTriangles(triangles);
589  for (unsigned int i = 0; i < size; i++)
590  {
591  ROS_DEBUG_STREAM("Triangle found at [" << QString::number(triangles->at(i*3)[0]).toStdString() << ", " << QString::number(triangles->at(i*3)[1]).toStdString() << "], "
592  << "[" << QString::number(triangles->at(i*3+1)[0]).toStdString() << ", " << QString::number(triangles->at(i*3+1)[1]).toStdString() << "], "
593  << "[" << QString::number(triangles->at(i*3+2)[0]).toStdString() << ", " << QString::number(triangles->at(i*3+2)[1]).toStdString() << "]");
594  si = si + "<br/>";
595  for (unsigned int j = 0; j < 3; j++)
596  {
597  si += "[";
598  si += QString::number(triangles->at(i*3+j)[0],'.', 2);
599  si += ", ";
600  si += QString::number(triangles->at(i*3+j)[1],'.', 2);
601  si += "] ";
602  }
603  }
604  si += "</span>";
605  lblTriangles->setText(si);
606  if (isCapturing)
607  {
609  }
610  }
611 }
612 
QPushButton * btnDeleteTopPose
Definition: mainwindow.h:77
void calculateTransformationFrames()
Definition: mainwindow.cpp:459
QPushButton * btnCapture
Definition: mainwindow.h:72
QRadioButton * radio_flat
Definition: mainwindow.h:87
QPushButton * btnStartPTUCapture
Definition: mainwindow.h:75
QCheckBox * chk_rawdata
Definition: mainwindow.h:52
void btnPossibleSolutions_Right_clicked()
Definition: mainwindow.cpp:366
QPushButton * btnPossibleSolutions_Right
Definition: mainwindow.h:74
boost::shared_ptr< FeasibilityChecker > feasibilityChecker
Definition: mainwindow.h:107
void btnClearTopPose_clicked()
Definition: mainwindow.cpp:355
void setGraph(int appearance, unsigned int showData)
void showPossibleSolutions()
Definition: mainwindow.cpp:484
QPushButton * btnAddTopPose
Definition: mainwindow.h:76
ROSCPP_DECL const std::string & getName()
QLabel * lblSolutionMatrix
Definition: mainwindow.h:65
QCheckBox * chk_filteredData
Definition: mainwindow.h:54
QCheckBox * chk_segments
Definition: mainwindow.h:55
QCheckBox * chk_edges
Definition: mainwindow.h:56
QPushButton * btnPossibleSolutions_Left
Definition: mainwindow.h:73
void toggleCaptureMode()
Definition: mainwindow.cpp:389
unsigned int showData
Definition: mainwindow.h:50
boost::shared_ptr< ResectionSolver > solver
Definition: mainwindow.h:99
QCheckBox * chk_avgData
Definition: mainwindow.h:53
QLabel * lblTriangles
Definition: mainwindow.h:59
bool isCapturing
Definition: mainwindow.h:51
boost::shared_ptr< Transformation_Publisher > transformationPublisher
Definition: mainwindow.h:109
void radio_polar_stateChanged(bool state)
Definition: mainwindow.cpp:316
MainWindow(QWidget *parent=0)
Definition: mainwindow.cpp:24
void chk_avgData_stateChanged(bool state)
Definition: mainwindow.cpp:292
#define ROS_INFO(...)
int possibleSolutions_Position
Definition: mainwindow.h:82
void btnDeleteTopPose_clicked()
Definition: mainwindow.cpp:343
void btnPossibleSolutions_Left_clicked()
Definition: mainwindow.cpp:360
boost::shared_ptr< Calibration_Object > calibrationObject
Definition: mainwindow.h:105
boost::shared_ptr< MarkerPublisher > markerPublisher
Definition: mainwindow.h:102
void btnStartPTUCapture_clicked()
Definition: mainwindow.cpp:372
void btnAddTopPose_clicked()
Definition: mainwindow.cpp:330
#define ROS_DEBUG_STREAM(args)
std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > * selectedTriangle
Definition: mainwindow.h:91
QLabel * lblCurrentTriangle
Definition: mainwindow.h:63
void setCurves(unsigned int showData=1)
void trianglesFound(std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > *triangles)
Definition: mainwindow.cpp:563
QRadioButton * radio_polar
Definition: mainwindow.h:86
void chk_rawData_stateChanged(bool state)
Definition: mainwindow.cpp:286
QPushButton * btnClearTopPose
Definition: mainwindow.h:78
void newTransform_Laserscan(const Eigen::Matrix4d &transform, double distanceToTop)
LaserScanWidget * widget
Definition: mainwindow.h:88
void chk_edges_stateChanged(bool state)
Definition: mainwindow.cpp:310
std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > * currentTriangles
Definition: mainwindow.h:90
boost::shared_ptr< TF_Visualizer > tfVisualizer
Definition: mainwindow.h:112
#define ROS_INFO_STREAM(args)
QLabel * lblPossibleSolutions_Position
Definition: mainwindow.h:67
LaserScanThread * currentThread
Definition: mainwindow.h:84
void chk_segments_stateChanged(bool state)
Definition: mainwindow.cpp:304
std::vector< Eigen::Matrix4d, Eigen::aligned_allocator< Eigen::Matrix4d > > * solutionFrames
Definition: mainwindow.h:97
void resizeEvent(QResizeEvent *event)
Definition: mainwindow.cpp:251
#define ROS_ERROR_STREAM(args)
QLabel * lblSolutions
Definition: mainwindow.h:61
void addMatrixRow(QString *text, double value)
Definition: mainwindow.cpp:556
void radio_flat_stateChanged(bool state)
Definition: mainwindow.cpp:320
QListWidget * lstTopPose
Definition: mainwindow.h:80
void btnCapture_clicked()
Definition: mainwindow.cpp:325
void chk_filteredData_stateChanged(bool state)
Definition: mainwindow.cpp:298


asr_mild_calibration_tool
Author(s): Aumann Florian, Heller Florian, Meißner Pascal
autogenerated on Mon Dec 2 2019 03:11:43