예제 #1
0
파일: RobotReel.cs 프로젝트: Omybot/GoBot
        public override List <int>[] DiagnosticLine(int distance, SensAR sens)
        {
            _lastPidTest    = new List <int> [2];
            _lastPidTest[0] = new List <int>();
            _lastPidTest[1] = new List <int>();

            _lockFrame[UdpFrameFunction.FinDeplacement] = new Semaphore(0, int.MaxValue);

            Frame frame = UdpFrameFactory.Deplacer(sens, distance, this);

            _asserConnection.SendMessage(frame);

            frame = UdpFrameFactory.DemandePositionsCodeurs(this);

            while (!_lockFrame[UdpFrameFunction.FinDeplacement].WaitOne(0))
            {
                _asserConnection.SendMessage(frame);
                Thread.Sleep(30);
            }

            List <int>[] output = new List <int> [2];
            output[0] = new List <int>(_lastPidTest[0]);
            output[1] = new List <int>(_lastPidTest[1]);

            return(output);
        }
예제 #2
0
        private void RecalProcedure(SensAR sens)
        {
            int realAccel = SpeedConfig.LineAcceleration;
            int realDecel = SpeedConfig.LineAcceleration;

            SpeedConfig.LineAcceleration = 50000;
            SpeedConfig.LineDeceleration = 50000;

            IShape contact = GetBounds();

            double lenght = sens == SensAR.Arriere ? LenghtBack : LenghtFront;

            while (Position.Coordinates.X - lenght > 0 &&
                   Position.Coordinates.X + lenght < GameBoard.Width &&
                   Position.Coordinates.Y - lenght > 0 &&
                   Position.Coordinates.Y + lenght < GameBoard.Height)// &&
            //!GameBoard.ObstaclesAll.ToList().Exists(o => o.Cross(contact))) // TODO ça marche pas on dirait le test de recallage sur les obstacles
            {
                if (sens == SensAR.Arriere)
                {
                    MoveBackward(1);
                }
                else
                {
                    MoveForward(1);
                }

                contact = GetBounds();
            }

            SpeedConfig.LineAcceleration = realAccel;
            SpeedConfig.LineDeceleration = realDecel;

            _inRecalibration = false;
        }
예제 #3
0
        public override void MoveForward(int distance, bool wait = true)
        {
            base.MoveForward(distance, wait);

            IsInLineMove = true;

            if (distance > 0)
            {
                if (!_inRecalibration)
                {
                    Historique.AjouterAction(new ActionAvance(this, distance));
                }
                _sensMove = SensAR.Avant;
            }
            else
            {
                if (!_inRecalibration)
                {
                    Historique.AjouterAction(new ActionRecule(this, -distance));
                }
                _sensMove = SensAR.Arriere;
            }

            _destination = new Position(Position.Angle, new RealPoint(Position.Coordinates.X + distance * Position.Angle.Cos, Position.Coordinates.Y + distance * Position.Angle.Sin));

            // TODO2018 attente avec un sémaphore ?
            if (wait)
            {
                while ((Position.Coordinates.X != _destination.Coordinates.X ||
                        Position.Coordinates.Y != _destination.Coordinates.Y) && !Execution.Shutdown)
                {
                    Thread.Sleep(10);
                }
            }
        }
예제 #4
0
 public ActionVirage(Robot r, int dist, AngleDelta a, SensAR ar, SensGD gd)
 {
     robot    = r;
     distance = dist;
     angle    = a;
     sensAR   = ar;
     sensGD   = gd;
 }
예제 #5
0
 public ActionVirage(Robot r, int dist, int a, SensAR ar, SensGD gd)
 {
     robot = r;
     distance = dist;
     angle = a;
     sensAR = ar;
     sensGD = gd;
 }
예제 #6
0
        public override void PolarTrajectory(SensAR sens, List <RealPoint> points, bool wait = true)
        {
            _polarTrajectory   = points;
            _currentPolarPoint = 0;

            while (wait && _currentPolarPoint != -1)
            {
                Thread.Sleep(10);
            }
        }
예제 #7
0
        static public Frame Recallage(SensAR sens, Robot robot)
        {
            byte[] tab = new byte[3];
            tab[0] = (byte)robot.AsservBoard;
            tab[1] = (byte)UdpFrameFunction.Recallage;
            tab[2] = (byte)sens;

            Frame retour = new Frame(tab);

            return(retour);
        }
