You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

47 lines
1.8 KiB

"""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
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 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 key markers
print('\n=== Verifying webcam support ===')
_, o, _ = ssh.exec_command('grep -c "webcam" ~/xr_teleoperate/teleop/teleop_hand_and_arm.py', timeout=5)
print(f"webcam references: {o.read().decode().strip()}")
print('\n=== Verifying head_R_at_cal ===')
_, o, _ = ssh.exec_command('grep -c "head_R_at_cal" ~/xr_teleoperate/teleop/teleop_hand_and_arm.py', timeout=5)
print(f"head_R_at_cal references: {o.read().decode().strip()}")
print('\n=== Verifying hasattr guard ===')
_, o, _ = ssh.exec_command('grep -c "hasattr.*get_wireless_remote" ~/xr_teleoperate/teleop/teleop_hand_and_arm.py', timeout=5)
print(f"hasattr guards: {o.read().decode().strip()}")
print('\n=== Latest commits ===')
_, o, _ = ssh.exec_command('cd ~/xr_teleoperate && git log --oneline -5', timeout=5)
print(o.read().decode().strip())
ssh.close()
print('\nDone!')