def METHOD_NAME(self, msg: Odometry):
    q = msg.pose.pose.orientation
    yaw = atan2(2.0 * (q.w * q.z + q.x * q.y), 1.0 - 2.0 * (q.y * q.y + q.z * q.z))
    if not self.odom_params_initialised:
        if yaw < 0:
            yaw = 2 * pi + yaw
        self.odom_params_initialised = True
        self.odom_angular_last = yaw
        self.odom_angular_start = yaw
        self.odom_angular_last_abs = yaw
        self.odom_linear_start = msg.pose.pose.position.x
        return
    # Resolve singularities (first for positive angle and then for negative angle)
    if yaw - self.odom_angular_last > pi:
        self.odom_angular_last_abs += 2*pi - (yaw - self.odom_angular_last)
    elif self.odom_angular_last - yaw > pi:
        self.odom_angular_last_abs += 2*pi - (self.odom_angular_last - yaw)
    else:
        self.odom_angular_last_abs += yaw - self.odom_angular_last
    # Angular calibration
    if self.type.value == 'angular':
        self.get_logger().info('Angular calibration in progress...')
        self.set_velocity(0, ANGULAR_VELOCITY)
        n_rotations = (self.odom_angular_last_abs - self.odom_angular_start)/(2*pi)
        if n_rotations > NUMBER_OF_ROTATIONS:
            self.finish_calibration()
        self.get_logger().info(f'Number of rotations: {n_rotations:.4f}')
    # Linear calibration
    if self.type.value == 'linear':
        self.get_logger().info('Linear calibration in progress...')
        self.set_velocity(LINEAR_VELOCITY, 0)
        passed_distance = msg.pose.pose.position.x - self.odom_linear_start
        self.get_logger().info(f'Passed distance: {passed_distance:.4f}')
        if passed_distance > self.distance.value:
            self.finish_calibration()
    # Save readings
    self.odom_angular_last = yaw