PiCrawler / Calibration & Configuration
Calibration & Configuration
Mechanical zeroing, matched helpers, effective-user paths and preservation.
Calibration: horn zeroing and final toe alignment are different
Servo zeroing establishes the actuator's neutral reference before a horn is installed. Final calibration compensates small assembly/servo biases after the robot is assembled. One is a mechanical indexing operation; the other creates persistent software angle offsets. Re-running a zeroing utility on an assembled robot can cause motion and must not be treated as a harmless way to inspect configuration.
Zeroing before assembly
The zeroing example creates a crawler with zero initial angles and resets it. That is an active output operation. On the owner-confirmed V4 there is no established V5-style dedicated ZERO button. For a badly indexed horn, support the body, follow the assembly procedure, return the servo to its reference and reinstall the horn correctly with power removed as appropriate. Final offsets should correct a small bias rather than hide a fundamentally wrong assembly.
The current terminal calibration helper
The actual current path is examples/0_calibration.py. It constructs Picrawler() and commands [60,0,-30] on all four legs, so startup already moves them. The official calibration guide uses the printed assembly calibration chart to align the toes. The historical helper is at examples/calibration/calibration.py; its interface closely matches the present terminal version.
| Key | Source behavior |
|---|---|
| 1,2,3,4 | Select RF, LF, LR, RR |
| A | Increment local X by 0.2 |
| D | Decrement local X by 0.2 |
| W / S | Increment / decrement local Y by 0.2 |
| R / F | Increment / decrement local Z by 0.2 |
| Space, then Y | Persist the accumulated angle offsets |
| Space, then N | Decline that save |
| Ctrl+C | Exit; inspect the actual helper cleanup before assuming a final pose |
The A/D behavior is notable: it is opposite the single-leg editing example's X key mapping. Read the chosen helper rather than using keyboard muscle memory. A 0.2 coordinate adjustment is converted through IK to changes in the three reference angles. It updates the selected servo group and checks an absolute ±20-degree offset envelope. The correction is an angle list, not a persistent record of arbitrary X/Y/Z feet.
What is saved
The current Picrawler.OFFSET_FILE is evaluated using os.path.expanduser('~/.config/.picrawler.config'). The Robot base class reads the key picrawler_servo_offset_list using fileDB. Its text value is a twelve-element list of numeric offsets. set_offset() clamps each correction to -20..20, writes the key and updates the in-memory offsets.
This path is effective-user sensitive. Under sudo python3, ~ can resolve to /root rather than ~; the Robot class's separate SUDO_USER handling for ownership does not change PiCrawler's already expanded path. Inspect both user and root config locations and the actual imported source. The inspected pre-May-2026 PiCrawler snapshot instead uses /opt/picrawler/picrawler.config; the Robot base class has a separate generic home-based robot-hat.conf default, which is overridden when PiCrawler supplies its own path. A migration can therefore lose calibration simply by changing the path, even when the angle solver is unchanged.
The file is not JSON, a Python program or a firmware image. Its stored list affects twelve commands after the geometric solve. A normal line has the key, an equals sign and a bracketed numeric list; this package deliberately does not invent the real numbers. The full file should be copied as evidence, including other keys, permissions and timestamps.
Preserve before and after
Capture all candidate calibration files before constructing a crawler. Make a timestamped copy and hash, then transfer that copy off the Pi. Preserve source checkouts and installed package locations too, because offsets only have meaning relative to channel order, sign conventions and the implementation loading them. After successful calibration, make a new separately named copy and record which helper/interpreter/imported SHA produced it. Never overwrite the original evidence copy.
Restoration means using the matching implementation's actual selected file path, with motors made safe, and restoring the verified backup after checking its twelve-value structure. Do not paste remembered offsets or rename files blindly between library generations. A file copied to the login user's home will not help a root process that opens /root/.config/.picrawler.config.
Diagnose the physical symptom
A small, consistent toe bias with free joints can be suitable for final calibration. A required correction near the ±20 bound, a reversed joint, or a toe that cannot approach the chart suggests horn indexing, channel assignment or assembly error. Direction-dependent variation suggests backlash. Load-dependent sag or resets suggests torque/power problems. A limb that grinds, stalls or hits the chassis warrants stopping and inspecting mechanics, not repeating the same command at greater speed.
Do not use the current OpenClaw calibration shortcut for recovery
picrawler-control/scripts/pc.py calls crawler.cali_helper_web() without its required leg/pos/enter arguments. The actual method requires all three and contains a second defect: it copies the return of do_step(), which is None. Source-level and isolated offline checks confirm these problems. It is not a launched calibration server. Use the matched historical or current terminal helper after preservation and physical preflight; do not infer that every official shortcut is validated.
Source evidence: pc-calibration, pc-core, pc-historical-core, pc-historical-calibration, hat-robot, hat-filedb, pc-cli, pc-calibration-doc; validation/offline-results.json.
Continue
Meeting checklist · Source library · Modification atlas · All project proposals