예제 #8
0
        static public Frame EnvoiConsigneBrute(int consigne, SensAR sens, Robot robot)
        {
            byte[] tab = new byte[5];
            tab[0] = (byte)robot.AsservBoard;
            tab[1] = (byte)UdpFrameFunction.AsserEnvoiConsigneBrutePosition;
            tab[2] = (byte)sens;
            tab[3] = (byte)ByteDivide(consigne, true);
            tab[4] = (byte)ByteDivide(consigne, false);

            Frame retour = new Frame(tab);

            return(retour);
        }
예제 #9
0
        static public Frame Deplacer(SensAR sens, int distance, Robot robot)
        {
            byte[] tab = new byte[5];
            tab[0] = (byte)robot.AsservBoard;
            tab[1] = (byte)UdpFrameFunction.Deplace;
            tab[2] = (byte)sens;
            tab[3] = ByteDivide(distance, true);
            tab[4] = ByteDivide(distance, false);

            Frame retour = new Frame(tab);

            return(retour);
        }
예제 #10
0
        public override List <int>[] DiagnosticPID(int steps, SensAR sens, int pointsCount)
        {
            List <int>[] output = new List <int> [2];
            output[0] = new List <int>();
            output[1] = new List <int>();

            for (double i = 0; i < pointsCount; i++)
            {
                output[0].Add((int)(Math.Sin((i + DateTime.Now.Millisecond) / 100.0 * Math.PI) * steps * 10000000 / (i * i * i)));
                output[1].Add((int)(Math.Sin((i + DateTime.Now.Millisecond) / 100.0 * Math.PI) * steps * 10000000 / (i * i * i) + 10));
            }

            return(output);
        }
예제 #11
0
        static public Frame Virage(SensAR sensAr, SensGD sensGd, int rayon, AngleDelta angle, Robot robot)
        {
            byte[] tab = new byte[8];
            tab[0] = (byte)robot.AsservBoard;
            tab[1] = (byte)UdpFrameFunction.Virage;
            tab[2] = (byte)sensAr;
            tab[3] = (byte)sensGd;
            tab[4] = (byte)ByteDivide(rayon, true);
            tab[5] = (byte)ByteDivide(rayon, false);
            tab[6] = (byte)ByteDivide((int)(angle * 100), true);
            tab[7] = (byte)ByteDivide((int)(angle * 100), false);

            Frame retour = new Frame(tab);

            return(retour);
        }
예제 #12
0
파일: RobotReel.cs 프로젝트: Omybot/GoBot
        public override void PolarTrajectory(SensAR sens, List <RealPoint> points, bool wait = true)
        {
            if (wait)
            {
                _lockFrame[UdpFrameFunction.FinDeplacement] = new Semaphore(0, int.MaxValue);
            }

            Frame frame = UdpFrameFactory.TrajectoirePolaire(sens, points, this);

            _asserConnection.SendMessage(frame);

            if (wait)
            {
                _lockFrame[UdpFrameFunction.FinDeplacement].WaitOne();
            }
        }
예제 #13
0
        public RobotSimu(IDRobot idRobot) : base(idRobot, "Robot Simu")
        {
            _highResolutionAsservissement = true;
            _rand = new Random();

            _linkAsserv       = ThreadManager.CreateThread(link => Asservissement());
            _linkLogPositions = ThreadManager.CreateThread(link => LogPosition());

            _lockMove = new Semaphore(1, 1);
            _sensMove = SensAR.Avant;

            _inRecalibration   = false;
            _asserChrono       = null;
            _currentPolarPoint = -1;

            BatterieVoltage = 25;
        }
