unitreerobotics / unitree_legged_sdk

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

Joystick.h file in Go1 SDK #97

Open realquantumcookie opened 1 year ago

realquantumcookie commented 1 year ago

Hello! I'm just looking at this file

joystick.h

In line 31 it states that the struct xRockerBtnDataStruct takes 24 Bytes but it should take 38 bytes right? Because uint8_t head[2] takes 2 bytes, xKeySwitchUnion btn takes 16 bytes, each float takes 4 bytes so should be $2+16+4 \times 5 = 38$ Bytes? Also what is float L2 for in this struct?

xyq1223 commented 1 year ago

Hello, we communicated this problem with our R&D colleagues. In the joystick.h file, there is no problem with the relevant comments of the code. You can refer to this example and run the code. If you encounter any problems, please feel free to feedback

https://github.com/unitreerobotics/unitree_legged_sdk/blob/go1/example/example_joystick.cpp