hatfield-c / avl

Repository for the [AVL] Autonomous Vehicle Lab project at UT Dallas
2 stars 7 forks source link

[AVL-33] RTOS will delay task execution to match real world time #33

Open hatfield-c opened 2 years ago

hatfield-c commented 2 years ago

For the RTOS to be accurate in the Unity environment, tasks will need to take an appropriate amount of Unity frames to mimic the real world. Unfortunately this would require a complex parallel processing system for it to be completely realistic.

A workaround is thus:

In order to avoid giving an unfair advantage to students with fast computers, a scaling factor will be applied to the time as such:

Thus, if a typical computer executes the benchmark in 10 ns, and a slow computer takes 20 ns, then all RTOS task times will be cut in half. Likewise, if the benchmark is 10 ns and a fast computer takes 5 ns, then all RTOS task times will be made twice as long.

hatfield-c commented 2 years ago

An assumption that all tasks just take 1 frame might be a prudent simplification for this project.