private void StartRealsensePipeline() { string s = ""; if (!IsRealsenseOn) { RealsenseState = "Please Initiate Realsense."; return; } IsRealsensePipelineOn = RealsenseControl.StartRealsensePipeline(ref s); if (IsRealsensePipelineOn) { UpdateRGBPoseTask = Task.Run(() => UpdateRGBPose()); UpdateRealTimePointCloudTask = Task.Run(() => UpdateRealTimePointCloud()); //UpdateRGBImageTask.Start(); } RealsenseState = s; }
private async Task StartRealsensePipeline() { await Task.Run(() => { string s = ""; if (!IsRealsenseOn) { RealsenseState = "Please Initiate Realsense."; return; } IsRealsensePipelineOn = RealsenseControl.StartRealsensePipeline(ref s); if (IsRealsensePipelineOn) { UpdateRGBPoseTask = Task.Run(() => UpdateRGBPose()); UpdateRealTimePointCloudTask = Task.Run(() => UpdateRealTimePointCloud()); //UpdateRGBImageTask.Start(); } RealsenseState = s; }).ConfigureAwait(false); RealsenseState = "Pipeline has started"; }