Exemplo n.º 1
0
 public static void Update(this MessageTypes.Std.Header header)
 {
     if (timer == null)
     {
         GameObject obj = new GameObject("DefaultTimer(UnityEpoch)");
         timer = defaultTimer = obj.AddComponent <Timer>();
     }
     header.seq++;
     header.stamp = timer.Now();
 }
Exemplo n.º 2
0
        public static void Update(this MessageTypes.Std.Header header)
        {
            //TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1);
            //uint result = (uint)t.TotalMilliseconds;

            header.seq++;

            //header.stamp.secs = 5;
            //header.stamp.nsecs = 0;
            timer.Now(header.stamp);
        }
Exemplo n.º 3
0
        public void UpdateClock()
        {
            // Use Standard Header Extension as source of truth for time
            MessageTypes.Std.Header header = new MessageTypes.Std.Header();
            header.Update();
            clock.clock = header.stamp;

            nseconds      = (double)header.stamp.nsecs / 1.0e9;
            publishedTime = header.stamp.secs.ToString("F0") + nseconds.ToString("F9").Substring(1);

            if (publishClock)
            {
                Publish(clock);
            }
        }
 private void InitializeMessage()
 {
     header  = new MessageTypes.Std.Header(0, new MessageTypes.Std.Time(), "map");
     pose    = new MessageTypes.Geometry.Pose();
     message = new MessageTypes.Geometry.PoseStamped(header, pose);
 }