Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rosbag2_py reader and writer #308

Merged
merged 55 commits into from
Aug 13, 2020
Merged

rosbag2_py reader and writer #308

merged 55 commits into from
Aug 13, 2020

Conversation

mabelzhang
Copy link
Contributor

@mabelzhang mabelzhang commented Mar 3, 2020

Initial reader functionalities for rosbag2_py.

Dependencies:

sudo apt-get install python-pybind11
git clone https://github.com/ros2/pybind11_vendor.git

Example usage is here (minus the lines about StorageFilter which need #302 and Python binding) in the test.

jacobperron and others added 7 commits March 2, 2020 19:03
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit f2ec0b7)
Expose the sequential reader to iterate over messages from Python.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit dc68894)
Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 91f6763)
Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit deafbf8)
Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit da561cc)
Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 4a4e1b8)
Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
@mabelzhang mabelzhang mentioned this pull request Mar 3, 2020
@piraka9011
Copy link
Contributor

Thanks! Not too familiar with pybind but is it possible to have this binding for the general reader as opposed to a specific one? That way, we can specify whatever kind of reader we want in the Python API.

@mabelzhang
Copy link
Contributor Author

@piraka9011 Thanks for the review! f8c4391 wraps around Reader. The type e.g. "SequentialReader" is passed in as string. Usage example is added in pytest file.

@mabelzhang
Copy link
Contributor Author

Rerun CI on all platforms:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@mabelzhang
Copy link
Contributor Author

I think this is ready if I can get another approval.

Copy link
Collaborator

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had a change to test it yet, but this looks good to me so far.
But I guess it would be good to have somebody else look over it as well.

@mabelzhang
Copy link
Contributor Author

@emersonknapp Could you take a last pass on this PR? We need one more approval before merging. Thanks!

Copy link
Collaborator

@emersonknapp emersonknapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good, thanks for going through all the revisions on it

@mabelzhang mabelzhang merged commit 038bae2 into ros2:master Aug 13, 2020
@nuclearsandwich
Copy link
Member

I think this change has introduced a build failure in the nightly clang job: https://ci.ros2.org/view/nightly/job/nightly_linux_clang_libcxx/513

