Commit dca853a
fix(TopicPublisherROS2): prevent crash when enabling Re-Publisher
- 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>1 parent 9cb0b59 commit dca853a
2 files changed
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 114 | | |
124 | 115 | | |
125 | 116 | | |
| |||
293 | 284 | | |
294 | 285 | | |
295 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
296 | 291 | | |
297 | 292 | | |
298 | 293 | | |
299 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
| |||
0 commit comments