#!/usr/bin/env python3 """Continuously poll mechpos for all 4 wheel motors and report per-ID deltas. Used to identify which CAN ID (1-4) corresponds to which physical wheel corner: run this while a human rotates one wheel at a time and watch which ID's mechpos changes. Usage: python3 robstride_rotation_watch.py [duration_sec] [motor_ids...] """ import struct import sys import time import can HOST_ID = 0xAA MSG_TYPE_READ_PARAM = 0x11 PARAM_MECHPOS = 0x7019 def read_param_request(motor_id, param_id): arb_id = (MSG_TYPE_READ_PARAM << 24) | (HOST_ID << 8) | motor_id data = struct.pack('> 8) & 0xFF value = struct.unpack(' 0.05} if moved: print(f"[{time.time() - start:4.1f}s] moved: {moved}") time.sleep(0.1) finally: bus.shutdown() if __name__ == "__main__": main()