Skip to content

Commit

Permalink
now reading ros1msg Odometry messages out of an mcap
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasw committed Jun 23, 2024
1 parent d80f231 commit e79615a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mcap_to_rerun/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let len_header = message.data.len() as u32;
let mut msg_with_header = Vec::from(len_header.to_le_bytes());
let mut message_data = Vec::from(message.data.clone());
// println!("{:?}", print_type_of(&message));
msg_with_header.append(&mut message_data);

/*
Expand All @@ -61,10 +60,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
*/

// match serde_rosmsg::from_slice::<nav_msgs::Odometry>(&msg_with_header) {
match serde_rosmsg::from_slice::<marti_common_msgs::Float32Stamped>(&msg_with_header) {
// match serde_rosmsg::from_slice::<marti_common_msgs::Float32Stamped>(&msg_with_header) {
match serde_rosmsg::from_slice::<nav_msgs::Odometry>(&msg_with_header) {
Ok(odom_msg) => {
println!("{:#?}", odom_msg.header);
println!("{:#?}", odom_msg);
},
Err(e) => {
println!("{:?}", e);
Expand Down

0 comments on commit e79615a

Please sign in to comment.