unitreerobotics / unitree_legged_sdk

SDK tools for control robots.
BSD 3-Clause "New" or "Revised" License
283 stars 156 forks source link

[Urgent] IP & Port Error when running example files in A1 #63

Open tlangdun opened 1 year ago

tlangdun commented 1 year ago

Robot: A1 Nvidia board IP: 192.168.123.12 Pi Ip (rear end of the robot): 192.168.123.161

Steps to recreate:

  1. Connected to Nvidia board
  2. Run sudo ./example_walk
  3. Error pops up: Error: Bind client ip&port failed.

Do I have to configure my ip and port to solve this issue? How should I proceed?

JonasFovea commented 1 year ago

Are the ports already in use? Is the IP configured correctly?

Which version of the SDK are you using?

tlangdun commented 1 year ago

The 3.2 version works fine. These are the ports and IP on the 3.2 that work:

constexpr int UDP_CLIENT_PORT = 8080;                       // local port
constexpr int UDP_SERVER_PORT = 8007;                       // target port
constexpr char UDP_SERVER_IP_BASIC[] = "192.168.123.10";    // target IP address
constexpr char UDP_SERVER_IP_SPORT[] = "192.168.123.161";   // target IP address

However, any version above it, namely 3.3 to 3.3.4 do not work. I'm not sure why. How to check if the IP is configured correctly? I noticed that 3.3 uses a different configuration. In the example_walk file, the udp is initialized differently:

    Custom(uint8_t level): safe(LeggedType::A1), udp(8090, "192.168.123.161", 8082, sizeof(HighCmd), sizeof(HighState)){
        udp.InitCmdData(cmd);
    }
JonasFovea commented 1 year ago

I have heard, that some versions may not work due to outdated firmware. Since the ports you described have changed, I would guess, that your current firmware doesn't support the SDK version.

@TrivasZhang might be able to confirm that

You'd probably need to specify the firmware version.

For now I would suggest to stick with the older SDK version, if that works for you.

tlangdun commented 1 year ago

Thank you for the information!

Maddy1206 commented 1 year ago

@tlangdun Maybe you can run the v3.3.1 on the Pi. Worked for me, but on the NX it did not work, too.

guyo-shifters commented 7 months ago

this helps a lot :) since then did you manage to run it with anything newer then 3.2? I am having the same problem and would like to use 3.3 high level functions