Ejemplo n.º 1
0
    private void PublishFrame(object sender, HololensRobotController.WindowsSensors.FrameEventArgs e)
    {
        int[] structuredTime = HololensRobotController.Utilities.Timer.GetSecondsNanosecondsStructure(e.TimeSpan);
        RosSharp.RosBridgeClient.Messages.Sensor.Image image = new RosSharp.RosBridgeClient.Messages.Sensor.Image();
        image.header.frame_id    = Config.Mono;
        image.header.stamp.secs  = structuredTime[0];
        image.header.stamp.nsecs = structuredTime[1];
        image.header.seq         = frameNo++;
        image.data         = e.Buffer;
        image.encoding     = e.Encoding;
        image.is_bigendian = 0;
        image.height       = (int)e.Height;
        image.width        = (int)e.Width;
        image.step         = (int)e.Step;

        publisher.Publish(image);
        System.Diagnostics.Debug.WriteLine("Mono camera sent frame-" + image.header.seq + " at time " + ((double)structuredTime[0] + ((double)structuredTime[1]) / 1e9).ToString());
    }
Ejemplo n.º 2
0
 public virtual void OnFrameReadyToPublish(HololensRobotController.WindowsSensors.FrameEventArgs e)
 {
     FrameReadyToPublish?.Invoke(this, e);
 }