unitreerobotics / unitree_ros

BSD 3-Clause "New" or "Revised" License
463 stars 224 forks source link

Before runing unitree_servo, the robot shifts in Gazebo #21

Closed edward9503 closed 2 years ago

edward9503 commented 2 years ago

Hi there,

when I run the gazebo simulation launch file and before I run the servo.cpp to control the robot to stand up, the robot always shifts towards some random directios. I was wondering is it a bug? And how to solve this problem? Because I want to fix the base postion and orientation, as well as the feet position after the robot is standing up. Many thanks!

ZKBian commented 2 years ago

Hi edward,

This problem is related to Gazebo's surface contact simulation. Once the robot standing up, there are only point contact, then the robot will not shift. If you want to fix this problem, I guess you can remove the collision box of robot main body, and add 4 point contact on the bottom of main body

edward9503 commented 2 years ago

Hi edward,

This problem is related to Gazebo's surface contact simulation. Once the robot standing up, there are only point contact, then the robot will not shift. If you want to fix this problem, I guess you can remove the collision box of robot main body, and add 4 point contact on the bottom of main body

Hi

thanks for the reply. Because I am not familiar with the urdf or xacro, I was wondering can I add 4 point contacts for the body while keeping the collision box of the body at the same time?

Best

ZKBian commented 2 years ago

Yes, once the collision box does not contact with the floor, robot will not shift.

edward9503 commented 2 years ago

Yes, once the collision box does not contact with the floor, robot will not shift.

Thanks. I was wondering why the collision box was not added in the original code? is it because it will reduce the simulation speed?