Open raghaprasad opened 4 years ago
I would consider implementing our own version of rosbag::recorder
:
Doing a POC of copying & renaming that class and building everything together should be really quick, in the order of minutes. If we do that and it goes smoothly it seems to me like the best path forward.
Additionally, I think changing implementation is less risky than pivoting on the design/architecture of the system.
Additionally, I think changing implementation is less risky than pivoting on the design/architecture of the system.
This might be true is a general context, but certainly not in this case. What we intend to do is to launch duration_recorder as a node instead of an action server.
@AAlon This might actually work! In terms of things needed to be done :
stopWriting
info
and replay
After some non-trivial modifications to recorder.cpp
(fixing cyclical shared_ptr
references, increasing NodeHandle
lifetimes, etc.), I believe we have a working solution.
EDIT: Please see https://github.com/aws-robotics/rosbag-uploader-ros1/pull/76. Lots of code and CMake file cleanup may be required.
@raghaprasad and @ryanewel, can you confirm that all that remains of this ticket is to improve code coverage?
I ran into several roadblocks with duration recorder implementation recently. In light of these discoveries I believe its not possible to proceed as planned for duration recorder to be action server based.
Issue
Duration Recorder cannot be implemented as an action server (intended for reuse)
Root cause
Duration recorder uses rosbag::Recorder for generating the rosbags.
However, rosbag::Recorder has been designed to shutdown after generating the rosbag file.
This means any action needed to be taken post creation of the rosbag file, like uploading to s3 or cleaning up the generated files cannot be performed.
ros::shutdown
is async shutdown of the ros node and therefore any actions invoked after the shutdown are unlikely to succeed.Callouts & action items
rosbag::recorder
does not have clear documentation which meant that we missed this flaw during designrosbag::recorder
not to shutdown: a library that does not callros::start
should not be designed to callros::shutdown
. We need to propose a fix to rosbag for next version of ros and make sure this is not the case for ROS2 F