예제 #14
0
파일: Robot.cs 프로젝트: Omybot/GoBot
        public virtual void Recalibration(SensAR sens, bool waitEnd = true, bool sendOffset = false)
        {
            int angle = 0;

            double toleranceXY    = 30;
            double toleranceTheta = 3;

            double dist = (sens == SensAR.Avant ? Robots.MainRobot.LenghtFront : Robots.MainRobot.LenghtBack);

            if (waitEnd && sendOffset)
            {
                if (Position.Angle.IsOnArc(0 - toleranceTheta, 0 + toleranceTheta))
                {
                    angle = 0;
                }
                else if (Position.Angle.IsOnArc(90 - toleranceTheta, 90 + toleranceTheta))
                {
                    angle = 90;
                }
                else if (Position.Angle.IsOnArc(180 - toleranceTheta, 180 + toleranceTheta))
                {
                    angle = 180;
                }
                else if (Position.Angle.IsOnArc(270 - toleranceTheta, 270 + toleranceTheta))
                {
                    angle = 270;
                }

                if (Position.Coordinates.X < dist + toleranceXY && Position.Coordinates.X > dist - toleranceTheta)
                {
                    SetAsservOffset(new Position(angle, new RealPoint(dist, Position.Coordinates.Y)));
                }
                else if (Position.Coordinates.X > 3000 - dist)
                {
                    SetAsservOffset(new Position(angle, new RealPoint(3000 - dist, Position.Coordinates.Y)));
                }
                else if (Position.Coordinates.Y < dist)
                {
                    SetAsservOffset(new Position(angle, new RealPoint(Position.Coordinates.X, dist)));
                }
                else if (Position.Coordinates.Y > 2000 - dist)
                {
                    SetAsservOffset(new Position(angle, new RealPoint(Position.Coordinates.X, 2000 - dist)));
                }
            }
        }
예제 #15
0
        public override void Recalibration(SensAR sens, bool wait = true, bool sendOffset = false)
        {
            _inRecalibration = true;

            Historique.AjouterAction(new ActionRecallage(this, sens));

            if (wait)
            {
                RecalProcedure(sens);
            }
            else
            {
                ThreadManager.CreateThread(link => RecalProcedure(sens)).StartThread();
            }

            base.Recalibration(sens, wait, sendOffset);
        }
예제 #16
0
파일: RobotReel.cs 프로젝트: Omybot/GoBot
        public override void Turn(SensAR sensAr, SensGD sensGd, int radius, AngleDelta angle, bool wait = true)
        {
            if (wait)
            {
                _lockFrame[UdpFrameFunction.FinDeplacement] = new Semaphore(0, int.MaxValue);
            }

            Frame frame = UdpFrameFactory.Virage(sensAr, sensGd, radius, angle, this);

            _asserConnection.SendMessage(frame);

            Historique.AjouterAction(new ActionVirage(this, radius, angle, sensAr, sensGd));

            if (wait)
            {
                _lockFrame[UdpFrameFunction.FinDeplacement].WaitOne();
            }
        }
예제 #17
0
파일: RobotReel.cs 프로젝트: Omybot/GoBot
        public override void Recalibration(SensAR sens, bool wait = true, bool sendOffset = false)
        {
            if (wait)
            {
                _lockFrame[UdpFrameFunction.FinDeplacement] = new Semaphore(0, int.MaxValue);
            }

            Frame frame = UdpFrameFactory.Recallage(sens, this);

            _asserConnection.SendMessage(frame);

            Historique.AjouterAction(new ActionRecallage(this, sens));

            if (wait)
            {
                _lockFrame[UdpFrameFunction.FinDeplacement].WaitOne();
            }

            base.Recalibration(sens, wait, sendOffset);
        }
예제 #18
0
        static public Frame TrajectoirePolaire(SensAR sensAr, List <RealPoint> points, Robot robot)
        {
            byte[] tab = new byte[5 + points.Count * 2 * 2];
            tab[0] = (byte)robot.AsservBoard;
            tab[1] = (byte)UdpFrameFunction.TrajectoirePolaire;
            tab[2] = (byte)sensAr;
            tab[3] = (byte)ByteDivide(points.Count, true);
            tab[4] = (byte)ByteDivide(points.Count, false);
            for (int i = 0; i < points.Count; i++)
            {
                tab[5 + i * 4 + 0] = ByteDivide((int)(points[i].X * 10), true);
                tab[5 + i * 4 + 1] = ByteDivide((int)(points[i].X * 10), false);
                tab[5 + i * 4 + 2] = ByteDivide((int)(points[i].Y * 10), true);
                tab[5 + i * 4 + 3] = ByteDivide((int)(points[i].Y * 10), false);
            }

            Frame retour = new Frame(tab);

            return(retour);
        }
