robomechanics / quad-sdk

Software tools for agile quadrupeds, developed by the Robomechanics Lab at Carnegie Mellon University.
https://robomechanics.github.io/quad-sdk/
MIT License
736 stars 137 forks source link

Running in the step_20cm and rough_25cm environments resulted in an exception #388

Closed nanbwrn closed 1 year ago

nanbwrn commented 1 year ago

I replaced the robot with another one (go1) and ran it in the SDK. And I use MATLAB to generate C code for NMPC from the gen folder. When running global planning in these two environments, I noticed that the robot lost balance in its motion. When using the twist command for control, the robot can move normally, but the trajectory of the robot's center of mass appears strange compared to the spirit robot. The green line representing the center of mass trajectory of go1 doesn't seem to fit well like the spirit robot(the position and length of the green line.).

It can be seen that the generated trajectory seems to be located at the chin of go1. Could it be that the error in the body trajectory has led to the failure of the final simulation?

be25b04db5189d75510fa0c32514389

spirit(质心)

ddf8811a5ae0771514c0230317f92e3

Below are the videos of these two scenarios.

https://github.com/robomechanics/quad-sdk/assets/132453617/9aba810c-05d1-4657-bf94-6d8259aecb0e

https://github.com/robomechanics/quad-sdk/assets/132453617/f6c70cf1-6436-45f8-86ad-220414fa31ee

Czworldy commented 1 year ago

Which branch you use by the way?

nanbwrn commented 1 year ago

My system is Ubuntu 18.04, and I am using the main branch.

Czworldy commented 1 year ago

maybe you should check desired_height in local_planner.yaml

nanbwrn commented 1 year ago

Thank you for your response.

nanbwrn commented 1 year ago

I set the desired_height value to 0.5, which was previously 0.27, but the result was still that the foot touched above the step and fell down.Even when I decrease its value, it still falls down. I suspect that the trajectory of the center of mass is incorrect, but I'm not sure how to modify it, or there may be other reasons causing this issue.

nanbwrn commented 1 year ago

It is also strange that it cannot stand properly in the rough_25cm environment.

ardalantj commented 1 year ago

Hi @nanbwrn,

The standing on rough terrain is a known problem and it just really depends on your initial condition. If the robot tries to stand on a slanted surface, then it might not be able to balance itself as the planning stack does not run until the robot starts moving. If you change your initial condition, this problem should not occur. Regarding the jumping scenario, have you tried tuning the Kp and Kd gains of various joints?

nanbwrn commented 1 year ago

I adjusted the robot's initial position according to the steps you mentioned, and now it can stand in the rough_25cm environment and operate properly

nanbwrn commented 1 year ago

I adjusted the values of swing_kp and swing_kd in quad_utils/config/.yaml under the robot_driver section. Sometimes the robot can jump over obstacles successfully, but other times it falls down. This is related to the pre-planned path. I will continue to try . thank you for your help