Frame Relationship for the Sensor Offset
The supported construction applies the measured distance along the sensor frame’s own Z axis. This distinction matters: adding the distance directly to a world-coordinate Z value would produce the wrong target whenever the sensor frame is rotated relative to world.
Let sensorFrame represent the current sensor pose and zOff represent the signed sensed distance. The resulting frame preserves the sensor frame orientation while translating its origin by (0, 0, zOff) in sensor-frame coordinates.
Construct the Offset Frame
AbstractFrame sensorFrame = null;
double zOff = 10d;
newToolFrame = new Frame(
new Frame(
sensorFrame,
Transformation.ofTranslation(0d, 0d, zOff)
).transformationFromWorld()
);
Replace the null placeholder with the actual sensor frame. The inner Frame applies the translation relative to sensorFrame; transformationFromWorld() then supplies the resulting world transformation to the outer frame.
Apply the Measured Distance
- Obtain the sensor frame that describes the sensor’s current position and orientation.
- Convert the sensed surface distance into the same distance units and sign convention expected by the frame transformation.
- Assign that distance to
zOffand construct the translated frame. - Use the resulting frame as the calculated sensor-target pose.
The evidence supports runtime frame construction, but it does not establish whether the resulting frame can be registered dynamically as a persistent tool definition. Treat frame calculation and controller tool registration as separate operations until the runtime API and controller configuration confirm the latter.
Verify Direction and Result
Confirm that the sensor’s local positive Z axis points toward the intended target direction. If the calculated target moves away from the surface, the distance sign or the sensor-frame orientation is reversed. Also verify that the output translation equals the measured offset along local Z while the orientation remains unchanged.
FAQ
How do I add a sensor distance along an LBR frame’s Z axis?
Create a translation with Transformation.ofTranslation(0d, 0d, zOff) relative to the sensor frame, then obtain the result with transformationFromWorld().
Is the Z offset applied in world coordinates?
No. In the supported construction, the inner frame applies zOff along the sensor frame’s local Z axis, accounting for the sensor frame’s orientation.
Can the calculated frame become a tool frame at runtime?
The evidence confirms creation of a new frame at runtime but does not confirm dynamic registration as a persistent tool definition. Verify that capability separately in the controller runtime API.