Contact system: Enable the sensor's update_rate #4099
All Vouch review confidence checks passed
Residual risk 0.07 = Change Risk (0.42) × (1 − Review Confidence (0.83)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 301 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.75 · 4 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
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.342
Real PR Conversation Timeline
7 items
warn if update_rate is negative? I think it just default to physics update rate (original behavior)?
Regarding contact timestamps, it looks like the individual contact point's timestamp (newContact) inside the this->contactsMsg message should be correct. The this->contactsMsg message itself should probably use the timestamp of when the message is published. So move this call outside to Publish function?
Approved
Approved these changes.
Approved
Approved these changes.
iche033
caguero
🦟 Bug fix
Summary
The Contact system ignores
<update_rate>and publishes at every iteration with contacts. As an example, a wheel touching the ground with<update_rate>10</update_rate>is publishing 1000 messages per second at the default step size.Now a sensor with a positive
<update_rate>publishes at that rate on a fixed schedule of simulation time (also when the period is not a multiple of the step), with the contacts gathered since its last message; without a rate nothing changes.Worlds that already set a rate below the physics rate will get fewer, larger messages.
ContactSystemTest.ExtraContactDatalooks flaky onmainwith or without this change.Backport Policy
- [ ] Jetty
- [ ] Ionic
- [ ] Harmonic
- [ ] Fortress
Note for released branches: worlds that already set a rate (e.g.
examples/worlds/contact_sensor.sdf, 100 Hz) would start getting messages with several steps of contacts, which is a behavior change. That's why I'm leaning towards not backporting it.Checklist
codecheckpassed (See contributing)Assisted-by: Claude Opus 5.5
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.Backports: If this is a backport, please use Rebase and Merge instead.