Exemplo n.º 1
0
        public SumoSender(string host, int port)
        {
            this.Host    = host;
            this.Port    = port;
            this.seq_ids = new DefaultDict <int, int>();
            SumoRemote   = new IPEndPoint(IPAddress.Parse(host), port);
            sumoSocket   = new UdpClient();

            // Initial command (no motion)
            this.cmd = SumoCommandsCustom._pack_frame(SumoCommandsCustom.Move_cmd(0, 0));
        }
Exemplo n.º 2
0
 private void SumoSend()
 {
     try
     {
         LOGGER.GetInstance.Info("[SumoSender] Thread Started");
         while (isConnected)
         {
             sumoSocket.Send(this.cmd, this.cmd.Length, SumoRemote);
             this.cmd = SumoCommandsCustom._pack_frame(SumoCommandsCustom.Move_cmd(0, 0));
             Thread.Sleep(40);
         }
     }
     catch (Exception e)
     {
         LOGGER.GetInstance.Error(e.Message);
     }
     LOGGER.GetInstance.Info("[SumoSender] Thread Stopped");
 }
Exemplo n.º 3
0
 /// <summary>
 ///  Apply the given speed and turn to the Jumping Sumo
 ///         :param speed: [-100, 100]
 ///         :param turn:  [-100, 100]
 ///         :return:
 /// </summary>
 /// <param name="speed"></param>
 /// <param name="turn"></param>
 public void SendMove(sbyte speed, sbyte turn)
 {
     this.sender.Send(SumoCommandsCustom.Move_cmd(speed, turn));
 }