|
@@ -1,4 +1,6 @@
|
|
|
+using Assets.StreetLight;
|
|
|
using Assets.StreetLight.Scripts;
|
|
|
+using Newtonsoft.Json;
|
|
|
using System;
|
|
|
using System.Collections;
|
|
|
using System.Collections.Concurrent;
|
|
@@ -6,6 +8,7 @@ using System.Collections.Generic;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
+using Unity.VisualScripting;
|
|
|
using UnityEngine;
|
|
|
|
|
|
namespace Assets
|
|
@@ -14,6 +17,7 @@ namespace Assets
|
|
|
{
|
|
|
PersonManager PersonManager => personManagerLazy.Value;
|
|
|
Lazy<PersonManager> personManagerLazy;
|
|
|
+ string calibrationFileName;
|
|
|
|
|
|
private void Awake()
|
|
|
{
|
|
@@ -22,14 +26,14 @@ namespace Assets
|
|
|
|
|
|
BlockingCollection<Action> taskQueue;
|
|
|
|
|
|
- string fileName = @$"C:\Users\nick.steyer\Desktop\{DateTime.Now:yyyy-dd-M_HH-mm-ss}.csv";
|
|
|
|
|
|
void Start()
|
|
|
{
|
|
|
taskQueue = new BlockingCollection<Action>();
|
|
|
- if (!File.Exists(fileName))
|
|
|
+ calibrationFileName = Path.Combine(Configuration.Instance.CalibrationFilesDirectory, $"{DateTime.Now:yyyy-dd-M_HH-mm-ss}.csv");
|
|
|
+ if (!File.Exists(calibrationFileName))
|
|
|
{
|
|
|
- File.WriteAllLines(fileName, new string[] { "Time,WorldX,WorldY,WorldZ,UnityX,UnityY,UnityZ" });
|
|
|
+ File.WriteAllLines(calibrationFileName, new string[] { "Time,WorldX,WorldY,WorldZ,UnityX,UnityY,UnityZ" });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -46,7 +50,7 @@ namespace Assets
|
|
|
var personPosition = person.WorldPosition;
|
|
|
var markerPosition = marker.transform.position;
|
|
|
|
|
|
- taskQueue.Add(() => File.AppendAllLines(fileName, new string[] { FormattableString.Invariant($"{DateTime.Now:yyyy-MM-dd-HH-mm-ss-ff},{personPosition.x},{personPosition.y},{personPosition.z},{markerPosition.x},{markerPosition.y},{markerPosition.z}") }));
|
|
|
+ taskQueue.Add(() => File.AppendAllLines(calibrationFileName, new string[] { FormattableString.Invariant($"{DateTime.Now:yyyy-MM-dd-HH-mm-ss-ff},{personPosition.x},{personPosition.y},{personPosition.z},{markerPosition.x},{markerPosition.y},{markerPosition.z}") }));
|
|
|
Task.Run(() => taskQueue.Take().Invoke());
|
|
|
}
|
|
|
}
|