From 6e669bb02775aada7fcec0fcba2dde1886be040b Mon Sep 17 00:00:00 2001 From: Sucan126 <632190820@qq.com> Date: Thu, 9 Oct 2025 19:48:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E5=AE=A2=E6=88=B7=E7=AB=AFID=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/custom_robot.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/custom_robot.cpp b/src/custom_robot.cpp index 7f28608..d2c8166 100644 --- a/src/custom_robot.cpp +++ b/src/custom_robot.cpp @@ -775,4 +775,20 @@ void CustomRobot::continuousMoveLoop() { controller_->Move(vx, vy, vyaw); } +std::string CustomRobot::generateRandomClientId() const { + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(0, 15); + + std::stringstream ss; + ss << "go2_client_"; + + // 生成8位随机十六进制字符 + for (int i = 0; i < 8; ++i) { + ss << std::hex << dis(gen); + } + + return ss.str(); +} + } // namespace custom