Beispiel #1
0
    //! @return the sphero's heading without relying on vision - before vision is primed this appears more correct
    private float ComputeSpheroHeadingCalibration()
    {
        const float angularCorrection = -90.0f;

        // get the sphero position data to work out the angle to the sphero
        Vector3 spheroPosition = VisionUtils.s_spheroToUnityTransform * SpheroNativePosition();
        float   angleToSphero  = Mathf.Atan2(spheroPosition.z, spheroPosition.x) * Mathf.Rad2Deg;

        return(sphero.ApplyCalibrationToHeading(SpheroYaw) + angleToSphero + angularCorrection);
    }