URDF course - Unit 2: Using URDF for Gazebo

in my_mira_demo.py,

def assertAlmostEqualAngles(self, x, y,):
c2 = (sin(x) - sin(y)) ** 2 + (cos(x) - cos(y)) ** 2
angle_diff = acos((2.0 - c2) / 2.0)
return angle_diff

Would like to have more explanation about why we are doing this (like (sin(x) - sin(y)) ** 2 + (cos(x) - cos(y)) ** 2, what does this mean?)

Hi Kane,

Could you elaborate more on what you don’t understand exactly?

  • You think the math formula is incorrect?
  • You don’t understand how the math formula was translated to Python code?

Not quite understand the physical meaning of these 2 formula.
Thanks.

They are scientific calculations…we may not understand them but they work. For this course, we just need to know how to use them.