Visual Servoing Platform  version 3.6.1 under development (2024-11-15)
vpScanPoint Class Reference

#include <visp3/sensor/vpScanPoint.h>

Public Member Functions

 vpScanPoint ()
 
 vpScanPoint (const vpScanPoint &scanpoint)
 
 vpScanPoint (double r_dist, double h_angle, double v_angle)
 
virtual ~vpScanPoint ()
 
void setPolar (double r_dist, double h_angle, double v_angle)
 
double getRadialDist () const
 
double getVAngle () const
 
double getHAngle () const
 
double getX () const
 
double getY () const
 
double getZ () const
 
vpScanPointoperator= (const vpScanPoint &)=default
 

Friends

std::ostream & operator<< (std::ostream &s, const vpScanPoint &p)
 
bool operator== (const vpScanPoint &sp1, const vpScanPoint &sp2)
 
bool operator!= (const vpScanPoint &sp1, const vpScanPoint &sp2)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &s, const vpScanPoint &p)
 

Detailed Description

Class that defines a single laser scanner point.

This class stores data of a single scan point as:

  • cartesian coordinates in the 3D space that are available throw getX(), getY() and getZ() methods.
  • polar coordinates that are the native data provided by a laser scanner. By polar coordinates we mean here the radial distance and the horizontal angle of a point in the scanner layer and an additional vertical angle that gives the orientation of the layer.
Examples
SickLDMRS-Process.cpp.

Definition at line 73 of file vpScanPoint.h.

Constructor & Destructor Documentation

◆ vpScanPoint() [1/3]

vpScanPoint::vpScanPoint ( )
inline

Default constructor.

Definition at line 79 of file vpScanPoint.h.

◆ vpScanPoint() [2/3]

vpScanPoint::vpScanPoint ( const vpScanPoint scanpoint)
inline

Copy constructor.

Definition at line 81 of file vpScanPoint.h.

◆ vpScanPoint() [3/3]

vpScanPoint::vpScanPoint ( double  r_dist,
double  h_angle,
double  v_angle 
)
inline

Set the polar point coordinates.

Parameters
r_dist: Radial distance in meter.
h_angle: Horizontal angle in radian.
v_angle: Vertical angle in radian.

Definition at line 93 of file vpScanPoint.h.

◆ ~vpScanPoint()

virtual vpScanPoint::~vpScanPoint ( )
inlinevirtual

Destructor that does nothing.

Definition at line 100 of file vpScanPoint.h.

Member Function Documentation

◆ getHAngle()

double vpScanPoint::getHAngle ( ) const
inline

Returns the polar elevation (vertical) angle in radian.

Examples
SickLDMRS-Process.cpp.

Definition at line 124 of file vpScanPoint.h.

◆ getRadialDist()

double vpScanPoint::getRadialDist ( ) const
inline

Return the radial distance in meter.

Examples
SickLDMRS-Process.cpp.

Definition at line 116 of file vpScanPoint.h.

◆ getVAngle()

double vpScanPoint::getVAngle ( ) const
inline

Returns the polar elevation (vertical) angle in radian.

Definition at line 120 of file vpScanPoint.h.

◆ getX()

double vpScanPoint::getX ( ) const
inline

Returns the cartesian x coordinate.

The x and y axis define an horizontal plane, where x is oriented positive in front of the laser while y on the left side.

Definition at line 132 of file vpScanPoint.h.

◆ getY()

double vpScanPoint::getY ( ) const
inline

Returns the cartesian y coordinate.

The x and y axis define an horizontal plane, where x is oriented positive in front of the laser while y on the left side.

Definition at line 140 of file vpScanPoint.h.

◆ getZ()

double vpScanPoint::getZ ( ) const
inline

Returns the cartesian z coordinate.

The z axis is vertical and oriented in direction of the sky.

Definition at line 147 of file vpScanPoint.h.

◆ operator=()

vpScanPoint& vpScanPoint::operator= ( const vpScanPoint )
default

◆ setPolar()

void vpScanPoint::setPolar ( double  r_dist,
double  h_angle,
double  v_angle 
)
inline

Set the polar point coordinates.

Parameters
r_dist: Radial distance in meter.
h_angle: Horizontal angle in radian.
v_angle: Vertical angle in radian.

Definition at line 107 of file vpScanPoint.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const vpScanPoint sp1,
const vpScanPoint sp2 
)
friend

Returns true if sp1 and sp2 are different; otherwire returns false.

Definition at line 179 of file vpScanPoint.h.

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  s,
const vpScanPoint p 
)
friend

Print the values of the scan point on the output stream. Data are separated by a white space. Data that are print are first the polar coordinates, than the cartesian coordinates:

  • the radial distance in meter
  • the horizontal angle in radian
  • the vertical angle in radian
  • the cartesian X coordinate
  • the cartesian Y coordinate
  • the cartesian Z coordinate

The following code

#include <iostream>
#include <visp3/sensor/vpScanPoint.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
double radialDistance = 3; // 3 meters
double horizontalAngle = 1.12; // 1.12 radian
double verticalAngle = 0; // 0 radian for a horizontal layer
p.setPolar(radialDistance, horizontalAngle, verticalAngle);
std::cout << p << std::endl;
}
Class that defines a single laser scanner point.
Definition: vpScanPoint.h:76
void setPolar(double r_dist, double h_angle, double v_angle)
Definition: vpScanPoint.h:107

will produce the prints

"3 1.12 0 1.307047339 2.700301327 0"

Definition at line 242 of file vpScanPoint.h.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  s,
const vpScanPoint p 
)
related

Print the values of the scan point on the output stream. Data are separated by a white space. Data that are print are first the polar coordinates, than the cartesian coordinates:

  • the radial distance in meter
  • the horizontal angle in radian
  • the vertical angle in radian
  • the cartesian X coordinate
  • the cartesian Y coordinate
  • the cartesian Z coordinate

The following code

#include <iostream>
#include <visp3/sensor/vpScanPoint.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
double radialDistance = 3; // 3 meters
double horizontalAngle = 1.12; // 1.12 radian
double verticalAngle = 0; // 0 radian for a horizontal layer
p.setPolar(radialDistance, horizontalAngle, verticalAngle);
std::cout << p << std::endl;
}

will produce the prints

"3 1.12 0 1.307047339 2.700301327 0"

Definition at line 242 of file vpScanPoint.h.

◆ operator==

bool operator== ( const vpScanPoint sp1,
const vpScanPoint sp2 
)
friend

Returns true if sp1 and sp2 are equal; otherwire returns false.

Definition at line 160 of file vpScanPoint.h.