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);
85 ROS_INFO_STREAM(
"MarkerIDs: " << marker_id_left <<
", " << marker_id_right);
87 double maxAngleDeviation;
88 mNodeHandle.getParam(
"feasibilityChecker_maxAngleDeviation", maxAngleDeviation);
93 transformationPublisher->start();
96 std::vector<std::string> frame_ids;
97 frame_ids.push_back(tf_visualizer_frames);
102 std::string laserscanner_type;
103 mNodeHandle.getParam(
"laserscanner_type", laserscanner_type);
105 if (laserscanner_type ==
"PLS101")
109 else if (laserscanner_type ==
"LMS400")
111 std::string hostname =
"192.168.0.1";
122 solutionFrames =
new std::vector<Eigen::Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d> >();
123 selectedTriangle =
new std::vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> >();
134 lblTriangles->setText(
"<span style='color:red'>Waiting for data...</span>");
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> > *)));
253 widget->resize(this->width()-220, this->height()-60);
283 QMainWindow::resizeEvent(event);
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);
345 QList<QListWidgetItem *> selected =
lstTopPose->selectedItems();
346 if (selected.count() > 0)
348 for(
int i = 0; i < selected.count(); i++)
382 ptuWindow.resize( 1000, 600 );
401 si =
"<span style='color:red'>No solutions found.";
405 si =
"<span style='color:green'>One solution found:";
409 si =
"<span style='color:yellow'>";
410 si += QString::number(size);
411 si +=
" solutions found.";
419 si =
"<span>Selected triangle: ";
423 for (
unsigned int j = 0; j < 3; j++)
433 si += QString::number(len,
'.', 3);
436 si += QString::number(len,
'.', 3);
461 Eigen::Matrix4d temp;
464 for (
unsigned i = 0; i<
solver->solutions.size(); i++)
486 QString siMatrix, siSolutionCounter;
490 Eigen::Matrix4d *temp;
491 siMatrix =
"<span> <table style='width:100%'>";
517 siMatrix +=
"</table></span>";
519 siMatrix = siMatrix +
"<br/>";
520 siMatrix = siMatrix +
"Distance to top: ";
523 distance1 += pow((*temp)(2,3), 2);
524 distance1 = sqrt(distance1);
527 distance2 += pow((*temp)(2,3), 2);
528 distance2 = sqrt(distance2);
531 distance3 += pow((*temp)(2,3), 2);
532 distance3 = sqrt(distance3);
534 siMatrix += QString::number(distance1,
'.', 3);
536 siMatrix += QString::number(distance2,
'.', 3);
538 siMatrix += QString::number(distance3,
'.', 3);
543 siSolutionCounter =
"Solution ";
545 siSolutionCounter +=
" \\ ";
558 (*text) +=
"<td style='width:25%'>";
559 (*text) += QString::number(value,
' ', 3);
566 unsigned int size = triangles->size();
573 si =
"<span style='color:red'>No triangles detected.";
578 si =
"<span style='color:green'>One triangle detected:";
583 si =
"<span style='color:yellow'>";
584 si += QString::number(size);
585 si +=
" triangles found.";
589 for (
unsigned int i = 0; i < size; i++)
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() <<
"]");
595 for (
unsigned int j = 0; j < 3; j++)
598 si += QString::number(triangles->at(i*3+j)[0],
'.', 2);
600 si += QString::number(triangles->at(i*3+j)[1],
'.', 2);
QPushButton * btnDeleteTopPose
void calculateTransformationFrames()
QRadioButton * radio_flat
QPushButton * btnStartPTUCapture
void btnPossibleSolutions_Right_clicked()
QPushButton * btnPossibleSolutions_Right
boost::shared_ptr< FeasibilityChecker > feasibilityChecker
void btnClearTopPose_clicked()
void showPossibleSolutions()
QPushButton * btnAddTopPose
ROSCPP_DECL const std::string & getName()
QLabel * lblSolutionMatrix
QCheckBox * chk_filteredData
QPushButton * btnPossibleSolutions_Left
boost::shared_ptr< ResectionSolver > solver
boost::shared_ptr< Transformation_Publisher > transformationPublisher
void radio_polar_stateChanged(bool state)
MainWindow(QWidget *parent=0)
void chk_avgData_stateChanged(bool state)
int possibleSolutions_Position
void btnDeleteTopPose_clicked()
void btnPossibleSolutions_Left_clicked()
boost::shared_ptr< Calibration_Object > calibrationObject
boost::shared_ptr< MarkerPublisher > markerPublisher
void btnStartPTUCapture_clicked()
void btnAddTopPose_clicked()
#define ROS_DEBUG_STREAM(args)
std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > * selectedTriangle
QLabel * lblCurrentTriangle
void setCurves(unsigned int showData=1)
void trianglesFound(std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > *triangles)
QRadioButton * radio_polar
void chk_rawData_stateChanged(bool state)
QPushButton * btnClearTopPose
void newTransform_Laserscan(const Eigen::Matrix4d &transform, double distanceToTop)
void chk_edges_stateChanged(bool state)
std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > * currentTriangles
boost::shared_ptr< TF_Visualizer > tfVisualizer
#define ROS_INFO_STREAM(args)
QLabel * lblPossibleSolutions_Position
LaserScanThread * currentThread
void chk_segments_stateChanged(bool state)
std::vector< Eigen::Matrix4d, Eigen::aligned_allocator< Eigen::Matrix4d > > * solutionFrames
void resizeEvent(QResizeEvent *event)
#define ROS_ERROR_STREAM(args)
void addMatrixRow(QString *text, double value)
void radio_flat_stateChanged(bool state)
void btnCapture_clicked()
void chk_filteredData_stateChanged(bool state)