public Boolean IsAtTheRightPlace(PointOriente pt) { if (!surfaceDeControle.Appartient(pt)) { return(false); } return(true); }
public Boolean IsAtTheRightAngle(PointOriente pt) { if (System.Math.Abs(pt.theta - pointDeReference.theta) > toleranceAngulaire) { return(false); } return(true); }
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)); }
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); }
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); }
public PointOriente translater(PointOriente pt) { return(translater(pt.x, pt.y, pt.theta)); }
public static LieuCle buildAndAddLieuCle(TypeDeLieu type, CouleurEquipe couleur, PointOriente pt) { return(buildAndAddLieuCle(type, couleur, pt, SURFACE_DE_CONTROLE_STANDARD, TOLERANCE_ANGULAIRE_STANDARD)); }
public Boolean IsAtTheRightPlaceAndAngle(PointOriente pt) { return(IsAtTheRightAngle(pt) && IsAtTheRightPlace(pt)); }
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); }