Unit 02 · lesson
Units Are Part of the Contract
A numeric value without a unit is incomplete engineering evidence.
This bridge assumes you can already perform Java arithmetic. Focus on unit-bearing meaning instead.
Compare:
double range = 0.42;
double rangeMeters = 0.42;
The second name carries more of the contract, but the name alone still does not prove the source, calibration, or physical accuracy.
When converting values, preserve the conversion rule explicitly. When comparing Java state with a ROS message, verify that both describe the same physical quantity and unit before comparing the numbers.
Checkpoint
Document one conversion or threshold rule with:
- source value and unit;
- destination value and unit;
- conversion formula;
- one failure caused by a unit mismatch;
- one claim the conversion still does not prove.
Do not turn this route into a Java arithmetic review.