CIFASIS / dataset-processing

Tools to process the Weed removing robot dataset
16 stars 4 forks source link

Cannot use the downloaded bagfile #9

Closed Alex-Beh closed 1 year ago

Alex-Beh commented 1 year ago

Thanks for open source this great dataset. However when I tried to use the downloaded dataset, I am facing the following issue

root@user-desktop:~/catkin_ws# rosbag info dataset/sequence05.bag 
Traceback (most recent call last):
  File "/opt/ros/noetic/bin/rosbag", line 35, in <module>
    rosbag.rosbagmain()
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/rosbag_main.py", line 1032, in rosbagmain
    cmds[cmd](argv[2:])
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/rosbag_main.py", line 179, in info_cmd
    b = Bag(arg, 'r', skip_index=not options.freq)
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 467, in __init__
    self._open(f, mode, allow_unindexed)
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1428, in _open
    if   mode == 'r': self._open_read(f, allow_unindexed)
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1456, in _open_read
    self._version = self._read_version()
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1564, in _read_version
    version_line = self._file.readline().rstrip().decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf2 in position 2: invalid continuation byte

For the zipped file, I am facing the following issue when I try to unzip the folder image

I have already renamed the file with correct extension. Any hints for this issue? Any other method to download the file? [like google drive etc. ]

taihup commented 1 year ago

Have you downloaded the two parts (http://fs01.cifasis-conicet.gov.ar:90/~robot_desmalezador/robot/sequence05.bag.00 and http://fs01.cifasis-conicet.gov.ar:90/~robot_desmalezador/robot/sequence05.bag.01) and joined them before trying to extract it?

Alex-Beh commented 1 year ago

Yes I tried to download the bagfiles from sequence02 and run the following command:

python3 merge_bag.py merged_sequence02.bag sequence02.bag.01 sequence02.bag.00 --verbose

And it raised the following error:

Writing bag file: merged_sequence02.bag
Matching topics against patters: '*'
> Reading bag file: sequence02.bag.01
Traceback (most recent call last):
  File "merge_bag.py", line 61, in <module>
    main()
  File "merge_bag.py", line 41, in main
    with Bag(ifile, 'r') as ib:
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 467, in __init__
    self._open(f, mode, allow_unindexed)
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1428, in _open
    if   mode == 'r': self._open_read(f, allow_unindexed)
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1456, in _open_read
    self._version = self._read_version()
  File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1564, in _read_version
    version_line = self._file.readline().rstrip().decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb1 in position 1: invalid start byte

Anything that I missed out?

The merge_bag file has been uploaded here. I cannot upload file with py extension so I rename it and uploaded with txt extension. merge_bag.txt

taihup commented 1 year ago

The error points out an issue with the coding of the file. Follows https://stackoverflow.com/questions/19699367/for-line-in-results-in-unicodedecodeerror-utf-8-codec-cant-decode-byte to try to solve it.

jcremona commented 1 year ago

As explained here, you have to cat the downloaded files, and then run rosbag decompress. In your particular case (sequence 02):

cat sequence02.bag.* > sequence02.bag
rosbag decompress sequence02.bag