Controlling robot via VM

Thank you for your reply Tahir.

On Nvidia (192.168.123.12) these are the open connections:

Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0    200 nx:ssh                  192.168.123.153:60719   ESTABLISHED
udp   213248      0 nx:8090                 192.168.123.161:8082    ESTABLISHED
udp        0      0 localhost:57397         localhost:domain        ESTABLISHED

These are the open connections when i netstat the raspberry pi (192.168.123.161):

Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0     36 192.168.123.161:ssh     192.168.123.153:60765   ESTABLISHED
udp        0      0 192.168.123.161:8008    192.168.123.10:8007     ESTABLISHED
udp     1536      0 192.168.123.161:8009    192.168.123.10:8007     ESTABLISHED

I tried to use the sdk on the robot without VM and it has the same problem.
My guess is that the IP and port is configured wrong? My nvidia board and raspberry pi have different static IP’s than the ones in the docs (they are reversed compared to those on docs.quadruped.de). If the unitree_legged_sdk works with standard IP’s, maybe it malfunctions due to this?

I appreciate your help on this.

Have you tried switching the IP?

Also, can you verify that the LCM has been built for the unitree_legged_sdk?

What is the best way to do that? I tried switching the adress defined in the example_walk.cpp file but that didn’t work.

With LCM built you mean the lcm files in the build folder?

Exactly, though the script should have already built it in the catkin_ws/utils/lcm-1.4.0/build. Please check if the example_wirelessHandle.cpp is working? Also can you tell the method of how you are connecting to the robot? is it via WiFi or LAN?

Also please connect to the A1 using your mobile phone and check the firmware version of the A1.

In lib/udp.h change the port according to the ones that are open for udp and build the build the folder as instructed in the readme.md of the unitree_legged_sdk

Then rerun the example.

Dear Sohail,

It worked! I rebuilt the lcm in the catkin_ws/utils/ folder. However, it only works when I run the example_walk file inside the unitree_legged_sdk-3.2.0 folder.

Is there any way I can make it work with the sdk 3.3.1? I copied the 3.3.1 version into the catkin_ws/utils directory and tried to run it but it gave me the ip&port error.

So I compared the working 3.2 version with the 3.3.1 version and here is what I found:

  • udp.h file is identical
  • example_walk.cpp is not the same. In the connection section, the 3.2.0 example_walk.cpp file (which works) has this:
public:
    Custom(uint8_t level): safe(LeggedType::A1), udp(level){
        udp.InitCmdData(cmd);
    }
    void UDPRecv();
    void UDPSend();
    void RobotControl();

    Safety safe;
    UDP udp;
    HighCmd cmd = {0};
    HighState state = {0};
    int motiontime = 0;
    float dt = 0.002;     // 0.001~0.01
};

The 3.3.1 example_walk.cpp file has this:

public:
    Custom(uint8_t level): safe(LeggedType::A1), udp(8090, "192.168.123.161", 8082, sizeof(HighCmd), sizeof(HighState)){
        udp.InitCmdData(cmd);
    }
    void UDPRecv();
    void UDPSend();
    void RobotControl();

    Safety safe;
    UDP udp;
    HighCmd cmd = {0};
    HighState state = {0};
    int motiontime = 0;
    float dt = 0.002;     // 0.001~0.01
};

I ran the example_walk file again after I changed that part. It seems to have connected, but the robot isn’t moving.

1 Like

Dear @nvmten,

Great to hear that, I believe that v3.2 works with specific firmware of the A1. v3.3.1 requires a different perhaps an updated firmware but I will to confirm that and get back to you!

Hi @Sohail, do you have an update for me?

Thank you and best regards
tenzin

Pardon the late reply, I’ve contacted the manufacturers and they have reached the same conclusion that it may be due to a firmware mismatch.

The app can be downloaded from the docs. Also if possible please send a screenshot of the error.

You can check the firmware of your robot via the mobile app or by running this command.

cd /home/unitree/Unitree/keep_program_alive
./bin/A1_sport_1 -v

Hi Sohail,

The keep_program_alive folder was on the raspberry pi and it says 1.19.

Does that mean it’s a configuration error and not a firmware problem?

Thank you and best regards

Yea the software seems to be the correct version so it is a configuration issue.

What would be the best course of action now?
Do you perhaps have network configuration files that I can use?
Or maybe a guide how to correctly install/configure the newest SDK.

For now, I would suggest using the 3.2 SDK which is working, I will try and inquire with the manufacturers on the configuration issue for the 3.3.1 SDK.

The issue is most of the A1’s vary from batch to batch, not only in software but hardware as well, so narrowing down the issue is troublesome.

Thank you very much. Sorry for the trouble.
There are some cool features on the 3.3.1. For 3.2 we would have to program those ourselves.

Do you perhaps know how we could make the robot squad (sit down on his hind legs) with the sdk?

Making the robot do such stuff requires low-level control of the joints.

But that is only possible in “normal mode” as far as I know.
Therefore you’d have to implement everything from scratch.

I am not aware of a possibility to add features to the sport controller, but maybe I’m wrong

@nvmten with the current level of ROS A1 support its not possible but it is possible to squad the robot using 3.3.4 in unitree_legged_sdk we are planning to update A1 driver to 3.3.4. Please send an email to support@mybotshop.de to get the updated version by next week.

@jgrube it is possible to change the robot mode in A1 by changing the ip address at initialization time of sdk.

Amazing! Thank you, everyone!