NDHANA94 / hyperdog_ros2

HyperDog is a quadruped robot which is fully based on ROS 2 and Micro-ROS
54 stars 17 forks source link

Robot not using uleg joint limits. #18

Open lukasehr opened 1 week ago

lukasehr commented 1 week ago

Hey there, thanks a lot for providing this awesome gaitgen. I am currently working on making it work on another robot dog. Now I have the issue, that the uleg joint could be moving way further to the front, but it doesnt which makes the robot instable. Is there a way to fix it? Like changing the nominal height? Did I miss something I have to adapt to make it work with other robot models?

Would love to get an answer, thank you!

NDHANA94 commented 1 week ago

Hey there!

Upper leg can actually move 360 degrees, but I have limited this angle as the actuators of actual robot. I'd recommend you to checkout the joint actuator limit of ur robot's ULeg joint.

lukasehr commented 1 week ago

Thank you a lot for the fast reply! Do you mean the limits that you set in consts.xacro? I set the lower limit to -1.57 and the upper limit to 0.19625. I tested those values by changing the joint_angs in inverse_kinematic_node to values that are over/under that limit and they seem to provide realistic movements. However it seems like the gaitgen only "uses" the angles between 0 and 0.19625. In my robot, negative joint angles make the legs go forward btw. Maybe thats the source of the problem? Or are there other limits somewhere else in the gaitgen?

I am sorry for the amount of text and I hope you understand what I am trying to explain :)

NDHANA94 commented 1 week ago

Please provide an image or a video explaining what you are struggling.

lukasehr commented 1 week ago

I now compared the two robots in rviz2 and realized, that my robot has a different joint configuration (for example the uleg joint turns in the different direction) Also the starting position differs from your robot. I now edited the inverse_kinematic_node and it is now working almost as expected. Only one thing: The joint limits are set such that the robot could go very far down/up, but it seems like there are other limits stopping it from doing so?

I'll take a look to the values in InverseKinematics.py where MIN_ANG_L2L3, MAX_ANG_L2L3 and so on are defined. I have a feeling that this could be the solution?

Also the robot has a non smooth movement if the height is too high, almost as if it goes into singularities there.

Thanks again for providing the awesome gaitgen, it's a challenge to make it work, but it is a lot of fun aswell!