-
Notifications
You must be signed in to change notification settings - Fork 258
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
Add pause and resume service calls for rosbag2 recorder #1131
Add pause and resume service calls for rosbag2 recorder #1131
Conversation
cc @MichaelOrlov @ivanpauno -- The command line interface you recommend already existed as of #905 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rshanor Could you please add one more service for is_paused
?
srv_is_paused_ = create_service<rosbag2_interfaces::srv::IsPaused>(
"~/is_paused",
[this](
rosbag2_interfaces::srv::IsPaused::Request::ConstSharedPtr,
rosbag2_interfaces::srv::IsPaused::Response::SharedPtr response)
{
response->paused = is_paused();
});
Also please don't create a new class for class RecordSrvsPauseResumeTest : public RecordSrvsTest
we can use RecordSrvsTest
with default snapshot parameter equal to true false.
See my rework in https://github.com/ros2/rosbag2/pull/1122/files#diff-8fc22b4f6714cc8937f931b0b8afb31ca75bb9a15189816cc36cc9058b22f6dcR42
@MichaelOrlov are you close to merging that PR? I saw your changes, I can hold off and pull your update in. I will add an is_paused API. I didn't have an immediate use for it but happy to add it. |
@rshanor I would be happy to merge it if someone would approve it. |
Sorry I cant help there. |
@rshanor I am actually thinking about adding call for bag split on handling service call for resume. |
@MichaelOrlov I agree wanting to split is a common use case, I was just going to make those two calls back to back :) Are there any cases where people really want to be using the same bagfile? Should we add a flag or just always call split? |
@rshanor I can't imagine a real use case when pausing with recording to the same file would be useful or preferable rather than starting a new file each time on pause/resume. We store all files in one folder during split and they will be reflected in final Although I would keep C++ API pause/resume without split inside for more granular control when using them directly. Only one problem I would envision is as corner case when we are starting recording in pause and resuming recording after sometime - it's going to be an empty first bag. |
@MichaelOrlov if thats OK with you, thats OK with me, I also dont see a compelling use case. |
Imagine you pause/resume very frequently - leading to lots and lots of tiny bagfiles. Maybe you generally just load this data into analysis tools instead of using for live playback. I think there are plenty of reasons why time gaps in a single bagfile would be totally acceptable. I don't think it's reasonable to make splitting the only or default behavior for pause/resume. At the very least, separate that conversation / design decision out of this initial implementation PR, keep it granular. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm as is
Add service calls to pause recording and resume recording. Fixes ros2#1130 Signed-off-by: Rick Shanor <[email protected]>
@MichaelOrlov sorry for the delay, just addressed your comments. Been a busy week. I did not implement the split call as @emersonknapp suggested. While I also agree that this is what a user wants 95% of the time, it makes sense to keep that discussion separate and I dont want to block this PR further. |
Address PR comments. Add is_paused service. Update tests accordingly. Signed-off-by: Rick Shanor <[email protected]>
b384a95
to
c967c67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rshanor Thank you! Looks good to me.
As regards to starting new bag on resume. Let's move it out of scope of this PR - I agree.
Gist: https://gist.githubusercontent.com/MichaelOrlov/59ea3ed67c34c667e42a0143a4d22a1e/raw/f5b5a0aa21030aa182990f0da92bccf423f4f590/ros2.repos |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2022-11-17/28457/1 |
* feat(recorder): Add pause and resume service calls. Add service calls to pause recording and resume recording. Fixes ros2#1130 Signed-off-by: Rick Shanor <[email protected]> * feat(recorder): pause, resume, and is_paused PR comments. Address PR comments. Add is_paused service. Update tests accordingly. Signed-off-by: Rick Shanor <[email protected]> Signed-off-by: Rick Shanor <[email protected]>
* feat(recorder): Add pause and resume service calls. Add service calls to pause recording and resume recording. Fixes ros2#1130 Signed-off-by: Rick Shanor <[email protected]> * feat(recorder): pause, resume, and is_paused PR comments. Address PR comments. Add is_paused service. Update tests accordingly. Signed-off-by: Rick Shanor <[email protected]> Signed-off-by: Rick Shanor <[email protected]>
Add service calls to pause recording and resume recording.
Signed-off-by: Rick Shanor [email protected]