qiayuanl / legged_control

Nonlinear MPC and WBC framework for legged robot based on OCS2 and ros-controls
BSD 3-Clause "New" or "Revised" License
854 stars 217 forks source link

bad initial robot pose on gazebo. #24

Closed elpimous closed 1 year ago

elpimous commented 1 year ago

Hello, ylo2 robot xacro and urdf correctly done. when running : roslaunch legged_unitree_description empty_world.launch

Robot doesn't start sitted on ground.

Capture d’écran de 2023-02-26 23-26-04

All dynamics inertial values are correctly feeded into the const.xacro tested some walks : legs move cycle work correctly.

Ps: for now, my robot keeps A1 name and refs

elpimous commented 1 year ago

@qiayuanliao where, in your code, i set initial pose ? here ? : https://github.com/qiayuanliao/legged_control/blob/a09c899a2cf1891b375f3bc117931ace8edae3c9/legged_controllers/config/a1/reference.info#L4-L19

qiayuanl commented 1 year ago

@qiayuanliao where, in your code, i set initial pose ? here ? :

https://github.com/qiayuanliao/legged_control/blob/a09c899a2cf1891b375f3bc117931ace8edae3c9/legged_controllers/config/a1/reference.info#L4-L19

No, the code you mentioned is for the controller and solver.

The gazebo determines the initial configuration. To see what happened, press ctrl-r in the gazebo. and the robot will fall from the height set in empty_world.launch (-z 0.5). I think you can change the height to get an acceptable initial height.

elpimous commented 1 year ago

Thanks @qiayuanliao . I can correct initial body pose. But what about legs ?? i should import a param file for legs position, correct ? Capture d’écran de 2023-01-27 20-57-58

elpimous commented 1 year ago

Always looking for stand-down origin legs position. Is it here ? https://github.com/qiayuanliao/legged_control/blob/eff523ddec6b392414073d7ff5f1534cd411c533/legged_controllers/config/a1/task.info#L162-L175 It's into initialState{}

elpimous commented 1 year ago

Hi all. Where can I set initial joints position ? under xacro ? elsewhere ?

elpimous commented 1 year ago

It was a bad urdf !!!