Skip to content

Commit

Permalink
fix msg conv
Browse files Browse the repository at this point in the history
  • Loading branch information
stelzo committed May 13, 2024
1 parent be3e73b commit c265666
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/ros_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,16 @@ impl From<crate::PointCloud2Msg> for r2r::sensor_msgs::msg::PointCloud2 {
count: field.count,
})
.collect(),
endian: if msg.is_bigendian {
crate::Endian::Big
} else {
crate::Endian::Little
is_bigendian: match msg.endian {
crate::Endian::Big => true,
crate::Endian::Little => false,
},
point_step: msg.point_step,
row_step: msg.row_step,
data: msg.data,
dense: if msg.is_dense {
crate::convert::Denseness::Dense
} else {
crate::convert::Denseness::Sparse
is_dense: match msg.dense {
crate::convert::Denseness::Dense => true,
crate::convert::Denseness::Sparse => false,
},
}
}
Expand Down Expand Up @@ -143,18 +141,18 @@ impl From<rosrust_msg::sensor_msgs::PointCloud2> for crate::PointCloud2Msg {
count: field.count,
})
.collect(),
is_bigendian: if msg.endian == crate::Endian::Big {
true
endian: if msg.is_bigendian {
crate::Endian::Big
} else {
false
crate::Endian::Little
},
point_step: msg.point_step,
row_step: msg.row_step,
data: msg.data,
is_dense: if msg.dense == crate::convert::Denseness::Dense {
true
dense: if msg.is_dense {
crate::convert::Denseness::Dense
} else {
false
crate::convert::Denseness::Sparse
},
}
}
Expand Down

0 comments on commit c265666

Please sign in to comment.