Abduallah Abuhassan
Initialize Git LFS and add project files with binary tracking
b82aa95
raw
history blame contribute delete
953 Bytes
import logging
from typing import Any, Dict
from reachy_mini_conversation_app.tools.core_tools import Tool, ToolDependencies
logger = logging.getLogger(__name__)
class HeadTracking(Tool):
"""Toggle head tracking state."""
name = "head_tracking"
description = "Toggle head tracking state."
parameters_schema = {
"type": "object",
"properties": {"start": {"type": "boolean"}},
"required": ["start"],
}
async def __call__(self, deps: ToolDependencies, **kwargs: Any) -> Dict[str, Any]:
"""Enable or disable head tracking."""
enable = bool(kwargs.get("start"))
# Update camera worker head tracking state
if deps.camera_worker is not None:
deps.camera_worker.set_head_tracking_enabled(enable)
status = "started" if enable else "stopped"
logger.info("Tool call: head_tracking %s", status)
return {"status": f"head tracking {status}"}