Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faux-Level how-to notes #2

Closed
MAVProxyUser opened this issue May 31, 2023 · 0 comments
Closed

Faux-Level how-to notes #2

MAVProxyUser opened this issue May 31, 2023 · 0 comments

Comments

@MAVProxyUser
Copy link
Collaborator

MAVProxyUser commented May 31, 2023

Power up the Unitree Go1, and connect to wireless network: Unitree_GoXXXXXX
(where XXXXXX is the 3 octets in the MAC address from your dog)
By default the password is: 00000000

Once you connect your wifi interface route should be set to the dogs 192.168.12.1 address by default:

(pc)$ netstat -nr 
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.12.1    0.0.0.0         UG        0 0          0 wlp61s0
...

Open a terminal, and watch the log file for Legged_Sport via ssh to the RasPi in the dog. This is optional, but it can allow you to see the correct mode sequences have been entered ensuring the dog is ready for the low level input. The password for the pi user is 123.

(pc)$ ssh pi@192.168.12.1 "tail -f /home/pi/Unitree/autostart/sportMode/log"
pi@192.168.12.1's password: 
GO1 wrong Model
[Wait] for trigger: SDK or L1 + start
[UDP Connected] client! Client IP:192.168.123.161 port:8091
SDK trigger detected
Be triggered
[UDP Disconnected] client! socketfd:11 Old Client IP:192.168.123.161 port:8091
[UDP Connected] client! Client IP:192.168.123.161 port:8084
[Trigger CMD]: L2 + A
[Trigger CMD]: L2 + A
[Trigger CMD]: L2 + B
[Trigger CMD]: L1 + L2 + START
Sport Mode Triggered Off
UDP Initialized. socketfd: 9   Port: 8008
UDP Initialized. socketfd: 10   Port: 8010
UDP Initialized. socketfd: 11   Port: 8082
UDP Initialized. socketfd: 12   Port: 8018
[Wait] for check
Check passed
GO1 wrong Model
[Wait] for trigger: SDK or L1 + start
tail: /home/pi/Unitree/autostart/sportMode/log: file truncated

Put Go1 into low level mode with remote

L2 + A
L2 + A
L2 + B
L1 + L2 + Start

Make sure your ip_forward setup is proper, we expect the value to be "1" on net.ipv4.ip_forward:

$ ssh pi@192.168.12.1 "grep net.ipv4.ip_forward /etc/sysctl.conf"
pi@192.168.12.1's password: 
net.ipv4.ip_forward=1

You can alternately follow the guide here starting from "Power up Unitree Go1 and connect to wireless network": https://gist.githubusercontent.com/dbaldwin/b31835f87f16450a956cf3c89e15a289/raw/bf1c8452ba4c2a30bb7073718f1de2370c9eb786/gistfile1.txt

Make sure you have crcmod, and pyshark python modules installed.

If you wish, you can make sure the required ports are open for testing:

$ sudo nmap -p 8082 192.168.12.1 -sU # High Level 

Starting Nmap 7.60 ( https://nmap.org ) at 2023-05-31 22:39 EDT
Nmap scan report for 192.168.12.1
Host is up (0.0027s latency).

PORT     STATE         SERVICE
8082/udp open|filtered us-cli
MAC Address: 32:7B:C9:24:30:6B (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 9.48 seconds

$ sudo nmap -p 8007 192.168.123.10 -sU # Low Level

Starting Nmap 7.60 ( https://nmap.org ) at 2023-06-01 00:21 EDT
Nmap scan report for 192.168.123.10
Host is up (0.0026s latency).

PORT     STATE SERVICE
8007/udp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 8.85 seconds

You can now execute the speak_low.py example.

$ python3 speak_low.py 
[*] Start receive Thread ...

1
2
3
...

You should see the dogs front right leg move.

If you want to have information about your dog printed out as a sanity check you can edit the speak_low.py as follows:

for paket in data:
    lstate.parseData(paket)
    print('+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=')
    print(f'SN [{byte_print(lstate.SN)}]:\t{decode_sn(lstate.SN)}')
    print(f'Ver [{byte_print(lstate.version)}]:\t{decode_version(lstate.version)}')
    print('+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=')

The modified code will return version and serial number information as follows:

$ python3 speak_low.py 
[*] Start receive Thread ...

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
SN [0405010409022500]:	('Go1_XX', '1-4-9[2]')
Ver [000109000126fc7f]:	('0.1.9', '0.1.38')
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

One way to confirm you are in LOW-LEVEL mode is to try to speak using the HIGH-LEVEL example, you should get nulled out responses:

$ python3 speak.py 
[*] Start receive Thread ...

24
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
SN [0000000000000000]:	('UNKNOWN_UNKNOWN', '0-0-0[0]')
Ver [0000000000000000]:	('0.0.0', '0.0.0')
SOC:			0 %
Overall Voltage:	0 mv
Current:		0 mA
Cycles:			0
Temps BQ:		0 °C, 0°C
Temps MCU:		0 °C, 0°C
FootForce:		[0, 0, 0, 0]
FootForceEst:		[0, 0, 0, 0]
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
...
@MAVProxyUser MAVProxyUser changed the title How-to notes Faux-Level how-to notes Jun 1, 2023
@Bin4ry Bin4ry closed this as completed Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants