[Unitree Go1] Low-level command values

Hello there!

As defined in the comm.h file, the robots motors can be controlled via the following values:

uint8_t mode;         // desired working mode
float q;              // desired angle (unit: radian) 
float dq;             // desired velocity (unit: radian/second)
float tau;            // desired output torque (unit: N.m)
float Kp;             // desired position stiffness (unit: N.m/rad )
float Kd;             // desired velocity stiffness (unit: N.m/(rad/s) 

Is there any further documentation on how to use this?

I would love to hear, that somebody has more information about this!
Thanks in advance

Jonas

If the motor controller is implemented as the one in the MIT Cheetah Mini, described by Ben Katz in his masters thesis on page 47 following, the five float values correspond as follows:

q   = position setpoint
dq  = velocity setpoint
tau = torque
Kp  = position gain
Kd  = velocity gain

But the big question stays: What does the mode do?

@jgrube we have a working demo of low level mode in our previous development, I will share via email. About your question for desired mode you actually have to set it to PMSM servo mode please have a look here. In this controller you can see we can set it to two modes either PMSM or Brake.

@jgrube I got the manufacturers documentation and its now available at quadruped docs.

So for the record, these two values are defined in the file, mentioned by @Tahir:

#define PMSM      (0x0A)
#define BRAKE     (0x00)

But this is from the unitree_ros repository, which means it is used with the simulation and therefore not necessarily with the real robot. Or am I wrong with this assumption?

In the examples in the unitree_legged_sdk/example, for example the example_position.cpp file, the LowCmd messages are initialized as all zeros.
After this, the mode of none of the motor commands is set to a different value, which means the mode is always set to zero and therefore to BRAKE-mode as stated above.

@Sohail thank you for adding this! But you should probably mention, that it’s in Chinese. Therefore a Translator plugin would be strongly recommended…

What I get from the mentioned documentation is, that the mode is initialized to “servo”-mode, whatever that means.
This is a contradiction to the above stated value interpretations. Or my translation is not correct…

@jgrube if I recall correctly I was diverted to the same controller because in my case things wasn’t working for A1. After setting to PosStopF, VelStopF and PMSM in respective fields for each mode my low level driver got working for all three modes which can be changed from ROS node.

In the examples in the unitree_legged_sdk/example , for example the example_position.cpp file, the LowCmd messages are initialized as all zeros.

Your point here is right that all the values are set to zero. But here in the link which you pointed they say default mode is actually servo mode which indeed is PMSM. I can be wrong but this is what I have understood. After setting all these things my low level driver atleast got working.