00:47:40.956 In file included from /home/jenkins-agent/workspace/nightly_linux_clang_libcxx/ws/src/ros2/rosbag2/rosbag2_py/src/rosbag2_py/_writer.cpp:15:
00:47:40.956 /home/jenkins-agent/workspace/nightly_linux_clang_libcxx/ws/install/pybind11_vendor/include/pybind11/pybind11.h:1093:9: error: expression result unused [-Werror,-Wunused-value]
00:47:40.956         PYBIND11_EXPAND_SIDE_EFFECTS(add_base<options>(record));
00:47:40.956         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:47:40.956 /home/jenkins-agent/workspace/nightly_linux_clang_libcxx/ws/install/pybind11_vendor/include/pybind11/detail/common.h:662:47: note: expanded from macro 'PYBIND11_EXPAND_SIDE_EFFECTS'
00:47:40.956 #define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) pybind11::detail::expand_side_effects{ ((PATTERN), void(), false)..., false }
00:47:40.956                                               ^                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:47:40.956 /home/jenkins-agent/workspace/nightly_linux_clang_libcxx/ws/src/ros2/rosbag2/rosbag2_py/src/rosbag2_py/_writer.cpp:84:3: note: in instantiation of function template specialization 'pybind11::class_<rosbag2_py::Writer<rosbag2_cpp::writers::SequentialWriter>>::class_<>' requested here
00:47:40.956   pybind11::class_<rosbag2_py::Writer<rosbag2_cpp::writers::SequentialWriter>>(
00:47:40.956   ^
00:47:40.956 In file included from /home/jenkins-agent/workspace/nightly_linux_clang_libcxx/ws/src/ros2/rosbag2/rosbag2_py/src/rosbag2_py/_writer.cpp:15:
00:47:40.956 /home/jenkins-agent/workspace/nightly_linux_clang_libcxx/ws/install/pybind11_vendor/include/pybind11/pybind11.h:1093:9: error: expression result unused [-Werror,-Wunused-value]
00:47:40.956         PYBIND11_EXPAND_SIDE_EFFECTS(add_base<options>(record));
00:47:40.956         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:47:40.956 /home/jenkins-agent/workspace/nightly_linux_clang_libcxx/ws/install/pybind11_vendor/include/pybind11/detail/common.h:662:47: note: expanded from macro 'PYBIND11_EXPAND_SIDE_EFFECTS'
00:47:40.956 #define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) pybind11::detail::expand_side_effects{ ((PATTERN), void(), false)..., false }
00:47:40.956                                               ^                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:47:40.956 /home/jenkins-agent/workspace/nightly_linux_clang_libcxx/ws/src/ros2/rosbag2/rosbag2_py/src/rosbag2_py/_writer.cpp:92:3: note: in instantiation of function template specialization 'pybind11::class_<rosbag2_py::Writer<rosbag2_compression::SequentialCompressionWriter>>::class_<>' requested here
00:47:40.956   pybind11::class_<rosbag2_py::Writer<rosbag2_compression::SequentialCompressionWriter>>(
00:47:40.956   ^
00:47:40.956 2 errors generated.
00:47:40.956 make[2]: *** [CMakeFiles/_writer.dir/build.make:63: CMakeFiles/_writer.dir/src/rosbag2_py/_writer.cpp.o] Error 1
00:47:40.956 make[1]: *** [CMakeFiles/Makefile2:82: CMakeFiles/_writer.dir/all] Error 2
00:47:40.956 make: *** [Makefile:141: all] Error 2

@nuclearsandwich
Copy link
Member

In addition to the compilation failure mentioned above there also appear to be issues on Windows Debug which I've opened #504 to track.

@evclark
Copy link

evclark commented Oct 30, 2020

Noob question, but how do I actually use rosbag2_py? I have installed it as per the instructions on the rosbag2 README,

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2-transport

but I do not see it in ros2 pkg list and when I try to import it in python I get an error ModuleNotFoundError: No module named 'rosbag2_py'

Running on Ubuntu 20.04 on Foxy.

Thanks in advance!

@mabelzhang
Copy link
Contributor Author

Hi @evclark, for future reference, please post questions as a new Issue or on ROS Answers, as opposed to commenting on a merged PR.

First, you are using Foxy, but you installed the packages for crystal? That does not look right. Your distro should be foxy.
Second, you should install ros-$CHOOSE_ROS_DISTRO-rosbag2, which is the meta package. The two packages that you did install are only two of the packages, not the full stack.

Since this PR was merged very recently, and we had just fixed some issues and re-enabled rosbag2_py 21 days ago, I don't know if it's included in ros-foxy-rosbag2 already. Your best bet is probably to build this repository from source.

@evclark
Copy link

evclark commented Oct 31, 2020

Hi @evclark, for future reference, please post questions as a new Issue or on ROS Answers, as opposed to commenting on a merged PR.

Noted, will do, thanks

First, you are using Foxy, but you installed the packages for crystal? That does not look right. Your distro should be foxy.

Ah yes, sorry, copy/paste error from the README, I did install the foxy, not crystal, packages.

Since this PR was merged very recently, and we had just fixed some issues and re-enabled rosbag2_py 21 days ago, I don't know if it's included in ros-foxy-rosbag2 already. Your best bet is probably to build this repository from source.

It appears not to be. I'll try building from source, thanks!

@jacobperron
Copy link
Member

FWIW, I don't expect this feature to land in Foxy. While we wait for Galactic to be released, you can build from source. Once a new release is made into Rolling, you should be able to install the binary.

@agutenkunst
Copy link

FWIW, I don't expect this feature to land in Foxy. While we wait for Galactic to be released, you can build from source. Once a new release is made into Rolling, you should be able to install the binary.

Building from source including rosbag2_py on foxy and not against Rolling worked for me with

git clone git@github.com:ros2/rosbag2.git -b 0.3.5 && cd rosbag2 && git merge 038bae248e2f97e03010da7765bfbe9da0d8e0b9 -X theirs --no-edit

Only small unresolvable conflict is inside a workflow file.

Is there a better solution? I think lot of people would be happy having this feature in foxy!

Disclaimer: I did not try to read a bagfile yet.

@jacobperron
Copy link
Member

In retrospect, it may be easy to backport this new package to Foxy (assuming it's not relying on anything new in Galactic).

Pinging maintainers to see if there is any opposition, @mjeronimo @ros2/tooling-approvers

@emersonknapp
Copy link
Collaborator

It may be easy, but the APIs that it binds to may have changed. I'm all for someone trying it out, no opposition from me - I'm just not 100% confident it will be easy

emersonknapp pushed a commit that referenced this pull request Feb 2, 2021
* Initialize new package rosbag2_py

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit f2ec0b7)

* Proof-of-concept implementation using pybind11

Expose the sequential reader to iterate over messages from Python.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit dc68894)

* pybind StorageOptions and ConverterOptions; linter fixes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 91f6763)

