Skip to content

Commit

Permalink
Better to use uri= constructor
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
  • Loading branch information
emersonknapp committed Dec 3, 2021
1 parent 6ee730f commit 48b2b24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ros2bag/ros2bag/verb/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ def main(self, *, args):
if len(input_bag) > 2:
raise argparse.ArgumentTypeError(
f'--input expects 1 or 2 arguments, {len(input_bag)} provided')
storage_options = StorageOptions()
storage_options.uri = input_bag[0]
storage_options = StorageOptions(uri=input_bag[0])
if len(input_bag) > 1:
storage_options.storage_id = input_bag[1]
input_options.append(storage_options)
Expand Down
3 changes: 1 addition & 2 deletions rosbag2_py/src/rosbag2_py/_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ PYBIND11_MODULE(_storage, m) {
&rosbag2_cpp::ConverterOptions::output_serialization_format);

pybind11::class_<rosbag2_storage::StorageOptions>(m, "StorageOptions")
.def(pybind11::init<>())
.def(
pybind11::init<
std::string, std::string, uint64_t, uint64_t, uint64_t, std::string, std::string, bool>(),
pybind11::arg("uri"),
pybind11::arg("storage_id"),
pybind11::arg("storage_id") = "",
pybind11::arg("max_bagfile_size") = 0,
pybind11::arg("max_bagfile_duration") = 0,
pybind11::arg("max_cache_size") = 0,
Expand Down

0 comments on commit 48b2b24

Please sign in to comment.