From 44becb76e676ad839452dce5a27e0d6a8d88231c Mon Sep 17 00:00:00 2001 From: Sucan126 <632190820@qq.com> Date: Tue, 23 Sep 2025 19:19:18 +0800 Subject: [PATCH] refactor(controller): Update TrajectoryFollow method signature to accept non-const reference - Modified the TrajectoryFollow method in both the header and implementation files to accept a non-const reference to a vector of unitree::robot::go2::PathPoint, allowing for in-place modifications of the path. --- include/controller.hpp | 2 +- src/controller.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/controller.hpp b/include/controller.hpp index 15b6a6c..895e7f8 100644 --- a/include/controller.hpp +++ b/include/controller.hpp @@ -61,7 +61,7 @@ public: bool ClassicWalk(bool flag); bool WalkUpright(bool flag); bool CrossStep(bool flag); - bool TrajectoryFollow(const std::vector& path); + bool TrajectoryFollow(std::vector& path); // Obstacle bool SwitchSet(bool enable); diff --git a/src/controller.cpp b/src/controller.cpp index eb0e015..dd0760e 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -339,7 +339,7 @@ bool Controller::CrossStep(bool flag) { }); } -bool Controller::TrajectoryFollow(const std::vector& path) { +bool Controller::TrajectoryFollow(std::vector& path) { return ExecuteSportCmd([&path](auto* sc) { return sc->TrajectoryFollow(path); });