Exemple #1
0
        private bool LocateVisionTargets(ref Controller logitechController, ref SerialCommsHandler NUC_SerialConnection)
        {
            float speed = 1.0f;

            if (NUC_SerialConnection.HasVisionConnection())
            {
                if (!potentialMatch)
                {
                    potentialMatch     = true;
                    potentialMatchTime = stopwatch.DurationMs;
                }
                else if ((stopwatch.DurationMs - potentialMatchTime) > POTENTIAL_MATCH_TIMEOUT)
                {
                    return(true);
                }

                if (NUC_SerialConnection.GetAbsolutePosition().yaw > 0)
                {
                    speed = 0;                                                     //Change to less than (yaw < 0) if LEFT_Y set to negative speed
                }
            }
            else
            {
                potentialMatch = false;
            }

            logitechController.AXES.LEFT_Y  = speed;
            logitechController.AXES.RIGHT_Y = -speed;

            return(false);
        }