qiayuanl / legged_control

NMPC, WBC, state estimation, and sim2real framework for legged robots based on OCS2 and ros-controls
BSD 3-Clause "New" or "Revised" License
908 stars 224 forks source link

Unitree Go1 is leaning #16

Open abrobotics opened 1 year ago

abrobotics commented 1 year ago

Hello, thank for this repository, it helps a lot!

I have a problem when I launch the controller on Unitree Go1: I robot is not flat, and when I trot, the rear right (RR) hip seems to be lower that the others. the most shocking behavior is that the robot limps to the right whereas the command is simply forward or backward (you can see in this video).

You can see that the RR foot force is different from the others: FootForce_bug4 IMU_bug4

Can you help with this ? I don't know if it's from IMU covariance, some hardware flaws or IMU/Joint bad calibration maybe.

qiayuanl commented 1 year ago

I'm happy that you like this repo. Your figure and plots are very convenient for me to find and solve your problems.

I have encountered some issues like yours in the A1 platform. The problem could be solved by joint calibration.

My A1 isn't calibrated so well when out-of-shell that it's visible to the naked eye (movement asymmetry even with the built-in controller).

You can communicate with the engineer in Unitree Robotics, who will tell you how to recalibrate the joint.

abrobotics commented 1 year ago

Thank you, I'll reach them

elpimous commented 1 year ago

@abrobotics, je ne serai pas contre un peu d'aide, si vous avez 2 secondes 😋 https://github.com/qiayuanliao/legged_control/issues/19#issue-1590848294

liukaishu commented 1 year ago

@elpimous Hello, have you solved this problem?

elpimous commented 1 year ago

@liukaishu Hey, not yet. Mr qiayuanliao is helping me, cool. You are welcome to help too. Thanks

zhuiyuehun commented 1 year ago

@abrobotics @elpimous hello,brother,have u solved this problem?

elpimous commented 1 year ago

Hey, @zhuiyuehun sorry, I'm not at this point for now, sorry

AndrewZheng-1011 commented 1 year ago

Hey,

I would like to get some information on the issues in the leaning of the robot. I did these in simulations such that there would be no hardware problems.

Stance Leaning So, I noticed that that both go1 and a1 robot has some leaning issues given enough time. For example, when letting the robot remain in stance for long periods of time, the robot starts to lean. Here are some pictures to help visualize the problem:

A1 Robot stance $t \geq 60s$ a1_leaning_stance

Go1 Robot stance $t \geq 60s$

go1_leaning_stance

Trot Drift Lastly, I am not sure if this error propagates toward when the robot is in stance, but, I conducted an experiment in which the robot starts to trot at the origin of the gazebo world. After $t\geq60s$, the robot starts to drift from the origin. Here are some more picture to help visualize the problem:

Go1 trot at $t=0s$ go1_trotting_initial

Go1 trot at $t\geq60s$ go1_trotting_after

The same drifting can be seen with the a1 robot when trotting.

Question Could I get some insights into what may be causing this? Is there a way to fix the drifting or leaning issue?

qiayuanl commented 1 year ago

Stance Leaning

The joint velocity provided by the gazebo is biased, even when the robot is standing statically. You can double-check by plotting the velocity value and position value of the knee joint - the position remains the same value but there is a constant value in velocity.

So this may cause stance leaning. I think I can differentiate the position instead of using the velocity provided by the gazebo directly to solve this problem.

Trot Drift

The contact, joint velocity, joint position, and the filter itself all have the error or basis, so it's unavoidable.

Peterxjerk commented 1 year ago

Hello, thank for this repository, it helps a lot!

I have a problem when I launch the controller on Unitree Go1: I robot is not flat, and when I trot, the rear right (RR) hip seems to be lower that the others. the most shocking behavior is that the robot limps to the right whereas the command is simply forward or backward (you can see in this video).

You can see that the RR foot force is different from the others: FootForce_bug4 IMU_bug4

Can you help with this ? I don't know if it's from IMU covariance, some hardware flaws or IMU/Joint bad calibration maybe.

Hello, I am also trying to apply this controller on Unitree Go1. Can you give me some suggestion on how to modify this package to make it suitable for Go1 robot? Should I change the unitree_sdk which is suitable for Go1?

lucasbrodo commented 12 months ago

Hi @AndrewZheng-1011 @abrobotics,

Have you found a way to improve the trot drifting ? Joint calibration ?

This is the original stance position from Unitree :
image

We can observe that the hips' angles are perfectly flat and that there is a fairly good spacing between the rear legs. Now this is the stance position from the controller after trotting : image image

Both front and rear legs seem to converge towards the inside of the robot ("V-shape" configuration). This behaviour can also be observed in Gazebo.

I think drifting could be improved if the angles of the hips were flatter.

What do you think ?

lucasbrodo commented 11 months ago

Hi all, So I have changed in task.info the hip angles and set them to 0.00. Looks nicer when the robot is standing.

However, it didn't affect the drifting. I tried to modify the MPC weight matrix Q to add more penalty on the x and y positions but no luck with that. I have also tried to increase the imuProcessNoisePositionand imuProcessNoiseVelocity. No difference. I have also tried the joint calibration but no effect whatsoever.

The robot keeps drifting backwards and ends up falling on its own.

@elpimous @AndrewZheng-1011 @abrobotics Any ideas guys ?

Thank you very much for your help !

elpimous commented 11 months ago

Sorry, mi not at this point for now... Really interest ING. Please continue to post with photos / videos. Following you 👍

elpimous commented 11 months ago

@lucasbrodo Hello Lucas. Could you help here ? https://github.com/qiayuanliao/legged_control/issues/51#issue-1920700311 Imu is working, motors are moving correctly, with 10Nm. I dont anderstand why robot can not maintain it position without trembling... I dont know where to start searching. 😕

abrobotics commented 11 months ago

Hi all,

Calibrating joints did help but there was still some stance leaning and trot drift. I managed to operate the Go1 robot during trials, but the motion still wasn't perfect.

Unfortunately, I finished my work on this project and I am no longer working on Unitree Go1 robot. As soon as I will get back access to my repo, I will share it here !

Thank's yall and good luck :)

YifuYuan commented 8 months ago

@lucasbrodo Hi Lucas, did you eventually find a way to solve the trot drifting issue? We implemented the legged_control framework on our Go1 and had the same issue. We've also tried the joint calibration but it didn't help. Appreciate any advice!