-
Notifications
You must be signed in to change notification settings - Fork 255
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
rosbag2_cpp::Writer can not close correctly, rasing "Segmentation fault(core dumped)" Error #1586
Comments
@M201871109 Sorry, but Galactic reached EOL and we don't support it. |
@M201871109 As a workaround I can suggest to try calling |
@MichaelOrlov I can confirm this on humble. Just ran into the same issue. I haven't investigated further, but it breaks somewhere between creating the next folder and logging |
If you want to reproduce the issue, I extended the |
…clears the map of existing topics to allow another bag to start from scratch Signed-off-by: Yannick Schulz <yschulz854@gmail.com>
Thank you very much for your suggestion, I will try it in newer distros. But there is another strange question, I try to reproduce the bug in another demo C++ project, this time I can deconstruct the Writer correctly,and the code in both project alomost the same, which really confused me. |
Thank you very much for your suggestion. But the rosbag2_cpp::Writer in galactic distro has no close() method. And I try to close the writer in the following way: |
@M201871109 can you provide a SSCCE for this? |
Here are the source code. rosbag_saver.h
rosbag_saver.cpp
main.cpp
But there is something strange, I try to run the code in different demo project, it can close correctly in project A, but can not in project B and no metadata.yaml created. |
I also cannot reproduce the issue with your sample. |
@M201871109 As regards
When you mentioned different projects what did you mean under the term Advise: Make sure that everything builds in the same mode. i.e. "Debug" or "ReleaseWithDebug". |
|
Description
I want to write some pointcloud msg to the local rosbag,when I use the rosbag2_cpp:Writer to realize this funciton, it can write the msg to the local .db3 file, and can be visualized in the rviz2. But the rosbag2_cpp::Writer can not deconstructed correctly, rasing "Segmentation fault(core dumped)" Error. And no "metadata.yaml" created.
Expected Behavior
I hope that I can deconstructed the Writer correctly.
Actual Behavior
the following is the code I used:
std::unique_ptr<rosbag2_cpp::Writer> writer_ = std::make_unique<rosbag2_cpp::Writer>();
writer_->open(rosbag_dir); // rosbag_dir is a path that does not exist
.... // msg data process ...
writer_->writer(msg, topic, time)// write the pointcloud message the the bag file
writer.reset() // raise "Segmentation fault(core dumped)" Error
Especially, even if I deconstructed the Writer() after the open() function, the same bug occured, eg:
writer_->open(rosbag_dir);
writer.reset() // raise "Segmentation fault(core dumped)" Error
To Reproduce
** Steps to reproduce the behavior, e.g.
System (please complete the following information)
Additional context
I try to test in another C++ project, and it can close correctly. But the code is all the same.
The text was updated successfully, but these errors were encountered: