diff --git a/README.md b/README.md index d104967..8b489f7 100644 --- a/README.md +++ b/README.md @@ -193,8 +193,8 @@ The output bag file contains `sensor_msgs::msg::PointCloud2` messages on topics - `y` (float32): Y coordinate in meters - `z` (float32): Z coordinate in meters - `intensity` (float32): Intensity value in [0.0, 255.0] -- `t_us` (uint32): Relative timestamp in microseconds from the scan start time (xyzit, en_xyzit only). **Will be removed in v1.0.0**; use `timestamp` instead. -- `timestamp` (uint32): Relative timestamp in nanoseconds from the scan start time (xyzit, en_xyzit only) +- `t_us` (uint32): Relative timestamp in microseconds from the scan start time (xyzit, en_xyzit only). **Will be removed in v1.0.0**; use `time_stamp` instead. +- `time_stamp` (uint32): Relative timestamp in nanoseconds from the scan start time (xyzit, en_xyzit only) **Extended fields** (en_xyzit only): availability mask, refl_type, elongation, lidar_status, lidar_mode, packet version, and lidar_type. Full layout, flag semantics, and value tables are in [docs/en_xyzit.md](docs/en_xyzit.md). @@ -203,13 +203,13 @@ The output bag file contains `sensor_msgs::msg::PointCloud2` messages on topics All timestamps in PointCloud2 messages are based on UTC (Coordinated Universal Time). - **`header.stamp`**: Absolute timestamp representing the scan start time in UTC. This timestamp is generated by the LiDAR and represents when the scan began. -- **`t_us` field**: Relative timestamp in microseconds from the scan start time (`header.stamp`). **Will be removed in v1.0.0**; use `timestamp` instead. -- **`timestamp` field**: Relative timestamp in nanoseconds from the scan start time (`header.stamp`) +- **`t_us` field**: Relative timestamp in microseconds from the scan start time (`header.stamp`). **Will be removed in v1.0.0**; use `time_stamp` instead. +- **`time_stamp` field**: Relative timestamp in nanoseconds from the scan start time (`header.stamp`) The absolute timestamp for each point (in nanoseconds, UTC) can be calculated as: ```text -absolute_timestamp_ns = (header.stamp.sec * 1,000,000,000 + header.stamp.nanosec) + timestamp +absolute_timestamp_ns = (header.stamp.sec * 1,000,000,000 + header.stamp.nanosec) + time_stamp ``` Or, using `t_us` (until v1.0.0): diff --git a/docs/en_xyzit.md b/docs/en_xyzit.md index 7cdd57f..1e5e28b 100644 --- a/docs/en_xyzit.md +++ b/docs/en_xyzit.md @@ -1,6 +1,6 @@ # en_xyzit point type -The `en_xyzit` point type is an **experimental** extension of the default PointCloud2 output. Enable it with `--point-type en_xyzit`. It adds the same normal fields as `xyzit` (x, y, z, intensity, timestamp) plus extended properties for reflection classification, elongation, lidar status/mode, packet version, and lidar type. +The `en_xyzit` point type is an **experimental** extension of the default PointCloud2 output. Enable it with `--point-type en_xyzit`. It adds the same normal fields as `xyzit` (x, y, z, intensity, time_stamp) plus extended properties for reflection classification, elongation, lidar status/mode, packet version, and lidar type. **Subject to change.** This document is the canonical reference for the layout and semantics of `en_xyzit`. diff --git a/src/bag_converter/include/point_types.hpp b/src/bag_converter/include/point_types.hpp index b0948c5..1c04bfa 100644 --- a/src/bag_converter/include/point_types.hpp +++ b/src/bag_converter/include/point_types.hpp @@ -55,16 +55,16 @@ struct EIGEN_ALIGN16 PointXYZI * It includes: * - x, y, z coordinates (float) * - intensity (float) - * - t_us: [DEPRECATED, will be removed in v0.6.0] Replaced by `timestamp`. + * - t_us: [DEPRECATED, will be removed in v0.6.0] Replaced by `time_stamp`. * Relative timestamp from scan start in microseconds (uint32_t) - * - timestamp: relative timestamp from scan start in nanoseconds (uint32_t) + * - time_stamp: relative timestamp from scan start in nanoseconds (uint32_t) */ struct EIGEN_ALIGN16 PointXYZIT { PCL_ADD_POINT4D; float intensity; - uint32_t t_us; ///< @deprecated Will be removed in v0.6.0. Replaced by `timestamp`. - uint32_t timestamp; + uint32_t t_us; ///< @deprecated Will be removed in v0.6.0. Replaced by `time_stamp`. + uint32_t time_stamp; EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; @@ -87,7 +87,7 @@ constexpr uint16_t HAS_LIDAR_TYPE = 1u << 6; * Experimental. Extended fields use an availability mask (flags) and minimal unsigned types. * When a property is not supported, its flag bit is 0 and the value is 0 (must be ignored). * - * Base: x, y, z (float), intensity (float), t_us (deprecated), timestamp (uint32_t). + * Base: x, y, z (float), intensity (float), t_us (deprecated), time_stamp (uint32_t). * Extended (all uint8_t except flags): flags, refl_type (0-2), elongation (0-15), * lidar_status (0-3), lidar_mode (0-9), pkt_version_major/minor (0-255), lidar_type (0-7). * Value when not supported: 0. @@ -96,8 +96,8 @@ struct EIGEN_ALIGN16 PointEnXYZIT { PCL_ADD_POINT4D; float intensity; - uint32_t t_us; ///< @deprecated Will be removed in v0.6.0. Replaced by `timestamp`. - uint32_t timestamp; + uint32_t t_us; ///< @deprecated Will be removed in v0.6.0. Replaced by `time_stamp`. + uint32_t time_stamp; uint16_t flags; ///< en_xyzit_flags: which extended fields are valid uint8_t refl_type; ///< 0=normal, 1=ground, 2=fog. When not supported: 0. uint8_t elongation; ///< 0-15. When not supported: 0. @@ -138,12 +138,12 @@ POINT_CLOUD_REGISTER_POINT_STRUCT( POINT_CLOUD_REGISTER_POINT_STRUCT( bag_converter::point::PointXYZIT, (float, x, x)(float, y, y)(float, z, z)(float, intensity, intensity)(uint32_t, t_us, t_us)( - uint32_t, timestamp, timestamp)) + uint32_t, time_stamp, time_stamp)) POINT_CLOUD_REGISTER_POINT_STRUCT( bag_converter::point::PointEnXYZIT, (float, x, x)(float, y, y)(float, z, z)(float, intensity, intensity)(uint32_t, t_us, t_us)( - uint32_t, timestamp, timestamp)(uint16_t, flags, flags)(uint8_t, refl_type, refl_type)( + uint32_t, time_stamp, time_stamp)(uint16_t, flags, flags)(uint8_t, refl_type, refl_type)( uint8_t, elongation, elongation)(uint8_t, lidar_status, lidar_status)( uint8_t, lidar_mode, lidar_mode)(uint8_t, pkt_version_major, pkt_version_major)( uint8_t, pkt_version_minor, pkt_version_minor)(uint8_t, lidar_type, lidar_type)) diff --git a/src/bag_converter/src/seyond_decoder.cpp b/src/bag_converter/src/seyond_decoder.cpp index 5e9f7f6..9e62182 100644 --- a/src/bag_converter/src/seyond_decoder.cpp +++ b/src/bag_converter/src/seyond_decoder.cpp @@ -194,13 +194,13 @@ void SeyondPCDDecoder::point_xyz_data_parse( // Set timestamp (relative time from scan start) // point_ptr->ts_10us is relative to the packet's ts_start_us (in 10us units) // pkt_offset_us_ is the packet's offset from scan start (in us) - // point.timestamp = (pkt_offset_us_ + ts_10us * 10) * 1000 = time from scan start in ns - // point.t_us = timestamp / 1000 = time from scan start in us (deprecated) + // point.time_stamp = (pkt_offset_us_ + ts_10us * 10) * 1000 = time from scan start in ns + // point.t_us = time_stamp / 1000 = time from scan start in us (deprecated) if constexpr ( std::is_same_v || std::is_same_v) { - point.timestamp = static_cast((pkt_offset_us_ + point_ptr->ts_10us * 10) * 1000); - point.t_us = point.timestamp / 1000; + point.time_stamp = static_cast((pkt_offset_us_ + point_ptr->ts_10us * 10) * 1000); + point.t_us = point.time_stamp / 1000; } if constexpr (std::is_same_v) { namespace fl = bag_converter::point::en_xyzit_flags;