* return timestamp

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit deafbf8)

* simplify binding of structs

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit da561cc)

* pybind TopicMetadata

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 4a4e1b8)

* namespace rosbag2 -> rosbag2_cpp

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* small fixes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* initial pytests

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrap Reader instead of SequentialReader

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* small fixes for PR comments

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* change workflow to autotest feature branch

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* revert workflow

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* added writer and writer tests

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix test path setup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix and make more rigorous writer test

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrapper and test for topic filter

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* linters. change pybind package

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* simplify verbose import

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* tidy up

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* explicit subclasses of Reader and Writer

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* Use template specialization instead of inheritence

This makes the implementation slightly more compact. And adding a new specialization should be more straight forward as we only have to modify the cpp file in one place.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove temporary variable

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove unused member variable

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Move to initializer list

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* refactor into reader writer storage

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup includes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* switch back to pybind11_vendor

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* Packages dependency for CI

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* printout to debug CI test failure

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* use tempfile for writer test, add exec_depend

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* remove exec_depend

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* use pytest fixture tmp_path; add rosbag2_py to rosbag2

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add makedirs back to see CI result

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix import error

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add modules explicitly for windows CI

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* try more <test_depend>s for mac test failure

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrap structs with named arguments for Python keyword params

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add pytest.ini

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add rosbag db3-shm and db3-wal files for macOS test

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

Co-authored-by: Jacob Perron <jacob@openrobotics.org>
Co-authored-by: Andreas Klintberg <ankl@kth.se>
agutenkunst pushed a commit to agutenkunst/rosbag2 that referenced this pull request Feb 5, 2021
* Initialize new package rosbag2_py

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit f2ec0b7)

* Proof-of-concept implementation using pybind11

Expose the sequential reader to iterate over messages from Python.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit dc68894)

* pybind StorageOptions and ConverterOptions; linter fixes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 91f6763)

* return timestamp

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit deafbf8)

* simplify binding of structs

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit da561cc)

* pybind TopicMetadata

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 4a4e1b8)

* namespace rosbag2 -> rosbag2_cpp

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* small fixes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* initial pytests

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrap Reader instead of SequentialReader

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* small fixes for PR comments

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* change workflow to autotest feature branch

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* revert workflow

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* added writer and writer tests

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix test path setup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix and make more rigorous writer test

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrapper and test for topic filter

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* linters. change pybind package

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* simplify verbose import

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* tidy up

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* explicit subclasses of Reader and Writer

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* Use template specialization instead of inheritence

This makes the implementation slightly more compact. And adding a new specialization should be more straight forward as we only have to modify the cpp file in one place.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove temporary variable

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove unused member variable

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Move to initializer list

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* refactor into reader writer storage

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup includes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* switch back to pybind11_vendor

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* Packages dependency for CI

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* printout to debug CI test failure

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* use tempfile for writer test, add exec_depend

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* remove exec_depend

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* use pytest fixture tmp_path; add rosbag2_py to rosbag2

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add makedirs back to see CI result

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix import error

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add modules explicitly for windows CI

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* try more <test_depend>s for mac test failure

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrap structs with named arguments for Python keyword params

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add pytest.ini

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add rosbag db3-shm and db3-wal files for macOS test

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

