I’m trying to get the example_position working on the robot, but only receive zeroes, let me explain.
I am connected to the robot through Ethernet, and I am following the tutorial to test the example_position. Making the package worked well. When I start the example_position, I receive only lines of 104896 0.000000 0.000000 (with the first number incrementing). This corresponds to printf("%d %f %f\n", motiontime, state.motorState[FR_1].q, state.motorState[FR_1].dq); in the cpp file. This means that my computer doesn’t receive the actual position and velocity of the joint.
I checked with Wireshark, and UDP communications are both ways from my computer to the MCU (IPs 192.168.123.10 and 192.168.12.132), and there is data in these messages, even if I cannot see what is in there I see that they are not empty and varying. I therefore suppose that there is actually the correct data sent from the robot to my computer.
What could cause the reading to give only zeroes?
For information: When I connect to the raspberry pi through Ethernet with ssh, I can start the executables from the ~unitree/sdk/unitree_legged_sdk/build directory and it works: the leg actually moves.
I don’t know if it’s really necessary, but did you change the robots mode to “normal mode” before running the program?
That is described in the video tutorial by Unitree on YouTube…
Does the example_walk program work for you (robot has to be in “sport mode”, which is the default it boots into)
FROM MY EXTERNAL PC:
I switched to normal mode as described and tried example_position, example_torque, example_velocity. In all cases nothing happens. The “state” variable seems to be empty in all cases.
Then I rebooted, stayed in sport mode, and tried example_walk. Still nothing happens, only lines of zeroes.
FROM THE RASPBERRY PI IN THE ROBOT:
Everything works.
In case it can help:
I’m on Ubuntu 20.04
Legged_sport version:1.32 (as shown after running sudo ./bin/Legged_sport -v )
Sport Mode version: 1.3.8 (as shown from the app)
This seems to be an issue with the type of connection. On ethernet and on wifi hotspot it behaves differently. When you run the command on which connection are you on?
Yes I have followed the video, and this says to use the IP address I’m using when using ethernet. I also tried to use the one ending with 161 but it does exactly the same thing.
What is weird is that with a sniffer I can see that some data is going both ways through udp, and even if I cannot see what is in there, it’s not only zeroes. See example below of one message in hexadecimal format, from the 192.168.123.10 to 192.168.123.162.
Ok, I found out that the problem is solved by going back to an older version of the sdk. Now I put version 3.4.2 on my external computer and it works. @MYBOTSHOP_Support, that’s probably something that should be brought to the ears of the manufacturers.