예제 #19
0
        public override List <int>[] DiagnosticLine(int distance, SensAR sens)
        {
            List <int>[] output = new List <int> [2];
            output[0] = new List <int>();
            output[1] = new List <int>();

            RealPoint startPos = new RealPoint(Position.Coordinates);

            MoveForward(distance, false);

            while ((Position.Coordinates.X != _destination.Coordinates.X ||
                    Position.Coordinates.Y != _destination.Coordinates.Y) && !Execution.Shutdown)
            {
                double dist = startPos.Distance(Position.Coordinates);
                output[0].Add((int)(dist * 1000));
                output[1].Add((int)(dist * 1000));
                Thread.Sleep(1);
            }

            return(output);
        }
예제 #20
0
파일: RobotReel.cs 프로젝트: Omybot/GoBot
        public override List <int>[] DiagnosticPID(int steps, SensAR sens, int pointsCount)
        {
            _lastPidTest    = new List <int> [2];
            _lastPidTest[0] = new List <int>();
            _lastPidTest[1] = new List <int>();

            Frame frame = UdpFrameFactory.EnvoiConsigneBrute(steps, sens, this);

            _asserConnection.SendMessage(frame);

            frame = UdpFrameFactory.DemandePositionsCodeurs(this);
            while (_lastPidTest[0].Count < pointsCount)
            {
                _asserConnection.SendMessage(frame);
                Thread.Sleep(30);
            }

            List <int>[] output = new List <int> [2];
            output[0] = _lastPidTest[0].GetRange(0, pointsCount);
            output[1] = _lastPidTest[1].GetRange(0, pointsCount);

            return(output);
        }
예제 #21
0
        protected void DoTurn(SensAR sensAr, SensGD sensGd)
        {
            int distance;
            int angle;

            bool ok = true;

            if (!Int32.TryParse(txtDistance.Text, out distance) || distance == 0)
            {
                txtDistance.ErrorMode = true;
                ok = false;
            }
            if (!Int32.TryParse(txtAngle.Text, out angle) || angle == 0)
            {
                txtAngle.ErrorMode = true;
                ok = false;
            }

            if (ok)
            {
                Robot.Turn(sensAr, sensGd, distance, angle, false);
            }
        }
예제 #22
0
파일: Robot.cs 프로젝트: Omybot/GoBot
 public abstract List <int>[] DiagnosticLine(int distance, SensAR sens);
예제 #23
0
파일: Robot.cs 프로젝트: Omybot/GoBot
 public abstract List <int>[] DiagnosticPID(int steps, SensAR sens, int valuesCount);
예제 #24
0
        protected void Virage_Click(SensAR sensAr, SensGD sensGd)
        {
            int distance = 0;
            int angle = 0;

            bool ok = true;
            if (!Int32.TryParse(txtDistance.Text, out distance) || distance == 0)
            {
                txtDistance.ErrorMode = true;
                ok = false;
            }
            if (!Int32.TryParse(txtAngle.Text, out angle) || angle == 0)
            {
                txtAngle.ErrorMode = true;
                ok = false;
            }

            if (ok)
                Robot.Virage(sensAr, sensGd, distance, angle, false);
        }
예제 #25
0
파일: Robot.cs 프로젝트: KiwiJaune/GoBot
 public abstract List<int>[] MesureTestPid(int consigne, SensAR sens, int nbValeurs);
예제 #26
0
 public ActionRecallage(Robot r, SensAR s)
 {
     robot = r;
     sens = s;
 }
예제 #27
0
 public static int Factor(this SensAR sens)
 {
     return(sens == SensAR.Avant ? 1 : -1);
 }
예제 #28
0
        public override void Virage(SensAR sensAr, SensGD sensGd, int rayon, int angle, bool attendre = true)
        {
            if (attendre)
                SemaphoresMove[FonctionMove.FinDeplacement] = new Semaphore(0, int.MaxValue);

            Historique.AjouterAction(new ActionVirage(this, rayon, angle, sensAr, sensGd));

            Trame trame = TrameFactory.Virage(sensAr, sensGd, rayon, angle, this);
            Connexion.SendMessage(trame);

            if (attendre)
                SemaphoresMove[FonctionMove.FinDeplacement].WaitOne();
        }
