DRCL-USC / Hector_Simulation

Simulation Software (ROS/MATLAB) for HECTOR Humanoid Robot Locomotion Control/Bipedal Locomotion Control/Force-and-moment-based MPC
https://youtu.be/NcW-NFwjMh0
Other
393 stars 121 forks source link

Problems about rotation matrix and euler angle #10

Closed BIT-XLJ closed 10 months ago

BIT-XLJ commented 10 months ago

Thanks for your great job! But when I read your source code, I find something wired. 2023-12-12 17-00-41屏幕截图 In the file SolverMPC.cpp, why you first obtain Euler angle from Quaternion, and then get rotation matrix from euler angle? Why use this instead of rs.R_yaw? And when I use rs.R_yaw, the simulation will fail. But as described in your essay, the rotation matrix should be rs.R_yaw. Also, I don't know the function euler_to_rotation(). 2023-12-12 17-15-32屏幕截图 Why the return value is this?What is the physical meaning behind the return value?

junhengl commented 10 months ago

Hello, thanks for the questions. We found using Ryaw in rotation dynamics is not accurate enough for highly dynamic 3D motions. As indicated in the code, Rb represents the rotation dynamics mapping between rate of change of Euler angles and angular velocity. The difference between Rb and Ryaw is Ryaw has further assumption of small and negligible roll and pitch angles. We will rewrite this part for more clarity, sorry for the confusion.