Closed Zander-1024 closed 4 months ago
You use this library to get raw data for messages recorded in rosbag files (see MessageData
) from topics you are interested in. You then need interpret those bytes based on connection information (see Connection
). For example, in one of my projects I was using this crate to retrieve camera images from a dataset recorded as rosbag files.
This library is relatively low level, so I recommend reading rosbag docs before using it.
I know, but deserializing based on connection is very difficult in rust. In python, it is possible to parse messagedata into an object (dataclass), but I find it difficult to do this in rust. Although we can pre-define the struct and ensure that the structure is consistent based on md5, this method is very inflexible. When there are multiple different versions, it is necessary to define the results of multiple versions. This method of processing feels very cumbersome. not good. Is there no way in rust to dynamically parse messagedata based on connction info?
Not in this crate. The rosrust repository could help you (in particular the rosrust_msg
crate), but I haven't used it myself, so I can't say more about it.
thank u
This rosbag parsing library is great, but I've been thinking a lot about how to use it for deserialization in rust. Rust prefers compile-time explicit structs over dynamically generated objects. This problem also led to me not knowing how to use this library in rust. I'm really curious how you as an author would use this program? Can you tell me your opinion?