TECHNOLOGY

Kilted Python vector transforms: preserve a shared TransformStamped before reuse

In this article
THE QUICK TAKE

In the reviewed Kilted Python helper, vector conversion writes into the passed transform object; preserve an independent full transform if another operation needs its translation.

Conversion order changes a later point result

A perception adapter retrieves a transform and uses it for both a direction and an object position. After processing the direction, the position loses its expected origin offset. The numerical vector result may still be correct. Inspect whether the conversion changed the shared transform message before diagnosing frame calibration. A second Python variable referring to that message is another alias, not a preserved historical value. The relevant evidence is the transform’s fields before and after the call.

The reviewed helper writes into the supplied message

In the reviewed Kilted Python implementation, do_transform_vector3 sets the supplied transform’s translation components to zero before forming its affine calculation. The point helper uses the complete transform. This is an observation about that implementation, not a universal statement about tf2, every language binding or every release. Check the installed package source when applying the diagnosis. A later implementation may preserve input differently without changing the intended vector result.

The vector contract explains the result, not input ownership

The Vector3 message definition specifies a free vector distinct from a point and applies only the rotational component of a transform. That numerical requirement explains why translation must not affect the vector. It does not imply that callers should lose the full transform needed by another operation. Separate the expected mathematical output from the mutable implementation path. Otherwise a correct direction can conceal a damaged input object that another stage still considers complete.

Preserve an independent value at the ownership boundary

If the application needs to reuse the full transform, preserve an independent representation before invoking the affected helper, or use a supported integration that leaves the required original intact. Copy the nested message contents rather than merely its outer Python name. Keep the copy’s source identity and timestamp so it cannot be confused with a new lookup. Also review concurrent consumers: changing a shared message during one conversion creates an ownership problem beyond the immediately visible sequential point calculation.

A translation-only fixture exposes the mutation clearly

Propose a passive fixture with nonzero translation and an identity rotation. Convert a vector, inspect the input message, then convert a point using the reused object. Compare with a separately preserved full transform and reverse the operation order. Acceptance records both correct vector semantics and intentional preservation of later point geometry. No ROS helper or robot experiment was executed here. The code review predicts a testable aliasing case; it does not claim an observed failure in a deployed system.

Keep the diagnosis narrower than all coordinate bugs

JAX input donation illustrates a different explicit storage-ownership transfer. Molecular coordinate and force transforms illustrate numerical target consistency. Here the added question is whether a particular helper changes a reusable transform message. Report binding, implementation, operation order and before/after fields. Correcting object ownership does not certify calibration, sensor timing or safe physical control. It removes a specific source of order-dependent geometry while leaving those other requirements available for separate checks.

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