Skip to content

fix: guard ROS plugin updates during context shutdown - #15

Merged
woensug-choi merged 3 commits into
mainfrom
fix/ros-plugin-shutdown-20261008
Oct 10, 2026
Merged

woensug-choi merged 3 commits into
mainfrom
fix/ros-plugin-shutdown-20261008

Conversation

@yeseorizi

@yeseorizi yeseorizi commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Gazebo may still run an update callback after the shared ROS context has shut down. Calling spin_some() or publishing at that point can throw an RCLError. A plugin must also leave process-level signal handling to Gazebo instead of replacing it during rclcpp::init().

Scope

Guard five plugin implementations: SphericalCoords, OceanCurrentPlugin, UsblTransceiver, UsblTransponder and SubseaPressureSensorPlugin.

  • Initialize ROS with SignalHandlerOptions::None.
  • Check the node's context before ROS operations.
  • Suppress an RCLError only when shutdown invalidated that context; rethrow it while the context is valid.
  • Add a pressure-plugin regression for preserving the SIGINT handler and tolerating a post-shutdown update.

The USBL and pressure guards extend this existing PR rather than opening another overlapping shutdown PR. Latest main was merged normally into this branch. No launch timeout, Docker/CI or MAVROS changes are included. The depth timestamp fix is separate dependent PR #19.

Validation

Linux ARM64, Ubuntu 26.04, ROS 2 Lyrical / Gazebo Jetty:

  • Built posim_gz_sensor_plugins and posim_ros_gz_plugins from this branch.
  • Camera regression: 5/5 cases; new pressure shutdown regression: 1/1.
  • Control run using the unchanged main pressure implementation failed the new shutdown regression with RCLError; restoring the fix passed it.
  • In the prior integrated release-gate run, current/glider/USBL execution and shutdown passed 30/30 (10 each). That run included other fixes and is supporting integration evidence, not an isolated test of this PR or proof of all-platform stability.

Review / remaining scope

The separate ros_gz_bridge shutdown issue is upstream, not fixed by these guards. ARM64/AMD64 CI and maintainer review remain required before merge; an earlier ARM64 runner-space failure was infrastructure-related. Please leave this PR unmerged until reviewed.

@woensug-choi
woensug-choi merged commit 5e84865 into main Oct 10, 2026
2 of 3 checks passed
@woensug-choi
woensug-choi deleted the fix/ros-plugin-shutdown-20261008 branch October 10, 2026 06:17
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