예제 #29
0
        public override void TrajectoirePolaire(SensAR sens, List<PointReel> points, bool attendre = true)
        {
            if (attendre)
                SemaphoresMove[FonctionMove.FinDeplacement] = new Semaphore(0, int.MaxValue);

            //Historique.AjouterAction(new ActionVirage(this, rayon, angle, sensAr, sensGd)); TODO

            Trame trame = TrameFactory.TrajectoirePolaire(sens, points, this);
            Connexion.SendMessage(trame);

            if (attendre)
                SemaphoresMove[FonctionMove.FinDeplacement].WaitOne();
        }
예제 #30
0
        public static Trame TrajectoirePolaire(SensAR sensAr, List<PointReel> points, Robot robot)
        {
            byte[] tab = new byte[5 + points.Count * 2 * 2];
            tab[0] = (byte)robot.Carte;
            tab[1] = (byte)FonctionMove.TrajectoirePolaire;
            tab[2] = (byte)sensAr;
            tab[3] = (byte)ByteDivide(points.Count, true);
            tab[4] = (byte)ByteDivide(points.Count, false);
            for (int i = 0; i < points.Count; i++)
            {
                tab[5 + i * 4 + 0] = ByteDivide((int)(points[i].X * 10), true);
                tab[5 + i * 4 + 1] = ByteDivide((int)(points[i].X * 10), false);
                tab[5 + i * 4 + 2] = ByteDivide((int)(points[i].Y * 10), true);
                tab[5 + i * 4 + 3] = ByteDivide((int)(points[i].Y * 10), false);
            }

            Trame retour = new Trame(tab);
            return retour;
        }
예제 #31
0
        public override List<int>[] MesureTestPid(int consigne, SensAR sens, int nbValeurs)
        {
            retourTestPid = new List<int>[2];
            retourTestPid[0] = new List<int>();
            retourTestPid[1] = new List<int>();

            Trame trame = TrameFactory.EnvoiConsigneBrute(consigne, sens, this);
            Connexion.SendMessage(trame);

            trame = TrameFactory.DemandePositionsCodeurs(this);
            while (retourTestPid[0].Count < nbValeurs)
            {
                Connexion.SendMessage(trame);
                Thread.Sleep(30);
            }

            while (retourTestPid[0].Count > nbValeurs)
                retourTestPid[0].RemoveAt(retourTestPid[0].Count - 1);

            while (retourTestPid[1].Count > nbValeurs)
                retourTestPid[1].RemoveAt(retourTestPid[1].Count - 1);

            return retourTestPid;
        }
예제 #32
0
 public override void Turn(SensAR sensAr, SensGD sensGd, int rayon, AngleDelta angle, bool wait = true)
 {
     // TODO2018
 }
예제 #33
0
파일: Robot.cs 프로젝트: KiwiJaune/GoBot
 public abstract void TrajectoirePolaire(SensAR sens, List<PointReel> points, bool attendre = true);
예제 #34
0
파일: Robot.cs 프로젝트: Omybot/GoBot
 public abstract void PolarTrajectory(SensAR sens, List <RealPoint> points, bool waitEnd = true);
예제 #35
0
 public ActionRecallage(Robot r, SensAR s)
 {
     robot = r;
     sens  = s;
 }
예제 #36
0
파일: Robot.cs 프로젝트: Omybot/GoBot
 public abstract void Turn(SensAR sensAr, SensGD sensGd, int radius, AngleDelta angle, bool waitEnd = true);
예제 #37
0
        public override List<int>[] MesureTestPid(int consigne, SensAR sens, int nbValeurs)
        {
            List<int>[] retour = new List<int>[2];
            retour[0] = new List<int>();
            retour[1] = new List<int>();

            for (double i = 0; i < nbValeurs; i++)
            {
                retour[0].Add((int)(Math.Sin((i + DateTime.Now.Millisecond) / 100.0 * Math.PI) * consigne * 10000000 / (i * i * i)));
                retour[1].Add((int)(Math.Sin((i + DateTime.Now.Millisecond) / 100.0 * Math.PI) * consigne * 10000000 / (i * i * i) + 10));
            }

            return retour;
        }
예제 #38
0
        public static Trame Virage(SensAR sensAr, SensGD sensGd, int rayon, double angle, Robot robot)
        {
            byte[] tab = new byte[8];
            tab[0] = (byte)robot.Carte;
            tab[1] = (byte)FonctionMove.Virage;
            tab[2] = (byte)sensAr;
            tab[3] = (byte)sensGd;
            tab[4] = (byte)ByteDivide(rayon, true);
            tab[5] = (byte)ByteDivide(rayon, false);
            tab[6] = (byte)ByteDivide((int)(angle * 100), true);
            tab[7] = (byte)ByteDivide((int)(angle * 100), false);

            Trame retour = new Trame(tab);
            return retour;
        }
