TECHNOLOGY

ROS atomic parameters: validation callbacks must not apply a change before acceptance

In this article
THE QUICK TAKE

Atomic parameter acceptance covers the parameter set; it cannot undo arbitrary mutations performed prematurely by a validation callback.

A rejected setting still changes the driver

A camera node receives an atomic parameter update. An on-set callback immediately copies the proposed exposure into a driver-owned variable, then another validator rejects the configuration. Reading the ROS parameter still returns its old value, but the application variable changed. The discrepancy is not evidence that the parameter service partially committed its values. It can originate in application code that performed work while it was only supposed to decide whether the proposed update was acceptable.

Validation can be followed by another rejection

The Kilted parameter guide explicitly requires side-effect-free on-set callbacks. Several validators can be chained, and an individual callback cannot know that a later one will accept. Keep checks in this phase observational: inspect the candidate values and return the acceptance decision and reason. Do not change a cached filter coefficient, queue mode or device configuration as a convenient byproduct of validating it. A negative response cannot automatically reverse that arbitrary mutation.

Inspect the acceptance boundary in the implementation

The reviewed parameter implementation checks descriptors and invokes on-set callbacks before storing accepted values. Rejection returns before that storage update. Post-set callbacks run after the accepted values have been stored. This explains where an application reaction belongs relative to acceptance. The pre-set phase has a different purpose: it can modify the proposed parameter list. Do not confuse changing that proposal with applying its physical or application-level effects.

Exercise rejection without touching hardware

Propose a dummy node with validators whose observed order is recorded. Use a candidate that reaches an inspecting validator but is rejected by a later validator. Save parameter values, a harmless application-state marker and callback events before and after the request. Acceptance requires the rejected update to leave both stored parameters and application state unchanged. Add an accepted case to verify the intended post-acceptance reaction. No node or device was run here; this is a proposed callback-contract fixture.

Accepted values do not prove device application

Moving application work after acceptance avoids premature validation mutations, but it does not make a remote device update transactional. A post-set handler can encounter an unavailable device or a rejected hardware command. Define how the node reports desired versus applied configuration, and how it reconciles a failed application. Do not advertise successful parameter storage as an exposure measurement or hardware acknowledgement. If configuration requires a managed transition, qualify that transition explicitly rather than hiding it inside a validation predicate.

Report what was accepted and what was applied

Prefect rollback reach concerns another effect boundary. Mitsuba parameter propagation distinguishes edited configuration from refreshed dependent state. For this ROS node, retain the candidate, validation outcome, stored values and application acknowledgement as separate artifacts. The specific invariant is that rejected proposals do not mutate application state during validation. Physical application, recovery and timing remain additional obligations rather than benefits implied by the word atomic.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles