Fixes use of simulation time for computing actuator behavior durations, which were still using the jsd_time_get_time_sec and jsd_get_mono_time_sec internally.
Adds new DeviceState field monotonic_time. If simulation mode is used, time and monotonic_time are both set to the provided simulation time. If not in a simulation, time uses Linux time (seconds since the epoch), and monotonic_time uses monotonic clock, (seconds since computer was switched on). Monotonic time is guaranteed to be monotonically increasing and therefore may be more reliable for computing durations, especially when computing short durations.
Allow optionally passing in simulation time to device's ConfigFromYAML method to allow optionally passing in a startup time to a device.
Update logic to test for simulation time to:
if(external_time < 0) {
// we are in online mode
} else {
// we are in simulation
}
which allows passing in a zero value for initial start up time in simulation mode.
Follow-on to https://github.com/nasa-jpl/fastcat/pull/89
Fixes use of simulation time for computing actuator behavior durations, which were still using the
jsd_time_get_time_sec
andjsd_get_mono_time_sec
internally.Adds new DeviceState field
monotonic_time
. If simulation mode is used,time
andmonotonic_time
are both set to the provided simulation time. If not in a simulation,time
uses Linux time (seconds since the epoch), andmonotonic_time
uses monotonic clock, (seconds since computer was switched on). Monotonic time is guaranteed to be monotonically increasing and therefore may be more reliable for computing durations, especially when computing short durations.Allow optionally passing in simulation time to device's
ConfigFromYAML
method to allow optionally passing in a startup time to a device.Update logic to test for simulation time to:
which allows passing in a zero value for initial start up time in simulation mode.