unitreerobotics / unitree_ros_to_real

107 stars 94 forks source link

Possibility to Control without Ethernet (via WiFi) #38

Open staycoolish opened 2 years ago

staycoolish commented 2 years ago

Hello,

Is it possible to connect to the robot without ethernet? In readme, only ethernet is mentioned. If connection via Wifi is possible, is there any difference between the two connections (like, camera information is sent only through ethernet, etc.)?

Thank you,

JonasFovea commented 2 years ago

Which robot are you using?

For the go1 this video does explain the robots networking.

It is possible to activate a pass-through for ip packets, as shown in the video. Rather than changing your default gateway, I recommend setting up a static route to the robots internal network:

sudo route add -net 192.168.123.0/24 gw 192.168.12.1
Dvbritsem commented 2 years ago

Hello again... So i am able to run the scripts from the unitree_ros_to_real in a terminal. I connected my wifi to the robots wifi and ran the command. For some reason i keep getting errors saying i can't connect.

Could you maybe assist with a small guide on how to control a robot using the unitree_ros_to_real package?

JonasFovea commented 2 years ago

@Dvbritsem To control the robot via Wi-Fi, the following has to be run on the robots Pi (ssh pi@192.168.12.1 password 123):

  1. uncomment the line net.ipv4.ip_forward=1 in the file /etc/sysctl.conf if not already done
  2. Run (on the Pi):
    sudo sysctl -p
    sudo iptables -F
    sudo iptables -t nat -F
    sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
    sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    sudo iptables -A FORWARD -i wlan1 -o eth0 -j ACCEPT
    sudo iptables -A FORWARD -i eth0 -o wlan1 -j ACCEPT
  3. On your host machine:
    sudo route add -net 192.168.123.0/24 gw 192.168.12.1

This video states most of these steps.

xyq1223 commented 1 year ago

Hello,connecting to the robot dog through WiFi may be unstable. Please connect the robot dog with a network cable and try again.