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

Improved conversion of time values between ROS and DDS formats #43

Merged
merged 3 commits into from
Apr 28, 2021

Conversation

asorbini
Copy link
Collaborator

This PR applies changes similar to ros2/rmw_connext#491 to properly handle value RMW_DURATION_INFINITE and RMW_DURATION_UNSPECIFIED when converting time values between ROS and DDS formats.

The conversion to ROS format uses helper function rmw_dds_common::clamp_rmw_time_to_dds_time() to make sure that the ROS time can be represented by DDS (note that the current implementation does not actually guarantee it, but it will after ros2/rmw_dds_common#48 is merged).

I also took the chance to delete some commented out code, and made a small change to make sure users are informed with a warning that they are trying to configure lifespan qos on an RMW that doesn't support it (i.e. rmw_connextddsmicro).

The need to open this PR for the galactic branch comes from ros2/rosbag2#756 and the fact that ros2 bag play is currently broken with rmw_connextdds in Galactic/Rolling.

I will open another PR afterwards to merge this feature to master.

Signed-off-by: Andrea Sorbini <asorbini@rti.com>
@asorbini asorbini added galactic PR pertaining the Galactic release humble PR scheduled for the H-turtle labels Apr 23, 2021
Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM pending green Galactic CI. CC'ing @cottsay for awareness.

@hidmic
Copy link
Contributor

hidmic commented Apr 23, 2021

On a related note, @emersonknapp the fact that we missed this suggests that when RMW_DURATION_INFINITE was introduced, no tests were added to test_rmw_implementation.

@emersonknapp
Copy link
Contributor

emersonknapp commented Apr 23, 2021

no tests were added to test_rmw_implementation.

Yes, you're right - I didn't know about these tests. I'll take an action item to add a test there before the distro freeze.

Copy link
Contributor

@emersonknapp emersonknapp left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for taking this on

@hidmic
Copy link
Contributor

hidmic commented Apr 23, 2021

Full Galactic CI (minus Fast-DDS, to speed things up a bit):

  • Linux Build Status
  • macOS Build Status
  • Windows Build Status

@asorbini
Copy link
Collaborator Author

@hidmic Thank you for starting CI jobs, I was just about to do the same. FYI I think Linux-aarch64 can be omitted, since it doesn't test rmw_connextdds

@hidmic
Copy link
Contributor

hidmic commented Apr 23, 2021

FYI I think Linux-aarch64 can be omitted

Good point. Aborted.

@asorbini
Copy link
Collaborator Author

There were some suspicious failures, I'll take a look :suspect:

-- run_test.py: return code -11

Signed-off-by: Andrea Sorbini <asorbini@rti.com>
@asorbini
Copy link
Collaborator Author

asorbini commented Apr 23, 2021

I had introduced a regression because I forgot that lifespan is a reader-only qos. Should be fixed in 47224b2.

Running CI again:

  • Linux: Build Status
  • macOS: Build Status
  • Windows: Build Status

EDIT: plans are running with 1323a01, which cleans up the code a little bit.

Signed-off-by: Andrea Sorbini <asorbini@rti.com>
@clalancette
Copy link
Contributor

@asorbini Can you retarget this fix to the master branch? Assuming we are happy with it there, then we can backport to galactic. Thanks.

@asorbini asorbini changed the base branch from galactic to master April 26, 2021 18:44
@asorbini
Copy link
Collaborator Author

@clalancette switched the target to master. Here's some CI with just rmw_connextdds enabled:

  • Linux Build Status
  • macOs Build Status
  • Windows Build Status

@asorbini
Copy link
Collaborator Author

2 failures on Linux:

[test_static_publisher-3] [ RUN      ] StaticTransformPublisher.multiple_parent_test
...
[test_static_publisher-3] /home/jenkins-agent/workspace/ci_linux/ws/src/ros2/geometry2/test_tf2/test/test_static_publisher.cpp:201: Failure
[test_static_publisher-3] Value of: mB.canTransform("a", "d", tf2::timeFromSec(0))
[test_static_publisher-3]   Actual: false
[test_static_publisher-3] Expected: true
[test_static_publisher-3] /home/jenkins-agent/workspace/ci_linux/ws/src/ros2/geometry2/test_tf2/test/test_static_publisher.cpp:202: Failure
[test_static_publisher-3] Value of: mB.canTransform("a", "d", tf2::timeFromSec(100))
[test_static_publisher-3]   Actual: false
[test_static_publisher-3] Expected: true
[test_static_publisher-3] /home/jenkins-agent/workspace/ci_linux/ws/src/ros2/geometry2/test_tf2/test/test_static_publisher.cpp:203: Failure
[test_static_publisher-3] Value of: mB.canTransform("a", "d", tf2::timeFromSec(1000))
[test_static_publisher-3]   Actual: false
[test_static_publisher-3] Expected: true
...
[test_static_publisher-3] [  FAILED  ] StaticTransformPublisher.multiple_parent_test (1809 ms)

@asorbini
Copy link
Collaborator Author

I have verified locally that the failure in test_tf2/test_static_publisher are not telated to the changes introduced by this PR.

As a test, I was able to reproduce the failure with branch master too. I'm not quite sure what causes it, but it seems to pass sporadically. One likely relevant tidbit of information (which also appears in the logs above) is this message which is repeated almost endlessly in the output:

4: [test_static_publisher-3] Warning: Invalid frame ID "a" passed to canTransform argument target_frame - frame does not exist
4: [test_static_publisher-3]          at line 156 in /home/asorbini/workspace-rmw/dev/tf2/geometry2/tf2/src/buffer_core.cpp

At this point I tried to "speed up" the reliability protocol (using an XML similar to the one I posted in this comment), but I haven't been able to get rid of the warnings, nor to get the test to pass reliably.

Regardless, I think this PR could be merged as is, and the test failure should be investigated separately.

@clalancette what do you think?

@clalancette
Copy link
Contributor

4: [test_static_publisher-3] Warning: Invalid frame ID "a" passed to canTransform argument target_frame - frame does not exist
4: [test_static_publisher-3] at line 156 in /home/asorbini/workspace-rmw/dev/tf2/geometry2/tf2/src/buffer_core.cpp

This output means that there are no publications on the /tf topic with the 'a' frame.

That being said, we aren't seeing that on the nightlies. So there may be something going on with the interaction of rmw_connextdds and tf2.

At the end of the day, as long as this doesn't cause tests to go yellow with the default DDS vendor on the nightlies, and it has been approved, then I'm fine with this going in.

@asorbini
Copy link
Collaborator Author

At the end of the day, as long as this doesn't cause tests to go yellow with the default DDS vendor on the nightlies, and it has been approved, then I'm fine with this going in.

The error only happens when the test is run with RMW_IMPLEMENTATION=rmw_connextdds, and not with the default RMW, so I think we're good to go for now. Thank you for confirming!

@asorbini asorbini merged commit 46892f5 into master Apr 28, 2021
@delete-merged-branch delete-merged-branch bot deleted the asorbini/rmw-duration-infinite branch April 28, 2021 17:13
asorbini added a commit that referenced this pull request Apr 28, 2021
* Improved conversion of time values between ROS and DDS formats
* Account for no lifespan when converting reader qos
* Adjust guard for LifespanQosPolicy

Signed-off-by: Andrea Sorbini <asorbini@rti.com>
clalancette pushed a commit that referenced this pull request May 11, 2021
…54)

* Improved conversion of time values between ROS and DDS formats
* Account for no lifespan when converting reader qos
* Adjust guard for LifespanQosPolicy

Signed-off-by: Andrea Sorbini <asorbini@rti.com>
emersonknapp pushed a commit to emersonknapp/rmw_connextdds that referenced this pull request Jul 20, 2021
ros2#43)"

This reverts commit 46892f5.

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
emersonknapp pushed a commit to emersonknapp/rmw_connextdds that referenced this pull request Jul 20, 2021
ros2#43)"

This reverts commit 46892f5.

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
galactic PR pertaining the Galactic release humble PR scheduled for the H-turtle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants