-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Unable to open ros file after saving using pyrealsense2 #3044
Comments
I am using C++ and experiencing similar issues. After a recording, I cannot open the file directly as I will get the same error. I've got to close and open my application (restart) in order to successfully open the bag file. I think there is something wrong during the desconstruction of Hopefully there will be some traction in this issue which might help my case as well. Fingers crossed |
Just wanted to give a brief update. I'm using Anaconda and Spyder for code development. This issue happens when I'm running the code in Spyder and executing in the IPython console. However, if I execute it from the shell (i.e. |
[Please Ignore - RealSense system comment] |
Hi jkenney9a, We use python directly other than other IDEs. Thanks! |
Well shouldn't running the command |
I seem to be having an issue similar to @jkenney9a . I want to add that I'm not using an IDE, but I am using classes with pipeline and config variables that persist beyond the stop call. I did not notice this error when testing without classes. @dorodnic notes elsewhere that Also worth noting: |
Hi realsens01, Thanks for the feedback. I have not been able to reproduce the issue with python code that jkenney9a shared. Wonder if you can share out your sample and we will take a look at it. Thanks! |
Hi realsens01, I still can't reproduce this python one. Thanks! |
I don't have constant access to the Realsense cameras, as we are using them to collect data for a study. This is a relatively low priority issue for me, because -- as expected -- destruction of the objects was a sufficient work-around. As @jkenney9a and I noted, a call to .stop did not write the bag properly, but a call to .stop plus the deliberate destruction of all Realsense objects does result in a working bag. I still consider this an issue, but not one that I can spend more time on. Did you try @jkenney9a 's code in IPython? That seems like the simplest way to reproduce the error. IPython is an important part of the equation, as it is likely preventing the wrapper from cleaning up. As dorodnic noted, the issue is likely caused by wrappers that do not completely clean up Realsense objects. As @jkenney9a and I noted, this does not seem like expected or appropriate behavior. When we call .stop, we have the expectation that we've written a valid bag file. But the persistence of the Realsense objects (due to IPython in @jkenney9a 's case and persistent class variables in mine) seems to prevent this. I can't test this right now, but the following code probably results in an improperly indexed bag:
|
The code I provided above didn't do quite what I expected. It returns this error: |
Hi realsens01, Thanks for the updates and feedback. It is good to know that you resolved the issue. Thanks! |
I didn't resolve the issue. I worked around it. This will likely still affect people that are not aware of it, and could potentially waste a lot of time -- as it did for me. Did you reproduce the issue yet? @jkenney9a: Did you resolve the issue? |
For the record, this just happened to me again. Ironic timing, given that @RealSenseCustomerSupport just closed the issue. I did not change my code, so I am not certain why the bag was "unindexed" this time. But the rosbag utility was able to re-index the file, so I did recover the data. |
I am also having trouble opening files on pyrealsense2. I'm sharing files with someone else who has the camera, but bag files sent appear to be unindexed (no .bag extension). I am unable to open these files, when I add the .bag extension, I get the following error: Failed to create ros reader: Error reading from file: wanted 4 bytes, read 0 bytes But then when I try to use sample files provided by intel, in the realsense colab API notebook I see the same error!
|
Sorry for my late reply. I never pursued this further; we primarily run things from the shell now, so it's no longer an issue. Was more of an annoyance than anything during code development. |
I try to use Install it first on linux with following command |
Thanks so much @lamuyang for sharing what worked for you! |
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
Issue Description
I'm having an issue with opening up a bag file with the realsense viewer after recording it in Python. I get this error:
This looks similar but not quite the same as issue 2326 but I'm unable to resolve it.
The code is as follows:
Oddly, I'm able to open the bag file if I run this code, and then re-run it and change
pipeline.start(config)
topipeline.start()
The text was updated successfully, but these errors were encountered: