update sounds ang transtions
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-06-22 17:16:36 +07:00
parent d70a4e45af
commit 523f98b74c
28 changed files with 2449 additions and 138 deletions

View File

@@ -262,6 +262,29 @@ void RobotRuntime::clearActiveMapIf(const std::string& map_id)
}
}
bool RobotRuntime::queueSoundPlay(const std::string& sound_id, int volume, std::string& err)
{
if (sound_id.empty())
{
err = "sound_id is required";
return false;
}
int vol = volume;
if (vol < 0)
vol = 0;
if (vol > 100)
vol = 100;
std::lock_guard<std::mutex> lock(mu_);
state_["sound_play"] = {{"sound_id", sound_id},
{"volume", vol},
{"requested_at", IdUtil::nowIso8601()}};
state_["message"] = "Playing sound on robot";
state_["updated_at"] = IdUtil::nowIso8601();
saveUnlocked();
return true;
}
void RobotRuntime::tick()
{
std::lock_guard<std::mutex> lock(mu_);