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

/clock publisher in Player #695

Merged
merged 8 commits into from
Apr 8, 2021
Merged

Conversation

emersonknapp
Copy link
Collaborator

@emersonknapp emersonknapp commented Mar 26, 2021

Closes #99
Design: #675

Add a rosgraph_msgs/Clock publisher to the Player - that uses PlayerClock::now() to publish current time.

Expose this publish frequency to the CLI

@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch from c563f42 to 009c60d Compare March 31, 2021 11:14
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch 2 times, most recently from 7492fa2 to 9e5ffec Compare April 1, 2021 07:17
@emersonknapp emersonknapp changed the title Clock publisher in Player [WIP] /clock publisher in Player Apr 1, 2021
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock branch 2 times, most recently from 5e1012c to 20f37f3 Compare April 2, 2021 07:59
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch 2 times, most recently from ce6db18 to 4b35b13 Compare April 2, 2021 21:58
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch 2 times, most recently from e69696b to 478285a Compare April 3, 2021 01:14
@delete-merged-branch delete-merged-branch bot deleted the branch master April 3, 2021 02:42
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch 2 times, most recently from 9eb778e to 2001d5f Compare April 5, 2021 22:05
@emersonknapp emersonknapp changed the base branch from emersonknapp/player-clock to emersonknapp/playerclock-thread-safety-tweaks April 5, 2021 22:06
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch from 2001d5f to daa6f04 Compare April 5, 2021 22:09
@emersonknapp emersonknapp force-pushed the emersonknapp/playerclock-thread-safety-tweaks branch from cb3386f to e2ab944 Compare April 5, 2021 23:50
@delete-merged-branch delete-merged-branch bot deleted the branch master April 6, 2021 01:22
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch from daa6f04 to 55502f9 Compare April 6, 2021 01:29
@emersonknapp emersonknapp changed the base branch from emersonknapp/playerclock-thread-safety-tweaks to emersonknapp/player-clock-max-spin April 6, 2021 01:32
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-max-spin branch 4 times, most recently from 9e76353 to 8f21997 Compare April 6, 2021 02:48
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch 2 times, most recently from cad4618 to bddf622 Compare April 6, 2021 18:22
@emersonknapp emersonknapp removed the request for review from piraka9011 April 6, 2021 20:52
Copy link
Collaborator

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

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

this generally looks good to me. As mentioned in the comments, I don't think we can so easily just fire up an executor in the play function, but we can address this in a follow up PR.

Testing is indeed a bit tricky, but maybe an end-to-end test in which you test that you get at least a non-zero amount of /clock callbacks and all these timestamps are in the appropriate time range?

@Karsten1987
Copy link
Collaborator

@emersonknapp can we officially put this up for review and run CI on it? I've also noticed a few ROSBAG2_TRANSPORT_LOG... macros on your branch. Does this branch have to be rebased?

@emersonknapp
Copy link
Collaborator Author

emersonknapp commented Apr 6, 2021

Does this branch have to be rebased?

It looks like it!

can we officially put this up for review and run CI on it?

I was just waiting to have a reasonable test - which it looks like I have now. I'll push it in a couple minutes.

Emerson Knapp added 2 commits April 6, 2021 15:50
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch from 302a763 to a37da03 Compare April 6, 2021 22:50
@emersonknapp emersonknapp marked this pull request as ready for review April 6, 2021 22:50
@emersonknapp
Copy link
Collaborator Author

emersonknapp commented Apr 6, 2021

Gist: https://gist.githubusercontent.com/emersonknapp/8785419a3ef05c024b54657b89f76d54/raw/d318e3e26f06cb8534b480ec3dffcf7dcb64e942/ros2.repos
BUILD args: --packages-up-to ros2bag rosbag2_py rosbag2_transport rosbag2_tests rosbag2
TEST args: --packages-select ros2bag rosbag2_py rosbag2_transport rosbag2_tests rosbag2
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/8143

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Copy link
Collaborator

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

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

lgtm, I just had one remark towards the test. I am ok to move on with the rest.

@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch 2 times, most recently from 53c111b to 6faa696 Compare April 7, 2021 01:06
@emersonknapp
Copy link
Collaborator Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Also check that rate is respected

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp emersonknapp force-pushed the emersonknapp/player-clock-publish branch from 6faa696 to 7a896d5 Compare April 7, 2021 02:30
@emersonknapp
Copy link
Collaborator Author

Not checking received times (weirdly slow on Windows) - instead checking the deltas between the contents of the clock messages, which should be more reliable. Also checking on playback rate being reflected in these values.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@emersonknapp
Copy link
Collaborator Author

Not sure exactly why this test works so poorly on OSX/Win - trying a OSX build locally to investigate

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp
Copy link
Collaborator Author

emersonknapp commented Apr 7, 2021

Quick directed test

  • Windows: Build Status
  • OSX: Build Status

Emerson Knapp added 3 commits April 7, 2021 15:10
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp
Copy link
Collaborator Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@emersonknapp emersonknapp merged commit 07c05da into master Apr 8, 2021
@delete-merged-branch delete-merged-branch bot deleted the emersonknapp/player-clock-publish branch April 8, 2021 00:27
Kettenhoax pushed a commit to Kettenhoax/rosbag2 that referenced this pull request Apr 9, 2021
* Add /clock publishing to Player

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
mitsudome-r pushed a commit to mitsudome-r/rosbag2 that referenced this pull request Apr 10, 2021
* Add /clock publishing to Player

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
hayato-m126 pushed a commit to tier4/rosbag2 that referenced this pull request Apr 22, 2021
* Design for rosbag2 handling of clock/simtime (ros2#675)

* Add a design dock for rosbag2 handling of clock/simtime

Signed-off-by: Emerson Knapp <eknapp@amazon.com>

* PlayerClock initial implementation - Player functionally unchanged (ros2#689)

* Initial PlayerClock integration - functionality unchanged

* Create PlayerClock, a pure virtual interface with `now()`, and `sleep_until()` for Player to use to control timing of message playback
* TimeControllerClock implementation of PlayerClock
* Removes time handling from `Player` in favor of using this new class

Signed-off-by: Emerson Knapp <eknapp@amazon.com>

* /clock publisher in Player (ros2#695)

* Add /clock publishing to Player

Signed-off-by: Emerson Knapp <eknapp@amazon.com>

* fix for foxy abi

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* fix bug

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

Co-authored-by: Emerson Knapp <537409+emersonknapp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

play - publish /clock topic
3 participants