Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Change the "ros2" profile to allow CDR-encoded messages with no preceding Schema record #709

Open
jhurliman opened this issue Nov 4, 2022 · 2 comments
Labels
feature New feature or request

Comments

@jhurliman
Copy link
Contributor

jhurliman commented Nov 4, 2022

Overview

Today, rosbag2+mcap_storage will make a best-effort attempt to locate a .msg or .idl file given a datatype and create a Schema record from it. If the message definition does not exist on the local disk, or AMENT_PREFIX_PATH is missing or incorrect, or the ament index is incomplete/missing/corrupt, or there is a read access permission failure, a Schema record with an empty encoding field ("An empty string indicates no schema is available") and empty data field will be recorded. To reflect that sometimes CDR channels will be recorded under the "ros2" profile without a message definition payload, we should change the "ros2" profile spec to reflect this.

Impact

Downstream readers should be updated to account for this new definition of the "ros2" profile. If a "cdr" Channel is encountered with an empty Schema record, the reader may choose to search a local cache such as built-in message definitions or an ament index on disk to try and locate a .msg or .idl matching the Schema name (datatype). If no message definition is found or the reader chooses not to implement this fallback, decoding cannot occur for that channel. It's up to the application to choose how to handle this. Examples may include proceeding with decoding of all other channels, exiting with an error, performing some form of playback but treating the message payload as opaque, etc.

@jhurliman jhurliman added the feature New feature or request label Nov 4, 2022
@jtbandes
Copy link
Member

jtbandes commented Nov 4, 2022

If a "cdr" Channel is encountered with no accompanying Schema, the reader may ... try and locate a .msg or .idl matching the Channel schema name

How can there be a schema name if there's no schema?

@jhurliman
Copy link
Contributor Author

jhurliman commented Nov 4, 2022

If a "cdr" Channel is encountered with no accompanying Schema, the reader may ... try and locate a .msg or .idl matching the Channel schema name

How can there be a schema name if there's no schema?

I'm using the terms "schema name" and "datatype" interchangeably here. A ROS 2 system knows the association of "topic name" -> "datatype" before recording ever starts, and it's the datatype that is used in the ament index lookup. That same datatype is written into the Schema record in the schema_name field if a Schema record is successfully created.

I re-read your comment and realized this is about the read side, not the write side. You're right that we do need to record a Schema record so the schema_name (datatype) is recorded somewhere. I'm going to amend my proposal above to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

No branches or pull requests

2 participants