|
sas
Modularised monitoring, logging, and control of robots.
|
Classes | |
| class | TimeType |
Public Member Functions | |
| None | __init__ (self, float sampling_time_in_seconds, bool enable_statistics=True) |
| None | init (self) |
| None | update_and_sleep (self) |
| float | get_elapsed_time_sec (self) |
| float | get_desired_thread_sampling_time_sec (self) |
| None | safe_sleep_seconds (self, float seconds, ShutdownSignaler shutdown_signaler) |
| None | blocking_sleep_seconds (self, float seconds) |
| int | get_overrun_count (self) |
| float | get_time (self, Clock.TimeType time_type) |
| float | get_statistics (self, Statistics statistics, Clock.TimeType time_type) |
Timing utilities for control loops and statistics collection.
| None core._core.Clock.blocking_sleep_seconds | ( | self, | |
| float | seconds ) |
Block the calling thread for the specified duration (no early exit).
| float core._core.Clock.get_desired_thread_sampling_time_sec | ( | self | ) |
Get the configured sampling interval in seconds.
| float core._core.Clock.get_elapsed_time_sec | ( | self | ) |
Get elapsed time since initialization in seconds.
| int core._core.Clock.get_overrun_count | ( | self | ) |
Return the number of times the sampling period has been missed (overrun).
| float core._core.Clock.get_statistics | ( | self, | |
| Statistics | statistics, | ||
| Clock.TimeType | time_type ) |
Get a collected statistic value.
Raises:
RuntimeError: If statistics collection was not enabled at
construction or the requested statistic is not available.
| float core._core.Clock.get_time | ( | self, | |
| Clock.TimeType | time_type ) |
Get a time measurement for a given TimeType, in seconds.
| None core._core.Clock.init | ( | self | ) |
Initialize the clock internal state and timers.
| None core._core.Clock.safe_sleep_seconds | ( | self, | |
| float | seconds, | ||
| ShutdownSignaler | shutdown_signaler ) |
Sleep for approximately the given duration while allowing early exit.
:param seconds: Duration in seconds to sleep.
:param shutdown_signaler: Sleep ends early once its
``should_shutdown()`` is True.
| None core._core.Clock.update_and_sleep | ( | self | ) |
Update internal timing measurements and sleep to respect the target sampling time.