예제 #39
0
        public override void Recallage(SensAR sens, bool attendre = true)
        {
            RecallageEnCours = true;
            Historique.AjouterAction(new ActionRecallage(this, sens));

            int accelTmp = AccelerationDebutDeplacement;
            AccelerationDebutDeplacement = 4000;

            while (Position.Coordonnees.X - Longueur / 2 > 0 &&
                Position.Coordonnees.X + Longueur / 2 < Plateau.LongueurPlateau &&
                Position.Coordonnees.Y - Longueur / 2 > 0 &&
                Position.Coordonnees.Y + Longueur / 2 < Plateau.LargeurPlateau)
            {
                if (sens == SensAR.Arriere)
                    Reculer(5);
                else
                    Avancer(5);
            }
            if (Position.Coordonnees.X < 0)
                Position.Coordonnees.X = Longueur / 2;
            if (Position.Coordonnees.X > Plateau.LongueurPlateau)
                Position.Coordonnees.X = Plateau.LongueurPlateau - Longueur / 2;
            if (Position.Coordonnees.Y < 0)
                Position.Coordonnees.Y = Longueur / 2;
            if (Position.Coordonnees.Y > Plateau.LargeurPlateau)
                Position.Coordonnees.Y = Plateau.LargeurPlateau - Longueur / 2;

            AccelerationDebutDeplacement = accelTmp;

            RecallageEnCours = false;
        }
예제 #40
0
        public static Trame EnvoiConsigneBrute(int consigne, SensAR sens, Robot robot)
        {
            byte[] tab = new byte[5];
            tab[0] = (byte)robot.Carte;
            tab[1] = (byte)FonctionMove.EnvoiConsigneBrute;
            tab[2] = (byte)sens;
            tab[3] = (byte)ByteDivide(consigne, true);
            tab[4] = (byte)ByteDivide(consigne, false);

            Trame retour = new Trame(tab);
            return retour;
        }
예제 #41
0
        public static Trame Recallage(SensAR sens, Robot robot)
        {
            byte[] tab = new byte[3];
            tab[0] = (byte)robot.Carte;
            tab[1] = (byte)FonctionMove.Recallage;
            tab[2] = (byte)sens;

            Trame retour = new Trame(tab);
            return retour;
        }
예제 #42
0
        public override void TrajectoirePolaire(SensAR sens, List<PointReel> points, bool attendre = true)
        {
            trajectoirePolaire = points;
            pointCourantTrajPolaire = 0;

            while (pointCourantTrajPolaire != -1)
                Thread.Sleep(10);
        }
예제 #43
0
        public override void Recallage(SensAR sens, bool attendre = true)
        {
            if (attendre)
                SemaphoresMove[FonctionMove.FinDeplacement] = new Semaphore(0, int.MaxValue);

            Historique.AjouterAction(new ActionRecallage(this, sens));
            Trame trame = TrameFactory.Recallage(sens, this);
            Connexion.SendMessage(trame);

            if (attendre)
                SemaphoresMove[FonctionMove.FinDeplacement].WaitOne();
        }
예제 #44
0
파일: Robot.cs 프로젝트: KiwiJaune/GoBot
 public abstract void Recallage(SensAR sens, bool attendre = true);
예제 #45
0
 public override void Virage(SensAR sensAr, SensGD sensGd, int rayon, int angle, bool attendre = true)
 {
     // TODO
 }
예제 #46
0
파일: Robot.cs 프로젝트: KiwiJaune/GoBot
 public abstract void Virage(SensAR sensAr, SensGD sensGd, int rayon, int angle, bool attendre = true);
예제 #47
0
        public static Trame Deplacer(SensAR sens, int distance, Robot robot)
        {
            byte[] tab = new byte[5];
            tab[0] = (byte)robot.Carte;
            tab[1] = (byte)FonctionMove.Deplace;
            tab[2] = (byte)sens;
            tab[3] = ByteDivide(distance, true);
            tab[4] = ByteDivide(distance, false);

            Trame retour = new Trame(tab);
            return retour;
        }