leggedrobotics / raisimLib

RAISIM, A PHYSICS ENGINE FOR ROBOTICS AND AI RESEARCH
http://www.raisim.com
327 stars 50 forks source link

bug on math::angleAxisToQuaternion #32

Closed dytan closed 4 years ago

dytan commented 4 years ago

Hello, found a bug on math.cpp angleAxisToQuaternion:

inline void angleAxisToQuaternion(const Vec<3> &a1, const double theta, Vec<4>& quaternion) {
  quaternion[0] = cos(theta * .5);
  quaternion[0] = a1[0] * sin(theta * .5);
  quaternion[1] = a1[1] * sin(theta * .5);
  quaternion[2] = a1[2] * sin(theta * .5);
}

index is not right, suppose to be:

inline void angleAxisToQuaternion(const Vec<3> &a1, const double theta, Vec<4>& quaternion) {
  quaternion[0] = cos(theta * .5);
  quaternion[1] = a1[0] * sin(theta * .5);
  quaternion[2] = a1[1] * sin(theta * .5);
  quaternion[3] = a1[2] * sin(theta * .5);
}
jhwangbo commented 4 years ago

Thank you for reporting a bug. It is fixed in the latest commit.