File: ClassUsingPclViewer.h

package info (click to toggle)
visp 3.6.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 119,296 kB
  • sloc: cpp: 500,914; ansic: 52,904; xml: 22,642; python: 7,365; java: 4,247; sh: 482; makefile: 237; objc: 145
file content (68 lines) | stat: -rw-r--r-- 3,378 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef _ClassUsingPclVisualizer_h_
#define _ClassUsingPclVisualizer_h_

//! \example ClassUsingPclViewer.h
#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_PCL) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)

#include<visp3/core/vpColVector.h>
#include<visp3/gui/vpPclViewer.h>

class ClassUsingPclViewer
{
private:
  vpTranslationVector m_t; /*!< The translation between the noise-free point cloud and the possibly noisy, translated + rotated one*/
  vpRotationMatrix m_R; /*!< The rotation between the noise-free point cloud and the possibly noisy, translated + rotated one*/
  vpHomogeneousMatrix m_cMo; /*!< The homogeneous matrix expressing the pose of the noise-free point cloud with regard to the possibly noisy, translated + rotated one.*/

  double m_minX; /*!< The minimum value of the X coordinate, expressed in the noise-free frame.*/
  double m_maxX; /*!< The maximum value of the X coordinate, expressed in the noise-free frame.*/
  unsigned int m_n; /*!< Number of points along the X-axis.*/
  double m_dX; // m_dX = (m_maxX - m_minX)/(m_n-1)
  double m_minY; /*!< The minimum value of the Y coordinate, expressed in the noise-free frame.*/
  double m_maxY; /*!< The maximum value of the Y coordinate, expressed in the noise-free frame.*/
  unsigned int m_m;  /*!< Number of points along the Y-axis.*/
  double m_dY; // m_dY = (m_maxY - m_minY)/(m_m-1)

  vpPclViewer m_visualizer; /*!< The PCL-based visualizer.*/

  /**
   * @brief Generate a noise-free grid of point, and a possibly noisy one, which is translated and rotated with regarded to the noise-free one.
   *
   * @param addedNoise Standard deviation of the noise.
   * @param order The order of the polynomial surface that is generated.
   * @return std::pair<vpPclViewer::pclPointCloudPointXYZRGBPtr, vpPclViewer::pclPointCloudPointXYZRGBPtr>
   */
  std::pair<vpPclViewer::pclPointCloudPointXYZRGBPtr, vpPclViewer::pclPointCloudPointXYZRGBPtr> generateControlPoints(const double &addedNoise, const unsigned int &order, vpColVector &confidenceWeights);
public:
  /**
   * @brief Construct a new object.
   *
   * @param xlimits A pair defining the <min, max> values of X-coordinates of the generated surface.
   * @param ylimits A pair defining the <min, max> values of Y-coordinates of the generated surface.
   * @param nbPoints The number of points along the <X-axis, Y-axis> that will be generated.
   */
  ClassUsingPclViewer(std::pair<double, double> xlimits = { -2.5,2.5 }, std::pair<double, double> ylimits = { -2.5,2.5 }, std::pair<unsigned int, unsigned int> nbPoints = { 50,50 });

  ~ClassUsingPclViewer();

  /**
   * @brief Demonstration on how to use a \b vpPclViewer in blocking mode, i.e.
   * we expect an input from the user after call to \b vpPclViewer::display
   * to go forward in the code.
   * @param addedNoise Standard deviation of the noise added to the moved surface.
   * @param order  The order of the polynomial surface that is generated.
   */
  void blockingMode(const double &addedNoise, const unsigned int &order);

  /**
   * @brief Demonstration on how to use a \b vpPclViewer in threaded mode.
   *
   * @param addedNoise Standard deviation of the noise added to the moved surface.
   * @param order  The order of the polynomial surface that is generated.
   */
  void threadedMode(const double &addedNoise, const unsigned int &order);
};
#endif
#endif