feat: capture head and waist RGB-D data
This commit is contained in:
@@ -89,6 +89,19 @@ def _topic_list(value: Any, name: str, *, allow_empty: bool) -> tuple[str, ...]:
|
||||
return result
|
||||
|
||||
|
||||
def _minimum_topic_rates(value: Any) -> dict[str, float]:
|
||||
name = "minimum_topic_rates_hz"
|
||||
if not isinstance(value, dict):
|
||||
raise ValueError(f"data_collection.{name} must be a TOML table")
|
||||
result: dict[str, float] = {}
|
||||
for topic, rate in value.items():
|
||||
normalized_topic = _topic(topic, f"{name} key")
|
||||
result[normalized_topic] = _positive_number(
|
||||
rate, f"{name}.{normalized_topic}"
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SupervisorSettings:
|
||||
enabled: bool
|
||||
@@ -134,6 +147,17 @@ def load_settings(path: Path | str) -> SupervisorSettings:
|
||||
"data_collection.required_topics must also appear in topics: "
|
||||
+ ", ".join(unknown_required)
|
||||
)
|
||||
minimum_topic_rates = _minimum_topic_rates(
|
||||
section.get("minimum_topic_rates_hz", {})
|
||||
)
|
||||
unknown_rate_topics = sorted(
|
||||
set(minimum_topic_rates) - set(required_topics)
|
||||
)
|
||||
if unknown_rate_topics:
|
||||
raise ValueError(
|
||||
"data_collection.minimum_topic_rates_hz keys must also appear in "
|
||||
"required_topics: " + ", ".join(unknown_rate_topics)
|
||||
)
|
||||
|
||||
heartbeat_timeout = _positive_number(
|
||||
section.get("heartbeat_timeout_seconds", 3.0),
|
||||
@@ -162,6 +186,7 @@ def load_settings(path: Path | str) -> SupervisorSettings:
|
||||
base_directory=Path(base_directory).expanduser(),
|
||||
topics=topics,
|
||||
required_topics=required_topics,
|
||||
minimum_topic_rates_hz=minimum_topic_rates,
|
||||
minimum_free_bytes=int(minimum_free_gib * 1024**3),
|
||||
max_duration_seconds=max_duration,
|
||||
poll_interval_seconds=0.1,
|
||||
|
||||
Reference in New Issue
Block a user