Conversation
zmichaels11
left a comment
There was a problem hiding this comment.
Thanks for your PR!
I left a couple comments/suggestions.
| is_in_play_ = true; | ||
| try { | ||
| do { | ||
| float delay = |
There was a problem hiding this comment.
Can you move delay out of the loop? I don't think it can change between iterations.
I'd also suggest raising a warning or exception when delay is an invalid value. That way the user knows when they enter an invalid value.
There was a problem hiding this comment.
I moved it out of the loop. And raising warning and set to 0 if dealy value is invalid. 0b4687f
| const float rate = 1.0; | ||
| const bool loop_playback = false; | ||
| double clock_publish_frequency = 0.0; | ||
| const float delay = 1.0; |
There was a problem hiding this comment.
Can you also test for an invalid delay value?
|
I know at one point there was a plan to implement node lifecycles for rosbag. Is this still the case, because this seems like a case where it would fit in really well. |
|
@zmichaels11 |
ros2bag/ros2bag/verb/play.py
Outdated
| play_options.loop = args.loop | ||
| play_options.topic_remapping_options = topic_remapping | ||
| play_options.clock_publish_frequency = args.clock | ||
| play_options.delay=args.delay |
There was a problem hiding this comment.
linter is failing on this line - it will help you to run the tests locally before putting up for review!
There was a problem hiding this comment.
Thaks for your review and advice. I modified it and checked that test_flake8.py paased. 1c0cbff
There isn't an active effort going on - I don't personally have a concrete idea what this would look like. We could take that discussion to another issue if we want to pick it up. With some quick diagrams or something showing what we would want. |
|
Looking very close - you will need to sign your commits for the DCO check to pass. You can do that with |
|
@emersonknapp |
|
Gist: https://gist.githubusercontent.com/emersonknapp/df22ce71e23066faa49f1ad4b777faee/raw/e66eb02dae79a8dbe4184fb2c6bf28be493f1741/ros2.repos |
|
The Windows runners are very slow - and so timing-based tests don't always work the way you would expect there. Is there any deterministic way to check on this test, without depending on actual timing? (worst case, we could just expand the error margin to accommodate these slow runners) |
|
@emersonknapp rosbag2/rosbag2_transport/test/rosbag2_transport/test_play_timing.cpp Lines 122 to 123 in c8b1032 I don't think there are many cases where we actually want to delay by 0.x seconds, so how about simply increasing the margin (1.0, etc.)? |
|
And this test is included in the rate test, but it's better to separate them. |
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
| auto reader = std::make_unique<rosbag2_cpp::Reader>(std::move(prepared_mock_reader)); | ||
| auto player = std::make_shared<rosbag2_transport::Player>( | ||
| std::move( | ||
| reader), storage_options_, play_options_); |
There was a problem hiding this comment.
Nitpick. It would be better if
std::move(
reader), storage_options_, play_options_);would be on one line
std::move(reader), storage_options_, play_options_);There was a problem hiding this comment.
OK, I modified all same part in 75eca9f.
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
|
@emersonknapp |
|
No - nothing left. I just didn't look at it over the holiday weekend. Please feel free to open a Galactic backport PR |
* Add delay option Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Hi, thank you for your work.
In this PR I added
--delayoption related to #786.If we run for the following, the rosbag will play after a 5 second sleep.
It also works with
--looplike