openxc / openxc-vehicle-simulator

BSD 3-Clause "New" or "Revised" License
63 stars 44 forks source link

State Manager data sending routine needs to be simplified. #16

Closed DaveMelcher closed 10 years ago

DaveMelcher commented 11 years ago

It's currently something of a mess. Currently it creates loops for each of the update speeds.

A potentially simpler way is to have a single loop that iterates through all the data points, checking each for a due update: For each repeating data point: if deadline is passed: new deadline = old deadline + period send data to Enabler

In the same way, we can handle data that is only updated after a change here. Get latest data For each data point only updated after a change: if current data != last data sent: send data to Enabler

That will simplify the dynamics model and state manager, which are currently monitoring those data points for change.