Commit Graph

92 Commits

Author SHA1 Message Date
7101cbffa2 refactor(controller): 移除未使用的运动控制接口
清理控制器头文件中不再使用的运动控制方法,包括BodyHeight、SwitchGait、ContinuousGait、MoveToPos和FastWalk,以简化接口并提高代码可维护性
2025-09-21 15:19:23 +08:00
1a9fc5f7e1 refactor(navigation): 重构Navigation类继承unitree::robot::Client
移除不必要的client_成员变量,直接继承unitree::robot::Client类
简化初始化逻辑,更新相关文档说明
2025-09-21 15:15:09 +08:00
61d206e948 refactor(navigation): 移除冗余的json值类型转换
简化日志输出中对json值的处理,直接使用value方法获取值而不再显式调用get方法
2025-09-21 15:01:32 +08:00
ff895ff2ed refactor(navigation): 将日志输出从格式化字符串改为字符串拼接
修改日志输出方式,使用字符串拼接替代格式化字符串,提高代码一致性并减少潜在的类型安全问题
2025-09-21 14:55:05 +08:00
093bdf18b4 refactor(config): 移除未使用的配置参数
移除topic_state和control_frequency配置项,简化默认配置加载逻辑
2025-09-21 14:51:44 +08:00
9585ae3df6 refactor(config): 移除未使用的MQTT主题和安全设置
清理不再使用的MQTT主题配置(心跳、响应、错误)和命令超时设置,简化配置结构
2025-09-21 14:50:13 +08:00
2392264713 refactor(controller): 移除未使用的MoveToPos和FastWalk方法
这些方法未被代码库其他部分调用,移除以减少维护负担
2025-09-21 14:47:36 +08:00
97d048339b refactor(controller): 移除未使用的运动控制方法
清理Controller类中不再使用的BodyHeight、SwitchGait、ContinuousGait和Dance2方法,以简化代码结构
2025-09-21 14:45:30 +08:00
dbbe63c7b1 feat(controller): 添加运动切换命令处理和多种运动控制功能
添加对运动切换命令(CheckMode/SelectMode/ReleaseMode)的处理支持
在Controller类中新增多种运动控制功能接口
更新README文档以包含新增的运动切换命令和功能说明
2025-09-21 14:40:11 +08:00
02908202f5 fix: 将MotionSwitcherClient从go2更新为b2版本 2025-09-21 14:03:04 +08:00
b05086d03d fix: 将MotionSwitcherClient从go2命名空间更正为b2命名空间 2025-09-21 12:41:09 +08:00
fda1dd8204 refactor: 更新 motion_switcher_client 的引用路径
将 motion_switcher_client 的引用从 go2 路径更新为 b2 路径,以匹配最新的库结构
2025-09-21 12:35:11 +08:00
f30590033b refactor(config): 重构配置系统和MQTT相关功能
移除状态发布功能,简化配置系统
更新MQTT配置和主题设置
调整README文档以反映最新变更
2025-09-20 19:54:04 +08:00
f7acf6ff51 docs: 更新README文档以反映最新功能变更
- 添加导航和SLAM功能说明
- 更新MQTT配置和命令结构
- 修改编译时配置说明
- 调整项目结构描述
2025-09-20 19:37:00 +08:00
ae8b01cf24 Remove Windows MQTT setup guide and update Navigation class to include custom namespace. Increment version in main application log message to v0.0.2. 2025-09-20 19:11:31 +08:00
38db96e433 Add navigation functionality to CustomRobot and Controller classes. Introduced Navigation class for handling mapping and pose navigation commands. Updated CustomRobot to process navigation commands and manage Navigation instance. Enhanced Controller with motion switching capabilities, improving overall robot control and navigation features. 2025-09-20 16:05:10 +08:00
2de8f53ae2 Refactor switch state handling in CustomRobot::processOacCmd method. Updated logic to store the toggled state in a variable before passing it to SwitchSet, improving code clarity and maintainability. 2025-09-09 14:33:33 +08:00
67b1a7fe80 Add RSC command processing to CustomRobot class. Introduced processRscCmd method for handling service list queries and service switching commands, enhancing functionality. Added printServiceList method for improved service status reporting. Removed unused publishCmdResponse method to streamline code. 2025-09-09 14:25:32 +08:00
54a9f9b544 Enhance logging and error handling in Controller class methods. Added checks for uninitialized SportClient and included informational logs for API responses, improving visibility into method execution and error management. 2025-09-09 11:53:30 +08:00
21c5bc2573 Enhance logging in Controller class methods. Added checks for uninitialized ObstaclesAvoidClient and included informational logs for SwitchSet and SwitchGet API responses, improving error handling and visibility into state changes. 2025-09-09 11:46:27 +08:00
55f4358401 Enhance logging in CustomRobot::processCmd method. Added an informational log statement to indicate the success of command processing, improving visibility into command execution outcomes. 2025-09-09 11:42:36 +08:00
fb4ea73ec0 Enhance logging in CustomRobot::processOacCmd method. Added informational log statement to display the current switch state before toggling, improving visibility into command processing. 2025-09-09 11:39:34 +08:00
b35395e543 Refactor command processing in CustomRobot class. Changed method name from processCommand to processCmd for improved consistency and clarity in MQTT message handling. 2025-09-09 11:34:35 +08:00
347240026c Refactor SwitchSet command handling in CustomRobot class. Updated logic to retrieve the current switch state before toggling, improving error handling and ensuring correct state management. 2025-09-09 11:20:10 +08:00
f46bb3b7c9 Add command processing functionality to CustomRobot class. Introduced methods for handling OAC and Sport commands via MQTT messages, including validation and response publishing. Removed unnecessary logging statements for cleaner output. 2025-09-09 11:15:03 +08:00
cf58ad202a Refactor MQTT callback function names for consistency. Changed MessageCallback and ConnectionCallback to MessageCb and ConnectionCb in mqtt.hpp, mqtt.cpp, and custom_robot.cpp to improve code clarity and maintainability. 2025-09-09 09:56:13 +08:00
e7bfce9dcb Refactor logging in CustomRobot and main event loop implementation. Removed service logging from CustomRobot::start for cleaner output. Added a continuous event loop in main to keep the program running and allow for future periodic tasks. 2025-09-08 20:11:08 +08:00
99ca9456c0 Enhance MQTT connection handling and client ID generation. Updated the MQTT client connection method to accept username and password parameters, added validation for ASCII characters in username and password, and improved error logging for connection failures. Modified client ID generation to ensure it only contains valid ASCII characters, defaulting to a safe value if necessary. 2025-09-08 20:02:14 +08:00
dec8b29c3c Update RobotStateClient timeout to use float literal for consistency. This change ensures type correctness in the timeout setting within the CustomRobot initialization process. 2025-09-08 19:58:26 +08:00
20dabdddee Remove controller connection status from CustomRobot status publication. This change simplifies the status message by eliminating the check for controller connectivity, streamlining the published data. 2025-09-08 19:56:52 +08:00
e3c214ee1c Refactor MQTT configuration access in CustomRobot class. Updated member variable access from pointer dereferencing to direct access for improved clarity and consistency in the codebase. 2025-09-08 19:55:56 +08:00
7a9a31afd4 Integrate Paho MQTT C library into project. Updated CMakeLists.txt to find PahoMqttC package and added fallback for manual linking. Refactored mqtt.hpp and mqtt.cpp to utilize Paho MQTT C API, replacing previous async client implementation. Added Windows setup guide for MQTT library installation. 2025-09-08 19:53:39 +08:00
c655cd8c91 Remove MQTT library requirement from CMakeLists.txt. This update simplifies the build configuration by eliminating unnecessary dependencies, streamlining the project setup. 2025-09-08 18:52:28 +08:00
6a85d43c67 Remove nlohmann_json library from CMakeLists.txt. This change simplifies the linking process by eliminating the dependency on the nlohmann JSON library, which is no longer required for the project. 2025-09-08 18:51:58 +08:00
7f43d729a2 Enhance CMake configuration and add nlohmann/json library files. Updated CMakeLists.txt to include the nlohmann JSON library directory. Added multiple header files for JSON serialization, deserialization, and utility functions, ensuring compatibility with the latest version 3.11.2. This update improves JSON handling capabilities in the project. 2025-09-08 18:50:46 +08:00
60a5490ec8 Update MQTT configuration in config.hpp. Changed broker address to a specific IP and added username and password for authentication. Removed commented-out sections for clarity. 2025-09-08 18:38:37 +08:00
90228e4ab9 Implement MQTT functionality in CustomRobot class. Added methods for MQTT initialization, message handling, and connection management. Updated configuration to remove multimedia settings and streamline MQTT-related parameters. Enhanced logging for MQTT operations and ensured proper cleanup during shutdown. 2025-09-08 18:35:02 +08:00
926d88972d Refactor configuration management by introducing CustomConfig class. Updated config.hpp to streamline settings and removed legacy configuration presets. Adjusted controller and custom_robot classes to utilize the new configuration structure. Enhanced error handling and logging during initialization processes. 2025-09-08 18:16:50 +08:00
f72ce9ce58 Remove MQTT dependency and refactor configuration structure. Updated CMakeLists.txt to eliminate MQTT library checks and adjusted config.hpp to use string_view for configuration parameters. Simplified controller and custom_robot classes by removing MQTT-related code and enhancing robot state management. Introduced service management methods in CustomRobot for better state handling. 2025-09-07 20:20:34 +08:00
ecb4c602a1 Refactor CMake configuration to find installed unitree_sdk2 package instead of using a local path. Removed obsolete subdirectory addition and include paths. Cleaned up unnecessary install commands for config files. 2025-09-07 17:11:20 +08:00
6acff483dd Add initial project structure with CMake configuration, source files, and README documentation for Unitree GO2 Custom Controller 2025-09-07 16:43:22 +08:00
b2b6ddf245 Initial commit 2025-09-07 07:28:24 +00:00