Commit 7df6693
committed
Fix topic statistics for IPC subscriptions
If use_intra_process_comms is enabled, messages are delivered via
SubscriptionIntraProcess::execute_impl() which previously never called
the topic statistics handler, this causes all statistics to report NaN values.
The fix here puts a type-erased StatsHandlerFn in SubscriptionIntraProcess
and wires it up from the Subscription via a lambda. Using std::function avoids
a circular include chain that would occur if subscription_topic_statistics.hpp
were included directly from subscription_intra_process.hpp via
publisher.hpp/callback_group.hpp.
The source_timestamp is set to the receive time so that message_age reports
0ms rather than an un-initialised value. IPC delivery has little/no expected transport
latency, by definition so near-zero age is expected.
Fixes #2911
Signed-off-by: jayyoung <jay.young@gmail.com>1 parent 8369e04 commit 7df6693
File tree
2 files changed
+41
-3
lines changed- rclcpp/include/rclcpp
- experimental
2 files changed
+41
-3
lines changedLines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
80 | | - | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
| |||
197 | 203 | | |
198 | 204 | | |
199 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
200 | 219 | | |
201 | 220 | | |
202 | 221 | | |
| |||
208 | 227 | | |
209 | 228 | | |
210 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
211 | 235 | | |
212 | 236 | | |
213 | 237 | | |
| 238 | + | |
214 | 239 | | |
215 | 240 | | |
216 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
167 | 179 | | |
168 | 180 | | |
169 | 181 | | |
| |||
172 | 184 | | |
173 | 185 | | |
174 | 186 | | |
175 | | - | |
| 187 | + | |
| 188 | + | |
176 | 189 | | |
177 | 190 | | |
178 | 191 | | |
| |||
0 commit comments