Co-authored-by: Jacob Perron <jacob@openrobotics.org>
Co-authored-by: Andreas Klintberg <ankl@kth.se>
@agutenkunst agutenkunst mentioned this pull request Feb 5, 2021
agutenkunst pushed a commit to agutenkunst/rosbag2 that referenced this pull request Feb 5, 2021
* Initialize new package rosbag2_py

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit f2ec0b7)

* Proof-of-concept implementation using pybind11

Expose the sequential reader to iterate over messages from Python.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit dc68894)

* pybind StorageOptions and ConverterOptions; linter fixes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 91f6763)

* return timestamp

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit deafbf8)

* simplify binding of structs

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit da561cc)

* pybind TopicMetadata

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 4a4e1b8)

* namespace rosbag2 -> rosbag2_cpp

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* small fixes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* initial pytests

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrap Reader instead of SequentialReader

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* small fixes for PR comments

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* change workflow to autotest feature branch

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* revert workflow

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* added writer and writer tests

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix test path setup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix and make more rigorous writer test

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrapper and test for topic filter

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* linters. change pybind package

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* simplify verbose import

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* tidy up

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* explicit subclasses of Reader and Writer

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* Use template specialization instead of inheritence

This makes the implementation slightly more compact. And adding a new specialization should be more straight forward as we only have to modify the cpp file in one place.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove temporary variable

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove unused member variable

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Move to initializer list

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* refactor into reader writer storage

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup includes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* switch back to pybind11_vendor

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* Packages dependency for CI

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* printout to debug CI test failure

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* use tempfile for writer test, add exec_depend

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* remove exec_depend

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* use pytest fixture tmp_path; add rosbag2_py to rosbag2

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add makedirs back to see CI result

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix import error

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add modules explicitly for windows CI

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* try more <test_depend>s for mac test failure

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrap structs with named arguments for Python keyword params

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add pytest.ini

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add rosbag db3-shm and db3-wal files for macOS test

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

Co-authored-by: Jacob Perron <jacob@openrobotics.org>
Co-authored-by: Andreas Klintberg <ankl@kth.se>
Signed-off-by: Alexander Gutenkunst <alex.gutenkunst+github.com>
emersonknapp pushed a commit that referenced this pull request Feb 17, 2021
* Initialize new package rosbag2_py

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit f2ec0b7)

* Proof-of-concept implementation using pybind11

Expose the sequential reader to iterate over messages from Python.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
(cherry picked from commit dc68894)

* pybind StorageOptions and ConverterOptions; linter fixes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 91f6763)

* return timestamp

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit deafbf8)

* simplify binding of structs

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit da561cc)

* pybind TopicMetadata

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
(cherry picked from commit 4a4e1b8)

* namespace rosbag2 -> rosbag2_cpp

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* small fixes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* initial pytests

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrap Reader instead of SequentialReader

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* small fixes for PR comments

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* change workflow to autotest feature branch

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* revert workflow

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* added writer and writer tests

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix test path setup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix and make more rigorous writer test

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrapper and test for topic filter

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* linters. change pybind package

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* simplify verbose import

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* tidy up

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* explicit subclasses of Reader and Writer

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* Use template specialization instead of inheritence

This makes the implementation slightly more compact. And adding a new specialization should be more straight forward as we only have to modify the cpp file in one place.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove temporary variable

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove unused member variable

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Move to initializer list

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* refactor into reader writer storage

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup includes

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* switch back to pybind11_vendor

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* Packages dependency for CI

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* printout to debug CI test failure

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* use tempfile for writer test, add exec_depend

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* remove exec_depend

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* use pytest fixture tmp_path; add rosbag2_py to rosbag2

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add makedirs back to see CI result

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* fix import error

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add modules explicitly for windows CI

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* cleanup

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* try more <test_depend>s for mac test failure

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* wrap structs with named arguments for Python keyword params

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add pytest.ini

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

* add rosbag db3-shm and db3-wal files for macOS test

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>

Co-authored-by: Jacob Perron <jacob@openrobotics.org>
Co-authored-by: Andreas Klintberg <ankl@kth.se>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
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.