Skip to content

Fix conversion to ros2, because of rosbags version change#13

Merged
EmanueleGiacomini merged 1 commit intorvp-group:mainfrom
mehermvr:ros2_conversion
Feb 21, 2025
Merged

Fix conversion to ros2, because of rosbags version change#13
EmanueleGiacomini merged 1 commit intorvp-group:mainfrom
mehermvr:ros2_conversion

Conversation

@mehermvr
Copy link
Contributor

Trying to convert the data to ros2 throws an error seemingly because of rosbags version change from 0.9.x to 0.10.x. The change is pretty simple which I suggest here, or the alternative can be to just pin the version in pyproject.toml.

For example, running (with main commit b422314)

vbr convert ros2 campus_train0 ros2_campus_train0

throws the error

File ".../vbr-devkit/python/vbr_devkit/tools/run.py", line 84, in convert
    rosconvert.convert(item, output_dir / item.stem)
TypeError: convert() missing 9 required positional arguments: 'dst_version', 'compress', 'compress_mode', 'default_typestore', 'typestore', 'exclude_topics', 'include_topics', 'exclude_msgtypes', and 'include_msgtypes'

I suggest two changes:

  • I kept the defaults for all the additional arguments to rosconvert.convert().
  • And because rosbags can handle split ros1 bag files, I changed the if-else conditional to allow passing a list of bags to convert() instead of converting each bag individually.

@EmanueleGiacomini EmanueleGiacomini merged commit 462ce90 into rvp-group:main Feb 21, 2025
3 of 4 checks passed
@EmanueleGiacomini
Copy link
Contributor

Thanks for spotting this issue 🥇

@mehermvr mehermvr deleted the ros2_conversion branch February 22, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants