Skip to content

Fix rosbag2_py transport test for py capsule#707

Merged
emersonknapp merged 2 commits intomasterfrom
emersonknapp/fix-rmw-pycapsule
Apr 1, 2021
Merged

Fix rosbag2_py transport test for py capsule#707
emersonknapp merged 2 commits intomasterfrom
emersonknapp/fix-rmw-pycapsule

Conversation

@emersonknapp
Copy link
Copy Markdown
Collaborator

@emersonknapp emersonknapp commented Apr 1, 2021

Change introduced by ros2/rclpy#741 conflicted with parallel work in #702, the combination causing nightly test failure for rosbag2_py's _transport.cpp tests. Fix to use the new py::object for rmw_qos_profile_t to fix the tests.

One instance https://ci.ros2.org/view/nightly/job/nightly_linux-aarch64_debug/1559/testReport/junit/(root)/projectroot/test_transport_py/

Change introduced by ros2/rclpy#741 conflicted with parallel work in #702, the combination causing nightly test failure for `rosbag2_py`'s `_transport.cpp` tests. Fix to use the new `py::object` for `rmw_qos_profile_t` to fix the tests.

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp emersonknapp requested a review from a team as a code owner April 1, 2021 19:11
@emersonknapp emersonknapp requested review from Karsten1987, hidmic, mjeronimo and piraka9011 and removed request for a team, mjeronimo and piraka9011 April 1, 2021 19:11
@emersonknapp
Copy link
Copy Markdown
Collaborator Author

Gist: https://gist.githubusercontent.com/emersonknapp/e386fd1aa55069d16d879d0dd81d0ee8/raw/9247bbca23a4ab96ba857b45011d824c225e377b/ros2.repos
BUILD args: --packages-up-to rosbag2_py ros2bag rosbag2_tests rosbag2
TEST args: --packages-select rosbag2_py ros2bag rosbag2_tests rosbag2
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/8073

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

@emersonknapp
Copy link
Copy Markdown
Collaborator Author

Note: the PR and Action builds are using the Rolling release - which is not yet updated with these changes for rclpy - so they fail to cast the old Capsule with the new code. Let's just trust the ci.ros2.org here

@emersonknapp
Copy link
Copy Markdown
Collaborator Author

Windows CMake warning preexisting - reported here eclipse-cyclonedds/cyclonedds#741

@emersonknapp emersonknapp force-pushed the emersonknapp/fix-rmw-pycapsule branch from 99470d8 to f2b2401 Compare April 1, 2021 20:38
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp emersonknapp merged commit f1d7d92 into master Apr 1, 2021
@delete-merged-branch delete-merged-branch bot deleted the emersonknapp/fix-rmw-pycapsule branch April 1, 2021 20:43
return rclcpp::QoS{qos_init, *rmw_qos_profile};
PyObject * raw_obj = PyObject_CallMethod(source.ptr(), "get_c_qos_profile", "");
const auto py_obj = py::cast<py::object>(raw_obj);
const auto rmw_qos_profile = py_obj.cast<rmw_qos_profile_t>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like it will work, though I wouldn't rely on rclpy's C/C++ interface being API/ABI stable. It's possible (but very unlikely) that this will break in the same ROS distro in the future.

get_c_qos_profile() itself should really be documented as internal-use-only.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Do you have a suggestion on how rosbag2's pybind could take rclpy.QoS as an argument in a more stable way?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Alternatively - we could pass the YAML file directly and have the C++ layer do the parsing, which it does already have utilities for. Maybe that's a better way, though I had preferred that the CLI layer do input validation

Kettenhoax pushed a commit to Kettenhoax/rosbag2 that referenced this pull request Apr 9, 2021
* Fix rosbag2_py transport test for py capsule

Change introduced by ros2/rclpy#741 conflicted with parallel work in ros2#702, the combination causing nightly test failure for `rosbag2_py`'s `_transport.cpp` tests. Fix to use the new `py::object` for `rmw_qos_profile_t` to fix the tests.

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.

6 participants