Items with no label
3335 Discussions

Follow up on missing topic when reading rosbag file

Dddd01
Beginner
2,209 Views

Hi,

 

I'm a newbie in the world of realsense and ros, trying to get the contents of /camera/color/image_raw and /camera/depth/image_raw into a bag file and later extract them to png and csv respectfully. I found this discussion https://forums.intel.com/s/question/0D50P0000490VbySAE/recreate-depth-image-from-infra1-and-infra2-bagfile however I'm still receiving "Invalid file format, file does not contain topic '/file_version' (...)" when trying to open it in RealSense Viewer, both when using rosbag record and rqt_bag. Is there any other way to get this data? I'm using Euclid Development Kit

 

 

 

0 Kudos
7 Replies
MartyG
Honored Contributor III
1,710 Views

Can you help me to understand your hardware and software setup, please? It sounds as though you have installed the Linux version of the RealSense Viewer in Ubuntu on an Intel Euclid. Is this correct?

0 Kudos
Dddd01
Beginner
1,710 Views

I only used Euclid to obtain rosbags both using rosbag record and rqt_bag, then i transferred them to PC where I have Ubuntu version RealSense Viewer. I also tried opening the files with RealSense Viewer on Windows 10 computer.

So no Viewer on Euclid

0 Kudos
MartyG
Honored Contributor III
1,710 Views

Dorodnic the RealSense SDK Manager advised to another user who had the same error when trying to open a bag that not every bag will be compatible with the SDK. He advised that Librealsense is only designed to handle camera data, though both of your topics seem to be camera-related ones.

 

https://github.com/IntelRealSense/librealsense/issues/3020#issuecomment-452321766

 

I located a guide to recording and playing back bags within Euclid that was provided by an Intel support staff member.

 

 https://forums.intel.com/s/question/0D70P0000068Xo3SAE

0 Kudos
Dddd01
Beginner
1,710 Views

Thanks for getting back to me MartyG

 

I have seen this github issue before, but frankly it is not much of a help or guidance, because as you noticed, my topics are both camera related.

 

As for the provided guide on Euclid - I can play back the bags on Euclid sucessfully, I just don't manage to open them in RealSense Viewer or convert using rs-converter. I have followed the guide just one more time now with the same results - bag gets recorded and played back correctly but opening it in viewer or using rs-convert results in this /file-version error.

 

Is there any way I could bypass this problem? I need to use Euclid only as a device for collecting series of images and related raw depth data to further process them. Outside of Ros environment so to say.

 

What I also tried is connecting both Euclid and PC to the same network, running the cameras scenario and then fun python code for streaming and saving images from cameras over IP. Unfortunately this way I am only getting transcoded depth data because I believe /camera/depth/image_raw is subscribed but not published. Streaming /camera/color/image_raw seems to suffice my needs, but as I said, I need color-depth raw pairs

0 Kudos
MartyG
Honored Contributor III
1,710 Views

I am guessing that recording a bag with the RealSense Viewer is not an option for you because you do not have a D415 or D435 camera, and the Euclid and its built-in ZR300 is your only camera available to record with, please?

 

There is an alternative user-contributed rosbag reader program. It can be downloaded as a zip file ('RealsenseHelper') from a link at the bottom of the opening comment here:

 

https://github.com/IntelRealSense/librealsense/issues/2215

 

Developer UnaNancyOwen also created an alternative bag conversion program that converts bags to images.

 

https://github.com/UnaNancyOwen/rs_bag2image

0 Kudos
Dddd01
Beginner
1,710 Views

Hi,

 

I spend quite some time trying to get RealSenseHelper up and running, but without much of a success. My skills to blame here, I do not manage to resolve some issues when building.

 

In the meantime I used Matlab to read the bags and extract from them color images, raw depth and transcoded depth. As far as I understand raw data are in milimeters and that is later normalized to be visualized, is this correct?

So the last problem I have is that the color and depth images do not show exactly the same thing, because of their location. I found this: https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/distance_to_object.ipynb but the problem with opening Euclid's bags remains the same. Is there any known solution to aligning the data together? Possibly with Python or Matlab

 

 

0 Kudos
MartyG
Honored Contributor III
1,710 Views

How the RealSense 400 Series cameras handle raw data is that the captured data is rectified by a hardware component inside the camera called the Vision Processor D4, and then the rectified data is sent along the USB cable to the computer. So it is adjusted before it even arrives in the computer.

 

The article linked to below discusses aligning depth and color in MATLAB:

 

https://www.codefull.org/2016/03/align-depth-and-color-frames-depth-and-rgb-registration/

0 Kudos
Reply