refactor(custom_robot): Reorganize trajectory control and remove example trajectory generation

- Moved the trajControl method to the private section of the CustomRobot class for better encapsulation.
- Introduced traj_dt_ and traj_count_ member variables to manage trajectory timing and state.
- Removed the createExampleTrajectory function to streamline the code and eliminate unused functionality in trajectory handling.
This commit is contained in:
2025-09-27 16:29:41 +08:00
parent f430360516
commit 789e85c5a2
2 changed files with 17 additions and 111 deletions

View File

@@ -47,11 +47,11 @@ public:
bool processRechargeCmd(const std::string& cmd, const nlohmann::json& message);
void printServiceList(const std::vector<unitree::robot::go2::ServiceState>& serviceList, int filterStatus = -1);
void trajControl();
bool startTraj();
void stopTraj();
private:
void trajControl();
std::string generateRandomClientId() const;
std::unique_ptr<Controller> controller_;
// std::unique_ptr<LowController> low_controller_;
@@ -65,6 +65,8 @@ private:
std::atomic<bool> initialized_;
unitree::common::ThreadPtr traj_th_;
std::atomic<bool> traj_running_;
float traj_dt_;
float traj_count_;
};
} // namespace custom