I currently have 20 Dictionary<string, Vector3> that are storing TimeStamp Key and Vector3 Value.
E.g.
Dictionary<string, Vector3> rWrist = new Dictionary<string, Vector3>();
Dictionary<string, Vector3> rThumbProximal = new Dictionary<string, Vector3>();
Dictionary<string, Vector3> rThumbDistal = new Dictionary<string, Vector3>();
Dictionary<string, Vector3> rThumbTip = new Dictionary<string, Vector3>();
Dictionary<string, Vector3> rIndexKnuckle = new Dictionary<string, Vector3>();
On exit, I am attempting to loop through each dictionary to generate a CSV with TimeStamp and X,Y,Z coordinates.
I was successful in generating a one to two CSVs manually.
E.g.
foreach (KeyValuePair<string, Vector3> kvp in rWrist)
{
writer.WriteLine("{0},{1},{2},{3}", kvp.Key, kvp.Value.x, kvp.Value.y, kvp.Value.z);
}
But... to do this manually for all 20 dictionaries would be a pain. I am pretty lost on how I could iterate through each dictionary at once.
E.g.
for (int i = 0; i < paths.Count; i++)
{
if (!File.Exists(paths[i]))
{
File.WriteAllText(paths[i], null);
}
using (var writer = new StreamWriter(paths[i]))
{
writer.WriteLine("{0},{1},{2},{3}", "Time", "xPos", "yPos", "zPos");
foreach (KeyValuePair<string, Vector3> kvp in LOOP-THROUGH-MULTIPLE-DICTIONARIES-HERE)
{
writer.WriteLine("{0},{1},{2},{3}", kvp.Key, kvp.Value.x, kvp.Value.y, kvp.Value.z);
}
}
}
I'm not a software developer by trade so any help would be greatly appreciated!
Edit for Clarity: I am using HoloLens2 to poll positional data every tick
Using the internal clock - each tick is stored as a Key and the value is assigned the Vector3 position of that joint at that tick
Each dictionary may or may not have the same TimeStamps if HoloLens2 doesn't detect a finger pose that tick.
I need to export different .CSV for each joint for Data Analysis