Add Timer.clock accessor #1599
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 300 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.341
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1599"
general
weight: 0.35
KR-Ravindra
Adds the
rcl_timer_clockitem of the parity checklist in #1330: aTimer.clockaccessor, matching rclpy'sTimer.clock.Design
timer.clockreturns theClockthe timer was created with: the clock passed tonode.createTimer(), or the node's clock when none was passed.Node.createTimer()now hands that clock to theTimerconstructor. No new native binding: the addon is unchanged.Timernow keeps a reference to itsClock,Node.destroy()releases the timer handles explicitly. Timer handles are children of the clock handle rather than of the node handle, so until now they were finalized only once the clock was garbage collected; that also kept the thread-safe function ofsetOnResetCallback()alive.types/timer.d.tsgetsreadonly clock: Clockand the tsd test covers it.How tested
mocha test/test-timer.json ROS 2 Kilted (Node 22), with the new tests applied before the change:After the change:
26 passing, 1 pending, and the process exits on its own. The new tests check the node clock, a customSTEADY_TIMEclock passed as the 4th argument, aROSClockpassed as the 3rd argument with a ROS time override read back throughtimer.clock.now(), and thattimer.clockis read-only. The full suite in the same container: 1454 passing, 14 pending; the 2 failures are HTTP-transport timeouts intest/test-web-http.jsthat fail identically on unmodifieddevelopthere.prettier,eslintandtsdare clean.Revision 2 (review): the
getTimerClocknative binding and the tests that compared its result withclock.handlewere removed; the remaining tests are unchanged.Revision 3 (review): dropped the
clock = nullconstructor default and added a CONTRIBUTORS.md entry; no functional change.Links
rcl_timer_clockunder "Clock & Time")Timer.clock: https://github.com/ros2/rclpy/blob/rolling/rclpy/rclpy/timer.pyThis change was prepared with an AI agent operated by KR-Ravindra, who reviewed and tested it.