Voyant API 0.2.1
|
Wrapper for PointData messages. More...
#include <voyant_point_data_wrapper.hpp>
Public Member Functions | |
~PointDataWrapper () override | |
Destructor. | |
void | fromProto (PointData::Reader reader) override |
Update wrapper fields from a Cap'n Proto reader. | |
void | toProto (PointData::Builder &builder) const override |
Write wrapper fields to a Cap'n Proto builder. | |
void | debugString (std::ostream &os) const override |
Generate a debug string representation. | |
int32_t | timestamp_nanosecs () const |
Get timestamp in nanoseconds since frame start. | |
void | set_timestamp_nanosecs (int32_t value) |
Set timestamp in nanoseconds. | |
uint32_t | point_index () const |
Get point index within frame. | |
void | set_point_index (uint32_t value) |
Set point index. | |
float | x () const |
Get X position in meters. | |
void | set_x (float value) |
Set X position. | |
float | y () const |
Get Y position in meters. | |
void | set_y (float value) |
Set Y position. | |
float | z () const |
Get Z position in meters. | |
void | set_z (float value) |
Set Z position. | |
float | radial_vel () const |
Get radial velocity in m/s. | |
void | set_radial_vel (float value) |
Set radial velocity. | |
float | snr_linear () const |
Get signal-to-noise ratio (linear, electrical power) | |
void | set_snr_linear (float value) |
Set signal-to-noise ratio. | |
float | calibrated_reflectance () const |
Get calibrated reflectance. | |
void | set_calibrated_reflectance (float value) |
Set calibrated reflectance. | |
float | noise_mean_estimate () const |
Get estimated mean noise level about the peaks. | |
void | set_noise_mean_estimate (float value) |
Set noise mean estimate. | |
float | min_ramp_snr () const |
Get minimum ramp SNR. | |
void | set_min_ramp_snr (float value) |
Set minimum ramp SNR. | |
DropReason | drop_reason () const |
Get point drop reason. | |
void | set_drop_reason (DropReason value) |
Set point drop reason. | |
bool | is_valid () const |
Check if point is valid based on drop reason. | |
void | set_point_index_components (uint16_t azimuth, uint16_t elevation) |
Encode azimuth and elevation into the point_index field. | |
uint16_t | azimuth_index () const |
Extract azimuth index from point_index. | |
uint16_t | elevation_index () const |
Extract elevation index from point_index. | |
float | range () const |
Calculate the range (Euclidean distance from origin) of the point. | |
virtual void | fromProto (typename T::Reader reader)=0 |
Update wrapper fields from a Cap'n Proto reader. | |
virtual void | toProto (typename T::Builder &builder) const=0 |
Write wrapper fields to a Cap'n Proto builder. | |
void | fromBuffer (const uint8_t *buffer, size_t size) |
Update wrapper fields from a serialized message buffer. | |
size_t | toBuffer (uint8_t *buffer, size_t buffer_size) const |
Serialize this wrapper to a buffer using Cap'n Proto format. | |
Private Attributes | |
int32_t | timestamp_nanosecs_ = 0 |
Timestamp in nanoseconds since frame start. | |
uint32_t | point_index_ = 0 |
Point index within frame (encoded azimuth/elevation) | |
float | x_ = 0.0f |
X position in meters (Cartesian coordinate) | |
float | y_ = 0.0f |
Y position in meters (Cartesian coordinate) | |
float | z_ = 0.0f |
Z position in meters (Cartesian coordinate) | |
float | radial_vel_ = 0.0f |
Radial velocity in m/s (Doppler measurement) | |
float | snr_linear_ = 0.0f |
Signal-to-Noise Ratio (electrical power, see snr_linear()) | |
float | calibrated_reflectance_ = 0.0f |
Calibrated reflectance (not implemented) | |
float | noise_mean_estimate_ = 0.0f |
Noise floor estimate for SNR calculation. | |
float | min_ramp_snr_ = 0.0f |
Minimum ramp SNR (internal test use) | |
DropReason | drop_reason_ = DropReason::UNKNOWN |
Point validity status (see drop_reason()) | |
Wrapper for PointData messages.
Provides a C++ interface for handling LiDAR point data with position, velocity, signal quality, and validity information.
|
override |
Destructor.
uint16_t PointDataWrapper::azimuth_index | ( | ) | const |
Extract azimuth index from point_index.
|
inline |
Get calibrated reflectance.
|
overridevirtual |
Generate a debug string representation.
os | The output stream to write to |
Implements CapnpWrapper< PointData >.
|
inline |
Get point drop reason.
Indicates whether this point passed validation checks:
uint16_t PointDataWrapper::elevation_index | ( | ) | const |
Extract elevation index from point_index.
|
inlineinherited |
Update wrapper fields from a serialized message buffer.
buffer | Pointer to the buffer containing serialized Cap'n Proto data |
size | Size of the buffer in bytes |
|
override |
Update wrapper fields from a Cap'n Proto reader.
reader | The PointData reader to extract data from |
|
pure virtualinherited |
Update wrapper fields from a Cap'n Proto reader.
reader | The Cap'n Proto reader to extract data from |
|
inline |
Check if point is valid based on drop reason.
|
inline |
Get minimum ramp SNR.
|
inline |
Get estimated mean noise level about the peaks.
This value is used internally to calculate the Signal-to-Noise Ratio (SNR) by providing the noise floor estimation for the detection algorithm.
|
inline |
Get point index within frame.
|
inline |
Get radial velocity in m/s.
float PointDataWrapper::range | ( | ) | const |
Calculate the range (Euclidean distance from origin) of the point.
|
inline |
Set calibrated reflectance.
value | Reflectivity value |
|
inline |
Set point drop reason.
value | Drop reason enum value |
|
inline |
Set minimum ramp SNR.
value | Minimum ramp SNR value |
|
inline |
Set noise mean estimate.
value | Noise mean value |
|
inline |
Set point index.
value | Point index value |
void PointDataWrapper::set_point_index_components | ( | uint16_t | azimuth, |
uint16_t | elevation | ||
) |
Encode azimuth and elevation into the point_index field.
azimuth | Azimuth index (16 bits) |
elevation | Elevation index (12 bits) |
|
inline |
Set radial velocity.
value | Velocity in m/s |
|
inline |
Set signal-to-noise ratio.
value | SNR value in linear scale (electrical power) |
|
inline |
Set timestamp in nanoseconds.
value | Timestamp value |
|
inline |
Set X position.
value | X coordinate in meters |
|
inline |
Set Y position.
value | Y coordinate in meters |
|
inline |
Set Z position.
value | Z coordinate in meters |
|
inline |
Get signal-to-noise ratio (linear, electrical power)
This value represents the SNR of the detected point and is normally thresholded for detection at 1e-3 Probability of False Alarm.
|
inline |
Get timestamp in nanoseconds since frame start.
|
inlineinherited |
Serialize this wrapper to a buffer using Cap'n Proto format.
buffer | Pointer to the buffer to write serialized data to |
buffer_size | Size of the buffer in bytes |
std::runtime_error | if the buffer is too small |
|
override |
Write wrapper fields to a Cap'n Proto builder.
builder | The PointData builder to write data to |
|
pure virtualinherited |
Write wrapper fields to a Cap'n Proto builder.
builder | The Cap'n Proto builder to write data to |
|
inline |
Get X position in meters.
|
inline |
Get Y position in meters.
|
inline |
Get Z position in meters.
|
private |
Calibrated reflectance (not implemented)
|
private |
Point validity status (see drop_reason())
|
private |
Minimum ramp SNR (internal test use)
|
private |
Noise floor estimate for SNR calculation.
|
private |
Point index within frame (encoded azimuth/elevation)
|
private |
Radial velocity in m/s (Doppler measurement)
|
private |
Signal-to-Noise Ratio (electrical power, see snr_linear())
|
private |
Timestamp in nanoseconds since frame start.
|
private |
X position in meters (Cartesian coordinate)
|
private |
Y position in meters (Cartesian coordinate)
|
private |
Z position in meters (Cartesian coordinate)