(self, body1, body2, angle1, angle2)
Converts the given absolute angle of the arms to joint angles
Converts the given absolute angle of the arms to joint angles
Converts the given absolute angle of the arms to joint angles
def set_joint_angles(self, body1, body2, angle1, angle2):
        """ Converts the given absolute angle of the arms to joint angles"""
        pos = self.base.GetWorldPoint((0, 0))
        body1.angle = angle1 + np.pi
        new_pos = body1.GetWorldPoint((0, 5))
        body1.position += pos - new_pos
        body2.angle = angle2 + body1.angle
        pos = body1.GetWorldPoint((0, -4.5))
        new_pos = body2.GetWorldPoint((0, 4.5))
        body2.position += pos - new_pos
def set_joint_angles ( self , body1 , body2 , angle1 , angle2 ) : pos = self . base . GetWorldPoint ( ( 0 , 0 ) ) body1 . angle = angle1 + np . pi new_pos = body1 . GetWorldPoint ( ( 0 , 5 ) ) body1 . position += pos - new_pos body2 . angle = angle2 + body1 . angle pos = body1 . GetWorldPoint ( ( 0 , - 4.5 ) ) new_pos = body2 . GetWorldPoint ( ( 0 , 4.5 ) ) body2 . position += pos - new_pos