#include <ScanPoint.hpp>
Public Types | |
enum | Flags { FlagGround = 0x0001, FlagDirt = 0x0002, FlagRain = 0x0004, FlagThresholdSwitching = 0x0010, FlagReflector = 0x0020, FlagLeftCovered = 0x0100, FlagRightCovered = 0x0200, FlagBackground = 0x0400, FlagMarker = 0x0800, FlagTransparent = 0x1000, MaskInvalid = FlagGround | FlagDirt | FlagRain | FlagBackground, MaskCovered = FlagLeftCovered | FlagRightCovered } |
Public Member Functions | |
void | addCartesianOffset (double xOffset, double yOffset, double zOffset) |
void | addPolarOffset (double distOffset, double hAngleOffset, double vAngleOffset) |
void | clear () |
double | getDist () const |
double | getDist (const ScanPoint &other) const |
Returns the distance between this and the given other scanpoint, in [m]. More... | |
double | getDist2D (const ScanPoint &other) const |
Returns the two-dimensional distance between this and the given other scanpoint, in [m]. More... | |
UINT8 | getEchoNum () const |
double | getEchoWidth () const |
UINT16 | getFlags () const |
double | getHAngle () const |
UINT8 | getLayer () const |
UINT8 | getSourceId () const |
double | getVAngle () const |
double | getX () const |
double | getY () const |
double | getZ () const |
bool | isBackground () const |
Checks if the scan point is labeled as background. More... | |
bool | isDirt () const |
Checks if the scan point is labeled as dirt. More... | |
bool | isGround () const |
Checks if the scan point is labeled as ground. More... | |
bool | isLeftCovered () const |
Checks if the "left covered" flag is set. More... | |
bool | isMarked () const |
Checks if the marker is set. More... | |
bool | isRain () const |
Checks if the scan point is labeled as rain. More... | |
bool | isReflector () const |
Checks if the reflector flag is set. More... | |
bool | isRightCovered () const |
Checks if the "right covered" flag is set. More... | |
bool | isThresholdSwitching () const |
Checks if the threshold switching flag is set. More... | |
bool | isTransparent () const |
Checks if there is at least one more echo behind this scan point (B or C echo) More... | |
bool | isValid () const |
Checks if the scan point is valid (no ground, dirt, or rain) More... | |
ScanPoint () | |
void | setBackground (bool isBackground=true) |
Labels the scan point as invalid because it is in the background area. More... | |
void | setCartesian (double x, double y, double z) |
void | setDirt (bool isDirt=true) |
Labels the scan point as invalid because its an echo from dirt. More... | |
void | setEchoNum (UINT8 sub) |
void | setEchoWidth (double echoWidth) |
Set the echo pulse width, typically in [m]. More... | |
void | setFlags (UINT16 flags) |
Sets the scan point flags directly. More... | |
void | setGround (bool isGround=true) |
Labels the scan point as invalid because it is an echo from the ground. More... | |
void | setLayer (UINT8 ch) |
void | setLeftCovered (bool isLeftCovered=true) |
Labels the scan point: Left neighbour point may be covered. More... | |
void | setMarker (bool isMarked=true) |
Set or clear the "Marker" flag. More... | |
void | setNotCovered () |
Remove cover status. More... | |
void | setPoint3D (const Point3D &pt) |
void | setPolar (double dist, double hAngle, double vAngle) |
void | setRain (bool isRain=true) |
Labels the scan point as invalid because its an echo from rain. More... | |
void | setReflector (bool isReflector=true) |
Labels the scan point: EPW is high enough to be a reflector. More... | |
void | setRightCovered (bool isRightCovered=true) |
Labels the scan point: Right neighbour point may be covered. More... | |
void | setSourceId (UINT8 id) |
void | setValid () |
Removes all scan status information. More... | |
Point2D | toPoint2D () const |
Returns the x and y coordinates as a Point2D structure. More... | |
Point3D | toPoint3D () const |
Returns the x,y,z coordinates as a Point3D structure. More... | |
std::string | toString () const |
Static Public Member Functions | |
static double | getDistanceBetweenScanpoints (const ScanPoint &pt1, const ScanPoint &pt2) |
Protected Attributes | |
UINT8 | m_channel |
double | m_dist |
double | m_echoWidth |
UINT16 | m_flags |
double | m_hAngle |
UINT8 | m_sourceId |
UINT8 | m_subchannel |
double | m_vAngle |
double | m_x |
double | m_y |
double | m_z |
Private Member Functions | |
void | updateCartesian () |
Compute Cartesian coordinates from the current polar coordinates. More... | |
void | updatePolar () |
Compute polar coordinates from the current Cartesian coordinates. More... | |
Friends | |
bool | operator== (const ScanPoint &, const ScanPoint &) |
Equality predicate. More... | |
Definition at line 36 of file ScanPoint.hpp.
Enumerator | |
---|---|
FlagGround |
Invalid scan point, echo from ground. |
FlagDirt |
Invalid scan point, echo from dirt. |
FlagRain |
Invalid scan point, echo from rain drop. |
FlagThresholdSwitching |
Old: Scan point was measured in a shot with threshold switching (earlier FPGA versions) Scan point was measured using the higher threshold (since FGPA version 8.0.08) |
FlagReflector |
EPW of scan point is high enough to be a reflector. |
FlagLeftCovered |
Left neighbour point may be covered. |
FlagRightCovered |
Right neighbour point may be covered. |
FlagBackground |
Point has been recognized as background and should not be used in the tracking anymore. |
FlagMarker |
Point is "marked" (see above) |
FlagTransparent |
There is at least one more echo behind this scan point (B or C echo) |
MaskInvalid |
All flags of invalid scan points. |
MaskCovered |
All coverage flags. |
Definition at line 48 of file ScanPoint.hpp.
datatypes::ScanPoint::ScanPoint | ( | ) |
Definition at line 22 of file ScanPoint.cpp.
void datatypes::ScanPoint::addCartesianOffset | ( | double | xOffset, |
double | yOffset, | ||
double | zOffset | ||
) |
Definition at line 137 of file ScanPoint.cpp.
void datatypes::ScanPoint::addPolarOffset | ( | double | distOffset, |
double | hAngleOffset, | ||
double | vAngleOffset | ||
) |
Useful e.g. to add the horizontal and vertical angle offsets of the mounting position of a laserscanner.
distOffset | Radial offset in meters |
hAngleOffset | Horizontal (yaw) angle offset in radians. The resulting angle will be normalized into the interval [-pi,+pi). |
vAngleOffset | Vertical (pitch) angle offset in radians. The resulting angle will be normalized into the interval [-pi,+pi). |
Definition at line 158 of file ScanPoint.cpp.
void datatypes::ScanPoint::clear | ( | ) |
Definition at line 26 of file ScanPoint.cpp.
|
inline |
Definition at line 93 of file ScanPoint.hpp.
double datatypes::ScanPoint::getDist | ( | const ScanPoint & | other | ) | const |
Returns the distance between this and the given other scanpoint, in [m].
This method calculates the actual three-dimensional distance in x,y,z. dist2D() uses only x and y.
Definition at line 73 of file ScanPoint.cpp.
double datatypes::ScanPoint::getDist2D | ( | const ScanPoint & | other | ) | const |
Returns the two-dimensional distance between this and the given other scanpoint, in [m].
This method calculates the distance only in x and y coordinates; the z dimension is ignored. dist() uses all three dimensions.
Definition at line 83 of file ScanPoint.cpp.
|
static |
Returns the distance, in [m], between the two 3d-scanpoint coordinates.
Definition at line 68 of file ScanPoint.cpp.
|
inline |
Definition at line 101 of file ScanPoint.hpp.
|
inline |
Definition at line 97 of file ScanPoint.hpp.
|
inline |
Definition at line 98 of file ScanPoint.hpp.
|
inline |
Definition at line 94 of file ScanPoint.hpp.
|
inline |
Definition at line 100 of file ScanPoint.hpp.
|
inline |
Definition at line 99 of file ScanPoint.hpp.
|
inline |
Definition at line 95 of file ScanPoint.hpp.
|
inline |
Definition at line 89 of file ScanPoint.hpp.
|
inline |
Definition at line 90 of file ScanPoint.hpp.
|
inline |
Definition at line 91 of file ScanPoint.hpp.
|
inline |
Checks if the scan point is labeled as background.
Definition at line 110 of file ScanPoint.hpp.
|
inline |
Checks if the scan point is labeled as dirt.
Definition at line 112 of file ScanPoint.hpp.
|
inline |
Checks if the scan point is labeled as ground.
Definition at line 108 of file ScanPoint.hpp.
|
inline |
Checks if the "left covered" flag is set.
Definition at line 116 of file ScanPoint.hpp.
|
inline |
Checks if the marker is set.
Definition at line 106 of file ScanPoint.hpp.
|
inline |
Checks if the scan point is labeled as rain.
Definition at line 114 of file ScanPoint.hpp.
|
inline |
Checks if the reflector flag is set.
Definition at line 120 of file ScanPoint.hpp.
|
inline |
Checks if the "right covered" flag is set.
Definition at line 118 of file ScanPoint.hpp.
|
inline |
Checks if the threshold switching flag is set.
Definition at line 122 of file ScanPoint.hpp.
|
inline |
Checks if there is at least one more echo behind this scan point (B or C echo)
Definition at line 124 of file ScanPoint.hpp.
|
inline |
Checks if the scan point is valid (no ground, dirt, or rain)
Definition at line 104 of file ScanPoint.hpp.
|
inline |
Labels the scan point as invalid because it is in the background area.
Definition at line 185 of file ScanPoint.hpp.
void datatypes::ScanPoint::setCartesian | ( | double | x, |
double | y, | ||
double | z | ||
) |
Equivalent polar coordinates are computed on the fly.
x | x-coordinate in meters |
y | y-coordinate in meters |
z | z-coordinate in meters |
Definition at line 45 of file ScanPoint.cpp.
|
inline |
Labels the scan point as invalid because its an echo from dirt.
Definition at line 201 of file ScanPoint.hpp.
|
inline |
Definition at line 169 of file ScanPoint.hpp.
void datatypes::ScanPoint::setEchoWidth | ( | double | echoWidth | ) |
Set the echo pulse width, typically in [m].
The resolution of the echo width is reduced in the same way as compressMeters() does. This is to ensure that compressed replay data is the same as uncompressed live data.
Definition at line 237 of file ScanPoint.cpp.
|
inline |
Sets the scan point flags directly.
Definition at line 172 of file ScanPoint.hpp.
|
inline |
Labels the scan point as invalid because it is an echo from the ground.
Definition at line 193 of file ScanPoint.hpp.
|
inline |
Definition at line 168 of file ScanPoint.hpp.
|
inline |
Labels the scan point: Left neighbour point may be covered.
Definition at line 217 of file ScanPoint.hpp.
|
inline |
Set or clear the "Marker" flag.
Definition at line 177 of file ScanPoint.hpp.
|
inline |
Remove cover status.
Definition at line 233 of file ScanPoint.hpp.
void datatypes::ScanPoint::setPoint3D | ( | const Point3D & | pt | ) |
Equivalent polar coordinates are computed on the fly.
pt | Point coordinates in [m] |
Definition at line 59 of file ScanPoint.cpp.
void datatypes::ScanPoint::setPolar | ( | double | dist, |
double | hAngle, | ||
double | vAngle | ||
) |
Equivalent Cartesian coordinates are computed on the fly.
dist | Radial distance in meters |
hAngle | Horizontal/azimuth angle in radians. The angle will be normalized into the interval [-pi,+pi). |
vAngle | Vertical/elevation angle in radians. The angle will be normalized into the interval [-pi,+pi). |
Definition at line 106 of file ScanPoint.cpp.
|
inline |
Labels the scan point as invalid because its an echo from rain.
Definition at line 209 of file ScanPoint.hpp.
|
inline |
Labels the scan point: EPW is high enough to be a reflector.
Definition at line 236 of file ScanPoint.hpp.
|
inline |
Labels the scan point: Right neighbour point may be covered.
Definition at line 225 of file ScanPoint.hpp.
|
inline |
Definition at line 166 of file ScanPoint.hpp.
|
inline |
Removes all scan status information.
Definition at line 245 of file ScanPoint.hpp.
Point2D datatypes::ScanPoint::toPoint2D | ( | ) | const |
Returns the x and y coordinates as a Point2D structure.
Definition at line 123 of file ScanPoint.cpp.
Point3D datatypes::ScanPoint::toPoint3D | ( | ) | const |
Returns the x,y,z coordinates as a Point3D structure.
Definition at line 116 of file ScanPoint.cpp.
std::string datatypes::ScanPoint::toString | ( | ) | const |
Definition at line 243 of file ScanPoint.cpp.
|
private |
Compute Cartesian coordinates from the current polar coordinates.
This method is called when the polar coordinates have changed, to keep polar and Cartesian coordinates consistent.
Definition at line 217 of file ScanPoint.cpp.
|
private |
Compute polar coordinates from the current Cartesian coordinates.
This method is called when the Cartesian coordinates have changed, to keep polar and Cartesian coordinates consistent.
Moreover, since polar coordinates are redundant information, they are not part of the external representation of a scan point. Upon input, the polar coordinates are reconstructed using this method.
Definition at line 180 of file ScanPoint.cpp.
Equality predicate.
Definition at line 262 of file ScanPoint.cpp.
|
protected |
Definition at line 82 of file ScanPoint.hpp.
|
protected |
Definition at line 72 of file ScanPoint.hpp.
|
protected |
Definition at line 77 of file ScanPoint.hpp.
|
protected |
Definition at line 80 of file ScanPoint.hpp.
|
protected |
Definition at line 73 of file ScanPoint.hpp.
|
protected |
Definition at line 81 of file ScanPoint.hpp.
|
protected |
Definition at line 83 of file ScanPoint.hpp.
|
protected |
Definition at line 74 of file ScanPoint.hpp.
|
protected |
Definition at line 67 of file ScanPoint.hpp.
|
protected |
Definition at line 68 of file ScanPoint.hpp.
|
protected |
Definition at line 69 of file ScanPoint.hpp.