sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
core._core.Clock Class Reference

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)

Detailed Description

Timing utilities for control loops and statistics collection.

Member Function Documentation

◆ blocking_sleep_seconds()

None core._core.Clock.blocking_sleep_seconds ( self,
float seconds )
Block the calling thread for the specified duration (no early exit).

◆ get_desired_thread_sampling_time_sec()

float core._core.Clock.get_desired_thread_sampling_time_sec ( self)
Get the configured sampling interval in seconds.

◆ get_elapsed_time_sec()

float core._core.Clock.get_elapsed_time_sec ( self)
Get elapsed time since initialization in seconds.

◆ get_overrun_count()

int core._core.Clock.get_overrun_count ( self)
Return the number of times the sampling period has been missed (overrun).

◆ get_statistics()

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.

◆ get_time()

float core._core.Clock.get_time ( self,
Clock.TimeType time_type )
Get a time measurement for a given TimeType, in seconds.

◆ init()

None core._core.Clock.init ( self)
Initialize the clock internal state and timers.

◆ safe_sleep_seconds()

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.

◆ update_and_sleep()

None core._core.Clock.update_and_sleep ( self)
Update internal timing measurements and sleep to respect the target sampling time.

The documentation for this class was generated from the following file:
  • sas_py/marinholab/sas/core/_core.pyi