fix rosrust time

This commit is contained in:
stelzo 2024-04-29 20:45:01 +02:00
parent 91b0ae7ecf
commit 212f7b05cc
No known key found for this signature in database
GPG Key ID: FC4EF89052319374
3 changed files with 9 additions and 9 deletions

View File

@ -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())

View File

@ -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
//! ```

View File

@ -140,7 +140,7 @@ impl From<PointCloud2Msg> 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,
},