"""Pull xr_teleoperate changes from Gitea on the robot.""" import paramiko, sys sys.stdout.reconfigure(encoding='utf-8', errors='replace') ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect('10.0.0.64', username='unitree', password='123', timeout=15, look_for_keys=False, allow_agent=False) # Check current remotes - origin already points to gitea print('=== Current remotes ===') _, o, _ = ssh.exec_command('cd ~/xr_teleoperate && git remote -v', timeout=10) print(o.read().decode().strip()) # Check for local changes print('\n=== Git status ===') _, o, _ = ssh.exec_command('cd ~/xr_teleoperate && git status --short', timeout=10) status = o.read().decode().strip() print(status if status else '(clean)') # Pull from origin (which is already gitea) print('\n=== Pulling from origin main ===') _, o, e = ssh.exec_command('cd ~/xr_teleoperate && git pull origin main', timeout=30) pull_out = o.read().decode().strip() pull_err = e.read().decode().strip() print(pull_out) if pull_err: print(pull_err) # Verify the changes are present print('\n=== Verifying compute_fk exists ===') _, o, _ = ssh.exec_command('grep -n "def compute_fk" ~/xr_teleoperate/teleop/robot_control/robot_arm_ik.py', timeout=5) print(o.read().decode().strip() or 'NOT FOUND') print('\n=== Verifying --ki arg exists ===') _, o, _ = ssh.exec_command('grep -n "\\-\\-ki" ~/xr_teleoperate/teleop/teleop_hand_and_arm.py', timeout=5) print(o.read().decode().strip() or 'NOT FOUND') print('\n=== Verifying I-term logic exists ===') _, o, _ = ssh.exec_command('grep -n "I-term" ~/xr_teleoperate/teleop/teleop_hand_and_arm.py', timeout=5) print(o.read().decode().strip() or 'NOT FOUND') print('\n=== Latest commit ===') _, o, _ = ssh.exec_command('cd ~/xr_teleoperate && git log --oneline -3', timeout=5) print(o.read().decode().strip()) ssh.close() print('\nDone!')