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

QoS profiles recorded from Fast-DDS are unplayable in Cyclone (and vice-versa) #656

Closed
Kaju-Bubanja opened this issue Feb 15, 2021 · 1 comment · Fixed by #684
Closed
Assignees
Labels
bug Something isn't working

Comments

@Kaju-Bubanja
Copy link
Contributor

Kaju-Bubanja commented Feb 15, 2021

Bug Report

The problem described in ros2/rmw#210 means that RMW implementations leak implementation-internal values for Infinity duration for QoS policies. These values are not consistent across implementations, and are written verbatim into the QoS policy bag metadata. When used to construct a publisher for playback, the values from one implementation are not valid inputs for another, meaning the bag cannot be successfully played on the other implementation.

A workaround is currently possible by manually changing all the QoS duration values in metadata.yaml to 0. However, we want to solve this problem so that no manual intervention is required.

Even once ros2/rmw#210 is solved (solution in review now), the damage will have already been done because bags have been recorded with the bad values - we need a fix in rosbag2 to handle this.

Solution proposal

Discover the "Infinity" values for each of the default RMW implementations and encode these into constants in the QoS metadata parser (for the current metadata version only, we can make sure that in the next metadata version no bad values ever occur). When one of these values is encountered, translate it to RMW_DURATION_INFINITE (assuming ros2/rmw#301 is merged).

Original Ticket

Description

When trying to play my bags which I recorded with the foxy version of rosbag and I am currently using the master branch of rosbag and other packages I get following error:

1613396093.698861 [0] dq.builtin: invalid parameter list (vendor 1.16, version 2.1): pid 23 (DEADLINE) invalid, input = 3,0,0,128,6,250,130,75
1613396093.698878 [0] dq.builtin: SPDP (vendor 1.16): invalid qos/parameters

When I record new bags with the master version of rosbag the error doesn't happen and the bag plays normally.

Expected Behavior

I would kinda expect foxy bags to be still playable. I'm not sure if I messed something up or if this is a normal and intended breaking change between foxy and master.

Actual Behavior

See above error message

To Reproduce

  1. Record a bag with the foxy version of rosbag
  2. Update rosbag to master
  3. Play the bag
  4. Get error

System (please complete the following information)

  • OS: Ubuntu 20.04
  • ROS 2 Distro: master
  • Version: master

Additional context

I checked the data in the sqlite3 database and I'm confused why the error happens. The format of most things looks the same, except in the offered_qos_profiles there is a change of history and depth which was 3 and 0 in foxy but is 1 and 100 in master. I tried setting the history and depth to 1 and 100 manually but this did not help. I noticed also the deadline and lifespan to be different. But I didn't try to change those manually. I have two questions: 1. Is this a planned breaking change? and 2. Is there a way to convert older(foxy) rosbags to the new master format?

@Kaju-Bubanja Kaju-Bubanja added the bug Something isn't working label Feb 15, 2021
@emersonknapp
Copy link
Collaborator

emersonknapp commented Feb 15, 2021

This problem is revealed because of the switch from Fast-RTPS to CycloneDDS as the default RMW implementation in Rolling. This PR ros2/rmw#210 is trying to address the inconsistency that leads to this problem, but we will need a fix to rosbag2 to handle the bad values from current/old recordings, even after that problem is fixed.

Workarounds for now:

  1. If you set the environment variable RMW_IMPLEMENTATION=rmw_fastrtps_cpp the bag should play successfully.

  2. Or, edit the metadata.yaml file in your bag - this will let you play the bag back with any RMW implementation:

  • replace sec: 2147483647 with sec: 0
  • replace sec: 4294967295 with nsec: 0

@emersonknapp emersonknapp changed the title Breaking change between foxy and master? QoS profiles recorded from Fast-DDS are unplayable in Cyclone (and vice-versa) Feb 26, 2021
@emersonknapp emersonknapp self-assigned this Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants