Skip to content

TopicPublisherROS2: fix Re-Publisher crashes (#477, #759)#118

Open
Alvvalencia wants to merge 2 commits intoPlotJuggler:mainfrom
Alvvalencia:fix/republisher-crash
Open

TopicPublisherROS2: fix Re-Publisher crashes (#477, #759)#118
Alvvalencia wants to merge 2 commits intoPlotJuggler:mainfrom
Alvvalencia:fix/republisher-crash

Conversation

@Alvvalencia
Copy link
Copy Markdown

Fixes #477, #759.

Two separate crashes triggered by enabling the Re-Publisher:

  • GenericPublisher passed its callbacks_ member by reference to
    rclcpp::PublisherBase. Base-class init runs before member init, so
    rclcpp read uninitialized std::function memory and crashed inside
    the PublisherBase ctor. Pass a temporary PublisherEventCallbacks{}
    and drop the dead member.
  • setEnabled() eagerly created tf2_ros TransformBroadcaster / Static
    broadcaster even for bags with no /tf data. On Jazzy/Rolling this
    triggers a separate tf2 QoS-override parameter-declaration crash inside
    rclcpp. Defer broadcaster creation to broadcastTF() so it only runs
    once /tf or /tf_static actually carries data.

avalen2022 and others added 2 commits April 24, 2026 12:14
- GenericPublisher passed its `callbacks_` member by reference to
  rclcpp::PublisherBase. Base init runs before member init, so rclcpp
  read uninitialized std::function memory and crashed inside the
  PublisherBase ctor. Pass a temporary rclcpp::PublisherEventCallbacks{}
  and drop the dead member.

- setEnabled() eagerly created tf2_ros TransformBroadcaster / Static
  broadcaster even for bags without /tf data. On Jazzy/Rolling this
  triggers a separate tf2_ros QoS-override parameter-declaration crash
  inside rclcpp. Defer broadcaster creation to broadcastTF() so it
  only happens once /tf or /tf_static actually carries data.

Closes #477, #759.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.

2 participants