Esempio n. 1
0
 public Boolean IsAtTheRightPlace(PointOriente pt)
 {
     if (!surfaceDeControle.Appartient(pt))
     {
         return(false);
     }
     return(true);
 }
Esempio n. 2
0
 public Boolean IsAtTheRightAngle(PointOriente pt)
 {
     if (System.Math.Abs(pt.theta - pointDeReference.theta) > toleranceAngulaire)
     {
         return(false);
     }
     return(true);
 }
Esempio n. 3
0
        public double distanceSquared(PointOriente pt)
        {
            string abs   = pt.x.ToString();
            string ord   = pt.y.ToString();
            string angle = pt.theta.ToString();

            Robot.Informations.printInformations(Robot.Priority.LOW, " Calcul de la dustance carée au point orienté (" + abs + "," + ord + "," + theta + ")");
            return((pt.x - this.x) * (pt.x - this.x) + (pt.y - this.y) * (pt.y - this.y));
        }
Esempio n. 4
0
        private static readonly double TOLERANCE_ANGULAIRE_STANDARD         = 5;                                           // A fixer, radian ou degrès ?

        /// <summary>
        /// La surface de contrôle sert ?valider la position du robot : cf IsAtTheRightPlace
        /// Attention : la surface doit avoir pour origine (0,0), elle est clonée puis translatée automatiquement.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="pt"></param>
        /// <param name="surfaceControle"></param>
        /// <param name="toleranceAngulaire"></param>
        public LieuCle(TypeDeLieu type, PointOriente pt, ElementSurface surfaceControle, double toleranceAngulaire)
        {
            this.surfaceDeControle  = surfaceControle.clone();
            this.pointDeReference   = pt;
            this.toleranceAngulaire = System.Math.Abs(toleranceAngulaire);
            this.typeDeLieu         = type;

            this.surfaceDeControle.translater(pt);
        }
Esempio n. 5
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            PointOriente pt = (PointOriente)obj;

            Robot.Informations.printInformations(Robot.Priority.LOW, "Les informations sur le point orienté ont été récupérées");
            return(pt.x == this.x && pt.y == this.y && pt.theta == this.theta);
        }
Esempio n. 6
0
 public PointOriente translater(PointOriente pt)
 {
     return(translater(pt.x, pt.y, pt.theta));
 }
Esempio n. 7
0
 public static LieuCle buildAndAddLieuCle(TypeDeLieu type, CouleurEquipe couleur, PointOriente pt)
 {
     return(buildAndAddLieuCle(type, couleur, pt, SURFACE_DE_CONTROLE_STANDARD, TOLERANCE_ANGULAIRE_STANDARD));
 }
Esempio n. 8
0
 public Boolean IsAtTheRightPlaceAndAngle(PointOriente pt)
 {
     return(IsAtTheRightAngle(pt) && IsAtTheRightPlace(pt));
 }
Esempio n. 9
0
        public static LieuCle buildAndAddLieuCle(TypeDeLieu type, CouleurEquipe couleur, PointOriente pt, ElementSurface surfaceControle, double toleranceAngulaire)
        {
            LieuCle retour = new LieuCle(type, pt, surfaceControle, toleranceAngulaire);

            addLieuCle(type, couleur, retour);
            return(retour);
        }