22static_assert(
sizeof(
PointData) == 36,
"PointDataV1 is frozen at 36 bytes");
37inline bool setPointsXyz(std::vector<PointData>& points,
const std::vector<VoyantVec3>& positions)
39 if (points.size() != positions.size())
73 const std::vector<PointData>&
points()
const
133 return meta_.frame_index;
139 return meta_.timestamp_seconds;
145 return meta_.timestamp_nanoseconds;
153 return static_cast<double>(
meta_.timestamp_seconds) +
static_cast<double>(
meta_.timestamp_nanoseconds) * 1e-9;
291 std::vector<VoyantVec3>
xyz()
const
293 std::vector<VoyantVec3> out(
points_.size());
326 std::ios_base::fmtflags flags(os.flags());
327 std::streamsize prec = os.precision();
328 os <<
"VoyantFrame(frame_index=" << frame.
frameIndex() <<
", n_points=" << frame.
nPoints()
329 <<
", n_valid_points=" << frame.
nValidPoints() << std::fixed << std::setprecision(6)
330 <<
", timestamp=" << frame.
timestamp() <<
", device_id=" << frame.
deviceId() <<
")";
338 std::ostringstream out;
342 out <<
"\n NO SENSOR STATE — none was recorded for this frame."
343 "\n Points are real; health, calibration, SDL and time-sync are not"
344 "\n available, and device identity and timestamps may be unset.";
A point-cloud frame: points plus the sensor/host state snapshots and frame metadata recorded with the...
Definition voyant_frame.hpp:68
static std::optional< VoyantFrame > synthetic(std::vector< PointData > points)
synthetic() with an all-default identity: Unknown source, zeroed timeline.
Definition voyant_frame.hpp:213
bool carriesState() const
Definition voyant_frame.hpp:103
uint32_t frameIndex() const
Device frame counter.
Definition voyant_frame.hpp:131
friend class CarbonClient
Definition voyant_frame.hpp:318
std::optional< SensorState > sensorState() const
Definition voyant_frame.hpp:110
std::vector< VoyantVec3 > xyz() const
Definition voyant_frame.hpp:291
size_t nPoints() const
Definition voyant_frame.hpp:82
static std::optional< VoyantFrame > stateless(std::vector< PointData > points)
stateless() with an all-default identity: Unknown source, zeroed timeline.
Definition voyant_frame.hpp:252
std::string describe() const
A one-screen summary of the frame and its state snapshots.
Definition voyant_frame.hpp:336
std::string deviceId() const
Definition voyant_frame.hpp:158
int64_t timestampSeconds() const
Whole seconds of the frame-start time since the Unix epoch.
Definition voyant_frame.hpp:137
int32_t timestampNanoseconds() const
Sub-second remainder of the frame-start time, in nanoseconds (0..=999999999).
Definition voyant_frame.hpp:143
static std::optional< VoyantFrame > stateless(std::vector< PointData > points, const StatelessFrameDesc &desc)
Build a frame from points that arrived without the sensor's heartbeat — a bag, a CSV — so it declares...
Definition voyant_frame.hpp:239
friend class VoyantPlayback
Definition voyant_frame.hpp:319
static std::optional< VoyantFrame > synthetic(std::vector< PointData > points, const SyntheticFrameDesc &desc)
Build a frame of generated data — a simulated scene, a scripted test cloud — that records and replays...
Definition voyant_frame.hpp:198
std::vector< PointData > points_
Definition voyant_frame.hpp:314
friend class VoyantRecorder
Definition voyant_frame.hpp:320
size_t nValidPoints() const
Count of valid returns (see isValidPoint()); computed per call.
Definition voyant_frame.hpp:88
std::optional< VoyantFrame > withSdl(const SdlCommandParams ¶ms) const
A new frame whose SDL state reads as if the sensor had applied params (status Applied); everything el...
Definition voyant_frame.hpp:271
VoyantFrame()=default
An empty frame that carries no state; see the class docs.
VoyantFrameMeta toMeta() const
This frame's transfer fields with n_points refreshed from the vector.
Definition voyant_frame.hpp:306
VoyantFrame withPoints(std::vector< PointData > points) const
Definition voyant_frame.hpp:167
std::vector< PointData > & points()
Definition voyant_frame.hpp:77
std::optional< HostState > hostState() const
Definition voyant_frame.hpp:121
double timestamp() const
Definition voyant_frame.hpp:151
const std::vector< PointData > & points() const
Definition voyant_frame.hpp:73
VoyantFrameMeta meta_
Definition voyant_frame.hpp:313
Definition voyant_types_ffi.hpp:443
uint8_t drop_reason
Definition voyant_types_ffi.hpp:484
Definition carbon_client_ffi.hpp:49
float frame_rate_fps
Definition carbon_client_ffi.hpp:59
float hfov_deg
Definition carbon_client_ffi.hpp:51
uint8_t req_state
Definition carbon_client_ffi.hpp:50
float ramp_bandwidth_ghz
Definition carbon_client_ffi.hpp:60
float hfov_center_deg
Definition carbon_client_ffi.hpp:58
Definition voyant_types_ffi.hpp:350
DeviceInfo device
Definition voyant_types_ffi.hpp:354
SdlDeviceState sdl
Definition voyant_types_ffi.hpp:351
Definition voyant_frame.hpp:221
uint32_t frameIndex
Definition voyant_frame.hpp:226
int64_t timestampSeconds
Definition voyant_frame.hpp:224
uint32_t serialNumber
Definition voyant_frame.hpp:223
int32_t timestampNanoseconds
Definition voyant_frame.hpp:225
ProductId source
Definition voyant_frame.hpp:222
Identity and timeline of a synthetic() frame; zeros are valid.
Definition voyant_frame.hpp:179
int32_t timestampNanoseconds
Definition voyant_frame.hpp:184
ProductId source
Definition voyant_frame.hpp:182
uint32_t frameIndex
Definition voyant_frame.hpp:185
int64_t timestampSeconds
Definition voyant_frame.hpp:183
bool isValidPoint(const PointData &point)
Whether a point is a valid return.
Definition voyant_frame.hpp:25
PointDataV1 PointData
Definition voyant_frame.hpp:21
bool setPointsXyz(std::vector< PointData > &points, const std::vector< VoyantVec3 > &positions)
Definition voyant_frame.hpp:37
std::ostream & operator<<(std::ostream &os, const VoyantFrame &frame)
One-line frame summary, printed for every frame in typical receive loops.
Definition voyant_frame.hpp:324
bool voyant_synthetic_frame_meta(uint8_t source, int64_t timestamp_seconds, int32_t timestamp_nanoseconds, uint32_t frame_index, VoyantFrameMeta *out)
bool voyant_points_xyz(const PointDataV1 *points, uintptr_t n_points, VoyantVec3 *out)
bool voyant_points_set_xyz(PointDataV1 *points, uintptr_t n_points, const VoyantVec3 *positions)
SensorState voyant_frame_sensor_state(const VoyantFrameMeta *meta)
uintptr_t voyant_frame_device_id(const VoyantFrameMeta *meta, char *buf, uintptr_t capacity)
ProductId
Definition voyant_types_ffi.hpp:28
@ Unknown
Definition voyant_types_ffi.hpp:29
HostState voyant_frame_host_state(const VoyantFrameMeta *meta)
bool voyant_stateless_frame_meta(uint8_t source, uint32_t serial_number, int64_t timestamp_seconds, int32_t timestamp_nanoseconds, uint32_t frame_index, VoyantFrameMeta *out)
@ Measured
Definition voyant_types_ffi.hpp:162
bool voyant_frame_meta_with_sdl(VoyantFrameMeta *meta, uint8_t req_state, float frame_rate_fps, float hfov_deg, float hfov_center_deg, float ramp_bandwidth_ghz)