Skip to content

Commit 462ce90

Browse files
Merge pull request #13 from mehermvr/ros2_conversion
Fix conversion to ros2, because of rosbags version change
2 parents b422314 + a46c8d5 commit 462ce90

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

python/vbr_devkit/tools/run.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,20 @@ def convert(to: Annotated[OutputDataInterface, typer.Argument(help="Desired data
7575
show_default=True)] = True) -> None:
7676
console.print(f"Converting {input_dir} to {to} format at {output_dir}")
7777
if to == OutputDataInterface.ros2:
78-
if not input_dir.is_dir():
79-
print("Processing...")
80-
rosconvert.convert(input_dir, output_dir / input_dir.stem)
81-
else:
82-
for item in track(list(input_dir.iterdir()), description="Processing..."):
83-
if item.suffix == '.bag':
84-
rosconvert.convert(item, output_dir / item.stem)
78+
print("Processing...")
79+
rosconvert.convert(
80+
sorted([f for f in input_dir.glob("*.bag")]) if input_dir.is_dir() else [input_dir],
81+
output_dir / input_dir.stem,
82+
dst_version=None,
83+
compress=None,
84+
compress_mode="file",
85+
default_typestore=None,
86+
typestore=None,
87+
exclude_topics=[],
88+
include_topics=[],
89+
exclude_msgtypes=[],
90+
include_msgtypes=[]
91+
)
8592
else:
8693
with RosReader(input_dir) as reader:
8794
with OutputDataInterface_lut[to](output_dir, rgb_convert=rgb_conversion,

0 commit comments

Comments
 (0)