예제 #1
0
        public void callbackVoltMonitor( m.Float32 msg)
        {
            Dispatcher.BeginInvoke(new Action(() =>
            {
                if (abraCadabra.Visibility != Visibility.Visible)
                    abraCadabra.Visibility = Visibility.Visible;
                textBlock1.Text = msg.data + "v";
            }));

        }
예제 #2
0
 private void cb(int i, m.String msg)
 {
     Dispatcher.BeginInvoke(new Action(() => { if (abraCadabra.Visibility == System.Windows.Visibility.Hidden) abraCadabra.Visibility = Visibility.Visible; }));
     string[] split = msg.data.Split('=');
     if (split.Length != 2)
     {
         Console.WriteLine("CRAP");
         return;
     }
     if (split[0].Equals("BA"))
     {
         string[] perside = split[1].Split(':');
         float[] vals = new[] { 0f, 0f };
         for (int j = 0; j < perside.Length; j++)
         {
             float.TryParse(perside[j], out vals[j]);
             vals[j] /= 10.0f;
         }                
         setSingle(i*2, vals[i]);
         setSingle(i*2+1, vals[1-i]);
     }
     /*StringBuilder sb = new StringBuilder("mc[" + i + "] = \n");
     lock(telem[i])
     {
         if (!telem[i].ContainsKey(split[0][0]))
             telem[i].Add(split[0][0], split[1]);
         else
             telem[i][split[0][0]] = split[1];
         List<KeyValuePair<char, string>> sorted = telem[i].ToList();
         sorted.Sort((x,y)=>x.Key.CompareTo(y.Key));
         foreach (KeyValuePair<char, string> kvp in sorted)
         {
             sb.AppendLine("" + kvp.Key + " = " + kvp.Value);
         }
     }
     Console.WriteLine(sb);*/
 }
예제 #3
0
 private void callbackEStop(m.Bool msg)
 {
     Dispatcher.Invoke(new Action(()=>setMode(msg.data)));
 }
예제 #4
0
 private void cb1(m.String msg)
 {
     cb(1, msg);
 }
예제 #5
0
 private void cb0(m.String msg)
 {
     cb(0, msg);
 }
예제 #6
0
        private void callback(m.Int32 msg)
        {

            Console.WriteLine("Tilt: " + msg.data.ToString());
        }
예제 #7
0
 private static void chatterCallback(m.String s)
 {
     ROS.Info("RECEIVED: " + s.data);
 }
예제 #8
0
 private static void chatterCallback(m.String s)
 {
     Console.WriteLine("RECEIVED: " + s.data);
 }