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

SW-4837: replace the use of ros service to retrieve sensor metadata with latched topics foxy #103

Conversation

Samahu
Copy link
Contributor

@Samahu Samahu commented Apr 13, 2023

Related Issues & PRs

Summary of Changes

  • added a new /ouster/metadata topic that is consumed by os_cloud and os_image nodes and save it to the bag file on record
  • make specifying metadata file optional during record and replay modes as of package version 8.1

Validation

all functionality maintained

@Samahu Samahu added the enhancement New feature or request label Apr 13, 2023
@Samahu Samahu self-assigned this Apr 13, 2023
@@ -30,7 +30,9 @@ class OusterReplay : public OusterSensorNodeBase {

try {
auto meta_file = parse_parameters();
populate_metadata_from_json(meta_file);
create_metadata_publisher();
load_metadata_from_file(meta_file);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So would user be able to replay the BAGs and omit the metadata_file path altogether if the metadata topic present in the replayed bag?

Also how would the 2 metadata sources will be handled if one metadata is present in .bag and it's also specified as a param metadata? :

ros2 launch ouster_ros replay.launch.xml    \
    metadata:=<json file name>              \
    bag_file:=<path to rosbag file>

Copy link
Contributor Author

@Samahu Samahu Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the user wouldn't need to supply the metadata path (I have marked it as an optional parameter and noted that in the README.md)

If the user still provides a metadata path along with a bag file that contains the metadata topic then both messages will be emitted, the last one to be published will remain in effect.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it makes sense to treat the metadata from the file as the only valid source and not make the two metadata compete? My thought is that if someone is specifying metadata para they either know that metadata topic is not present in the bag file or they want to explicitly overwrite the metadata that is recorded in the bag file with smth new.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does make sense, my issue with we can't selectively discard a specific topic.

The only way to achieve that is to explicitly set the topics to be replayed, which for us would be lidar_packets and imu_packets. This would in discard any other topics the user may have included in the bag (since the driver wouldn't know what is in the file).

Copy link
Contributor Author

@Samahu Samahu Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a sense if the user provides metadata file we will have to exclude other topics that existed in the file. If the user doesn't then we can keep all topics.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, excluding all topics if metadata param is present maybe not as clear to the user ... hard choices what is right, maybe we can add yet another param for this? like "exclude_other_topics" that will be "on" if the metadata is present, and if it all set in a launch file it's at least somewhat visible to the user and they can overwrite the params as they like if they want different behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider this option as part of node merging effort. The reason is when this is due, raw packets won't be emitted by default by the driver. They will only be specified when the user chooses to. During bag record and replay we want to have the raw packets. I am considering to rename record.launch to record_raw.launch and replay.launch to replay_raw.launch. In this case, only we are only concerned with raw packets and we would select raw packets only along with metadata (whether as a topic or being overriden by a file). This way it is clear that this record/replay functionality is only for sensor data.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@Samahu Samahu marked this pull request as ready for review April 19, 2023 15:43
@Samahu Samahu merged commit 9382f8c into ros2-foxy Apr 19, 2023
@Samahu Samahu deleted the SW-4837-replace-the-use-of-ros-service-to-retrieve-sensor-metadata-with-latched-topics-foxy branch April 19, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants