unitreerobotics / unitree_ros_to_real

107 stars 94 forks source link

Port Name from ifconfig for A1 #39

Open staycoolish opened 2 years ago

staycoolish commented 2 years ago

Hello, I cannot find the port name for the robot, which is A1. When I write ifconfig without any ethernet cables connected, that's what I get:

~$ ifconfig
enp4s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether f4:8e:38:e7:b1:37  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4295  bytes 464213 (464.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4295  bytes 464213 (464.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 144.122.227.113  netmask 255.255.254.0  broadcast 144.122.227.255
        inet6 fe80::10e8:2c91:5f8c:522a  prefixlen 64  scopeid 0x20<link>
        ether ac:2b:6e:3c:7e:2c  txqueuelen 1000  (Ethernet)
        RX packets 96359  bytes 111574060 (111.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 26021  bytes 5675897 (5.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

When I write ifconfig when ethernet is connected, that is what I get:

~$ ifconfig
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.123.105  netmask 255.255.255.0  broadcast 192.168.123.255
        inet6 fe80::7bb:b1fb:2b94:8c8b  prefixlen 64  scopeid 0x20<link>
        inet6 fd7a:2ebc:cc18:0:b1f9:662:f152:18c6  prefixlen 64  scopeid 0x0<global>
        inet6 fd7a:2ebc:cc18::d20  prefixlen 128  scopeid 0x0<global>
        inet6 fd7a:2ebc:cc18:0:44b7:3ed3:14bf:a88d  prefixlen 64  scopeid 0x0<global>
        ether f4:8e:38:e7:b1:37  txqueuelen 1000  (Ethernet)
        RX packets 396  bytes 35115 (35.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 482  bytes 47965 (47.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4505  bytes 486369 (486.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4505  bytes 486369 (486.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 144.122.227.113  netmask 255.255.254.0  broadcast 144.122.227.255
        inet6 fe80::10e8:2c91:5f8c:522a  prefixlen 64  scopeid 0x20<link>
        ether ac:2b:6e:3c:7e:2c  txqueuelen 1000  (Ethernet)
        RX packets 96443  bytes 111585303 (111.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 26132  bytes 5691257 (5.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

It is written that: First, please connect the network cable between your PC and robot. Then run ifconfig in a terminal, you will find your port name. For example, enx000ec6612921

I cannot find anything similar to enx000ec6612921. What should I do?

Also, there are two ethernet connections on the robot. Which one should I use? I tried both of them, and the output of ifconfig was more or less the same. Note that, I use an ethernet to ethernet connection between my PC and A1.

sieversb commented 2 years ago

Were you able to solve this issue? I am currently experiencing the same problem :(

AimeeAllen commented 2 years ago

The enp** represents your wired/ethernet connection (e.g. "enp4s0" in staycoolish's provided example). You will notice in staycoolish's example that when the ethernet is connected, the enp network details change to include "inet" and "inet6" lines which are the IP address details on this network now that it is connected. The "inet" represents the IP version4 (4 segment) IP address of your computer on this network. You can see that it is 192.168.123.105, which matches the required 192.168.123.xxx network prefix** that Unitree gives to the internal network for their quadrupeds A1, Go1 etc.

You should make sure you set your computer's IP to be a static IP on this network i.e. 192.168.123.xxx where 'xxx' is always the same number (105 in the example, but could be anything that doesn't conflict with the numbers Unitree have already used for the computers inside your robot).

If you wanted to do the same thing wireslessly, the **wlp* network (when you run $ifconfig) represents the wireless connection. This time however you'll want to make sure you connect to the robot's wireless network, which is on a different network prefix of 192.168.12.xxx**. Once again you should set a static IP for your computer on this different network 192.168.12.xxx, where 'xxx' is anything that doesn't conflict with already assigned IP addresses.

Hopefully some of this helps.

ericahellscythe commented 2 years ago

Hi, I am also facing issues with the ifconfig instructions. I have no clue what to change enx000ec6612921 to and left it as it is. I changed the ip address to my wireless one and ran the commands:

sudo chmod +x ipconfig.sh
sudo ./ipconfig.sh

However, I got the error:

SIOCADDRT: File exists
enx000ec6612921: ERROR while getting interface flags: No such device
enx000ec6612921: ERROR while getting interface flags: No such device
SIOCSIFADDR: No such device
enx000ec6612921: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device

Can someone enlighten me on what the issue is? To give some background, I am currently using my laptop to ssh into the robot. Do I still need to setup the net connection or can I skip the steps? Please advice. Thanks in advance.

LinusNEP commented 1 year ago

Hi, I am also facing issues with the ifconfig instructions. I have no clue what to change enx000ec6612921 to and left it as it is. I changed the ip address to my wireless one and ran the commands:

I am having the same problem connecting the robot to the internet. Has anyone solved this problem?

78748547 commented 1 year ago

Hello everyone, does anyone know where the ipconfig.sh file is? There are only five files (CMakeLists.txt package.xml include launch src/exe ) in the unitree_legged_real folder after I git clone these code. I can not find the ipconfig.sh file. The readme.md says "Then, open the ipconfig.sh file under the folder unitree_legged_real, modify the port name to your own. And run the following commands:". So, what should i do to modify the port name?

heartInsert commented 5 months ago

Bro , do you have python code to control the robot through ros ?