Community Dataset v3: joint values use two incompatible units, and nothing in the metadata says which

#3
by frechen026 - opened

Summary

community_dataset_v3 mixes two different joint-value conventions with no field in
meta/info.json that distinguishes them
. Roughly 40% of the SO-100/SO-101/Koch leaves
store joint positions in degrees; the other 60% store them as
RANGE_M100_100 normalized values — the joint's position as a percentage of that
particular operator's
hand-recorded range of motion.

Both look like plausible angles (values in the ±100 range), both have dtype: float32,
shape: [6], and byte-identical top-level keys in info.json. A consumer that treats
them uniformly gets physically wrong joint angles with no error and no warning.

The two conventions do correlate with the robot_type string (so100 vs
so100_follower), but that appears to be a side effect of the hardware-API refactor
rather than something documented, and the correlation is not something a downstream user
would think to rely on. We would like to know whether this is known/intended, and whether
the calibration ranges can be published.

Why it matters

For most joints the two conventions happen to produce similar numbers, which makes the
problem worse rather than better — it looks correct.

We recovered the per-leaf calibration range for 245 M100 single-arm leaves (method below)
and compared "use the M100 value as if it were degrees" against the recovered scale:

Joint Median recovered range Error if used as degrees Leaves off by >25%
shoulder_lift 207° +3% 11/243
elbow_flex 195° −3% 4/243
wrist_flex 214° +7% 8/243
shoulder_pan 234° +17% 18/243
wrist_roll 360° +80% 234/243

Most joints are calibrated over roughly 200°, so range/2 ≈ 100 and the M100 value
coincidentally approximates degrees (median error ~5%). But wrist_roll travels nearly a
full turn, so 234 of 243 leaves compress that joint to ~55% of its true angular
excursion when the value is read as degrees.

Concretely, the same stored value means different angles on different leaves. For
wrist_flex, a stored 50.0 is:

Leaf Recovered calibration range True angle for stored value 50.0
Anybalsmith/pickplacelegocube3 200° 50°
Beegbrain/draw_pixel_art 360° 90°

How to reproduce

Two leaves, both SO-100-family, both tabletop manipulation:

import glob, numpy as np, pyarrow.parquet as pq

def step(leaf):
    p = sorted(glob.glob(f"{leaf}/data/chunk-*/file-*.parquet"))[0]
    a = np.array([np.asarray(x, float) for x in
                  pq.read_table(p, columns=['observation.state'])
                    .to_pydict()['observation.state'][:8000]])
    u = np.unique(a[:, 0]); d = np.diff(u)
    return np.unique(np.round(d[d > 1e-9], 6))[:4]

step("Bartm3/dice4")                # robot_type: so100
# -> [0.087891 0.175781 0.263672 0.351562]   all multiples of 360/4096

step("Beegbrain/draw_pixel_art")    # robot_type: so100_follower
# -> [0.07291  0.072912 0.072913 0.145824]   multiples of 200/2743

0.087890625 = 360/4096 is one tick of the STS3215's 12-bit encoder, i.e. degrees.
0.072910 is not a constant: 200 / 0.072910 = 2743 ticks. Across other M100 leaves the
same computation yields 2438, 2783, 2261, 2129 … — a different value per leaf, because the
denominator is that operator's recorded range.

A second, easier tell: in lomiotech/m2m_smolvla_finetune_dataset all six joints have a
minimum of exactly -100.0. 95 of 120 so100_follower leaves clip to ±100 somewhere.
Degree-scaled data never lands on such a boundary.

Root cause (as far as we can tell from the source)

Verified against huggingface/lerobot @ 7427f318.

Before the hardware-API refactor (lerobot/common/robot_devices/robots/feetech_calibration.py,
deleted in e23b41e7 "Hardware API redesign (#777)"), calibration set only a zero point;
the scale was a library constant:

calib_val = (values[i] + homing_offset) / (resolution // 2) * HALF_TURN_DEGREE
# resolution = 4096, HALF_TURN_DEGREE = 180  ->  0.087890625 deg/tick

So every operator shared the same scale, and only the zero differed.

After the refactor, MotorNormMode.RANGE_M100_100 became available and normalization
depends on a per-operator recorded range (src/lerobot/motors/motors_bus.py:868):

if self.motors[motor].norm_mode is MotorNormMode.RANGE_M100_100:
    norm = (((bounded_val - min_) / (max_ - min_)) * 200) - 100
    normalized_values[id_] = -norm if drive_mode else norm
elif self.motors[motor].norm_mode is MotorNormMode.DEGREES:
    mid = (min_ + max_) / 2
    max_res = self.model_resolution_table[self._id_to_model(id_)] - 1
    normalized_values[id_] = (val - mid) * 360 / max_res

where range_min / range_max come from record_ranges_of_motion() — the operator sweeps
each joint end to end by hand. The mode is selected at
src/lerobot/robots/so_follower/so_follower.py:50:

norm_mode_body = MotorNormMode.DEGREES if config.use_degrees else MotorNormMode.RANGE_M100_100

The refactor also renamed the config registration (so100so100_follower), which is
why the robot_type string happens to track the unit.

Measured over 621 leaves, classifying purely by quantization step:

robot_type degrees M100
so100 239 1
so101 81 0
so100_bimanual 11 0
koch 38 0
so100_follower 0 119
so101_follower 0 120
koch_follower 0 8
so100_follower_bimanual 0 2
bi_so100_follower 0 1
piper_follower 0 1
total 369 252

Questions

  1. Is this known and intended? If the split is expected, could info.json carry the
    normalization mode explicitly (e.g. "norm_mode": "degrees" | "range_m100_100", ideally
    per feature) rather than requiring consumers to infer it from robot_type or from
    quantization-step forensics?

  2. Can the calibration files be published? range_min / range_max (and
    homing_offset / drive_mode) fully determine the mapping back to ticks, but they live
    only in the contributor's local cache. We found no *calib* file anywhere in the
    released tree. Even a per-leaf JSON of the MotorCalibration dataclass would make the
    M100 leaves fully recoverable.

  3. Is use_degrees still meaningful as a default? config_so_follower.py:42 currently
    has use_degrees: bool = True, yet 119/120 so100_follower leaves in the release are
    M100. Presumably the default changed at some point, or the recording scripts override it —
    either way it means the robot_type correlation is a historical artifact and may not
    hold for future contributions.

  4. drive_mode sign flip. _normalize applies -norm if drive_mode else norm. Since
    drive_mode also isn't published, is there any way for a consumer to know whether a
    given joint's sign was flipped? This affects the degree-scaled leaves too.

  5. Is piper_follower on CnLori/so101_piper a mislabel? Its state.names are
    shoulder_pan.pos … gripper.pos, 6-DoF, ±100 — it looks like an SO-101, not a Piper.

Partial workaround (for anyone hitting this)

The scale — though not the zero — is recoverable from the data itself, because the
quantization step encodes the denominator:

range_in_ticks = 200 / observed_quantization_step        # 100 / step for the gripper
range_in_degrees = range_in_ticks * (360 / 4096)
angle_relative_to_calibration_midpoint = value / 100 * (range_in_degrees / 2)

We verified this on 12 leaves: 200/step lands on integer tick counts for all joints
(residual < 0.35). It fixes the wrist_roll compression. It does not recover the zero
point — but note the degree-scaled leaves don't have a recoverable zero either
(homing_offset is likewise unpublished), so after this correction the two groups carry
equivalent information.

Note the gripper is unaffected: so_follower.py:59 pins it to
MotorNormMode.RANGE_0_100 independently of the body joints, so it is consistent across
both groups and matches the v1/v2 convention.

Context

We are ingesting v3 into a cross-embodiment VLA training corpus (we previously ingested
Community Datasets v1 and v2). Structural integrity of v3 is otherwise excellent — we
sampled 80 leaves and found zero mismatches in Σlength == total_frames, parquet row
counts, or referenced-mp4 existence, so the cleaning pass described in the dataset card
clearly worked. This unit split is the one blocker that can't be detected automatically
from the released metadata.

Happy to share the full per-leaf classification if useful.

Hi @frechen026 ,

And thanks for the deep dive on this calibration issue ! It's indeed something that has been worrying us when working on the v3 version of the community dataset. PR#777 introduced this normalization mechanism, but we realized it was not practical for regular (e.g. non-gripper) joints, and removed it in a later commit. As a result, the community dataset mixes legacy datasets with the normalization and new datasets without the normalization...

To answer your questions:

  1. This is indeed known but not intended. I've been thinking about adding the calibration data to the datasets metadata when relevant, but could not find the time (or the reviewers) to do so. If you want to open a PR against LeRobot main, please feel free to do so, I'd gladly review it !
  2. Following up on the previous answer, the calibration parameters could totally be stored in the datasets metadata. We'd simply need (for each normalized joint): the normalization mode, the offset, the range and the scale (+1/-1 joint flip).
  3. use_degrees is the current default, and will remain the default. It's the only thing that guarantees a policy can be shared among similar embodiments without relying on a variable calibration.
  4. As stated before, this should be stored in the calibration data as well.
  5. Mislabels are likely to happen on community contributed data. If you want to open a PR to fix this particular dataset, you're welcomed to do so !

On a side note, I already performed a first "normalization"classification based on the joint values saturation at 100, and labeled the concerned datasets with a normalized flag. While doing so, I fixed the offsets and joint flips that made SO-family datasets unusable. Now that I read your message, I think we could do much more with the quantization-based detection and could even recover the range on these datasets.

Could you please share your per-leaf classification so I can run the large-scale fix on my side (happy to help with compute on that one !) ?

Thanks again for your help !

Best,
Caroline.

Sign up or log in to comment