diff --git a/src/convert.rs b/src/convert.rs index 8ada125..bb27969 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -125,7 +125,7 @@ pub(crate) fn check_coord( match coord { Some(y_idx) => { let field = &fields[y_idx]; - if field.datatype != (*xyz_field_type).into() { + if field.datatype != u8::from(*xyz_field_type) { return Err(ConversionError::InvalidFieldFormat); } Ok(field.clone()) diff --git a/src/lib.rs b/src/lib.rs index dd41293..f3967e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,19 +1,19 @@ //! A library to work with the PointCloud2 message type from ROS. //! -//! ros_pointcloud2 mainly provides iterator-based `Reader` and `Writer` to interact -//! with the internal message type `PointCloud2Msg` without forcing an iteration. +//! ros_pointcloud2 mainly provides iterator-based [`ros_pointcloud2::Reader`] and [`ros_pointcloud2::Writer`] to interact +//! with the internal message type [`ros_pointcloud2::PointCloud2Msg`] without forcing an iteration. //! //! For ROS interoperability, the message type generated by the respective crate must be converted to -//! the internal message type `PointCloud2Msg` using the `From` trait, +//! the [`ros_pointcloud2::PointCloud2Msg`] using the `From` trait, //! which is mostly a ownership transfer without copying the point data. //! //! There are implementations for the `r2r`, `rclrs` (ros2_rust) and `rosrust_msg` message types //! available in the feature flags. If you miss a message type, please open an issue or a PR. -//! See the `ros_types` module for more information. +//! See the [`ros_pointcloud2::ros_types`] module for more information. //! -//! Common point types like `PointXYZ` are provided in the `pcl_utils` module. You can implement any custom point type -//! that can be described by the specification of the `PointCloud2Msg` message type. -//! See the `Reader` or `Writer` struct documentation for an example. +//! Common point types like `PointXYZ` are provided in the [`ros_pointcloud2::pcl_utils`] module. You can implement any custom point type +//! that can be described by the specification. +//! See the [`ros_pointcloud2::Reader`] or [`ros_pointcloud2::Writer`] struct documentation for an example. //! //! # Example //! ``` diff --git a/src/ros_types.rs b/src/ros_types.rs index 8d6d9eb..0e2bbfc 100644 --- a/src/ros_types.rs +++ b/src/ros_types.rs @@ -140,7 +140,7 @@ impl From for rosrust_msg::sensor_msgs::PointCloud2 { rosrust_msg::sensor_msgs::PointCloud2 { header: rosrust_msg::std_msgs::Header { seq: msg.header.seq, - stamp: rosrust_msg::Time { + stamp: TimeMsg { sec: msg.header.stamp.sec, nsec: msg.header.stamp.nsec, },