Commit Graph

44 Commits

Author SHA1 Message Date
2e60da5b5b refactor(robot_control): 移除轨迹模式功能并添加连续移动控制
移除原有的复杂轨迹模式实现(包括正弦波、圆形、正方形等路径生成),
替换为更简单的连续移动控制接口,支持直接设置速度参数(vx,vy,vyaw)。
修改了相关线程控制和运动命令处理逻辑,简化了代码结构。
2025-10-09 19:17:26 +08:00
06bf2fa208 feat(轨迹控制): 为start_traj命令添加参数解析功能
扩展start_traj命令以支持从消息中解析轨迹参数,包括模式、比例、速度等配置项。这使得轨迹控制更加灵活可配置。
2025-10-09 18:26:07 +08:00
993ed111a6 feat(轨迹控制): 添加多种轨迹模式支持并重构轨迹生成逻辑
新增轨迹模式枚举和参数结构体,支持正弦波、圆形、正方形、菱形和8字形五种轨迹模式
重构轨迹生成逻辑为独立的生成函数,增加参数验证和配置灵活性
2025-10-09 17:49:08 +08:00
3a209734de feat(robot): 添加监控模块到自定义机器人
在自定义机器人中添加Monitor模块,用于监控机器人状态。包括在头文件中添加Monitor成员变量声明,在实现文件中添加初始化和资源释放逻辑。
2025-09-30 16:38:00 +08:00
d3487a2613 feat(monitor): 添加监控模块用于订阅和打印运动状态和里程计数据
添加新的Monitor类,用于订阅并打印SportModeState和Odometry消息数据
移除custom_robot.cpp中冗余的日志信息
更新CMakeLists.txt以包含新的监控模块
2025-09-30 15:53:12 +08:00
99b5b17421 refactor(custom_robot): Add logging for dynamic trajectory control start
- Introduced a log message to indicate the start of dynamic trajectory control in the trajControl method, enhancing traceability during execution.
2025-09-27 16:46:53 +08:00
789e85c5a2 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.
2025-09-27 16:29:41 +08:00
f0e516a1a3 refactor(custom_robot): Remove unused method calls in destructor and stopTraj
- Deleted the Close method call for the recharge object in the CustomRobot destructor to simplify resource management.
- Removed the Stop method call for the traj_th_ thread in stopTraj, streamlining the stopping process of trajectory control.
2025-09-23 19:25:39 +08:00
9ac38382a3 refactor(custom_robot): Remove FootRaiseHeight command processing
- Deleted the FootRaiseHeight command processing from the CustomRobot class to streamline command handling and eliminate unused functionality.
2025-09-23 19:24:47 +08:00
e3ba6f7225 refactor(custom_robot): Simplify SwitchSet command processing
- Removed redundant state retrieval for the SwitchSet command.
- Added error handling for missing 'enable' parameter in the command message.
- Streamlined the logic for setting the switch state based on the provided parameter.
2025-09-23 19:09:13 +08:00
4a06204645 feat(trajectory): Implement dynamic trajectory control in CustomRobot
- Added methods for trajectory control: trajControl, startTraj, and stopTraj.
- Integrated trajectory control into command processing for starting and stopping dynamic trajectories.
- Introduced a recurrent thread for continuous trajectory updates at a frequency of 50Hz.
- Initialized trajectory control state management with atomic flags.
2025-09-23 18:55:31 +08:00
6c8a4a3b38 refactor(controller): Update TrajectoryFollow method signature and improve path handling
- Changed the signature of TrajectoryFollow to accept a vector of unitree::robot::go2::PathPoint instead of std::array<float, 6>.
- Updated the implementation of TrajectoryFollow in controller.cpp to utilize the new path type.
- Removed unnecessary status message in CMakeLists.txt related to unitree_sdk2 detection.
- Added a new function in custom_robot.cpp to create example trajectories for different path types (line, square, circle) and integrated it into the command processing for TrajectoryFollow.
2025-09-23 18:40:42 +08:00
e0e1b5f642 feat(recharge): Implement automatic recharge functionality
- Added Recharge class for managing automatic recharge capabilities using ArUco markers.
- Integrated recharge functionality into CustomRobot, including command processing for starting and stopping recharge.
- Updated CMakeLists.txt to include the new recharge.cpp source file.
- Enhanced README.md to document the new auto recharge support feature.
2025-09-23 18:27:30 +08:00
6fe07ac73c refactor(custom_robot): 移除与low_controller相关的注释代码
清理不再使用的low_controller相关代码注释,保持代码整洁
2025-09-23 10:36:02 +08:00
4cce0b69c8 refactor(custom_robot): Disable LowController functionality temporarily
- Commented out all references to LowController in custom_robot.hpp and custom_robot.cpp to disable its functionality.
- Added warning log in processLowCmd to indicate that LowController functionality is currently disabled until re-implementation.
2025-09-22 19:50:39 +08:00
20d75ca377 feat(logger): Enhance logging functionality with variadic templates for formatted messages
- Added variadic template methods to the Logger class for formatted logging at different log levels (debug, info, warn, error).
- Updated existing logging calls in CustomRobot to utilize the new formatted logging methods for improved readability and consistency.
- Removed the old log method implementation from logger.cpp to streamline the codebase.
2025-09-22 19:35:03 +08:00
a2a3040967 refactor(custom_robot): 移除服务列表的详细日志输出
移除GetServiceList方法中对每个服务状态的详细日志输出,保留获取服务列表成功的基本日志
2025-09-22 19:21:55 +08:00
c5cff9fbdb feat(low_controller): Integrate LowController for low-level command handling
- Added LowController class to manage low-level commands and communication.
- Updated CustomRobot to initialize and manage LowController, including methods for processing low-level commands.
- Enhanced logger functionality with variadic template methods for formatted logging.
- Updated CMakeLists.txt to include the new low_controller.cpp source file and low_controller.hpp header.
2025-09-22 19:11:20 +08:00
1a0618f50f refactor(controller): Remove unused motion control methods and update CMake configuration
- Removed several unused methods from the Controller class, including HandStand, ClassicWalk, AutoRecoverSet, StaticWalk, TrotRun, EconomicGait, and SwitchAvoidMode.
- Updated CMakeLists.txt to remove the hardcoded include path for unitree SDK, streamlining the include directories for the main target.
2025-09-22 16:03:43 +08:00
26b9c11a25 Revert "fix(custom_robot): Remove unused status variable in ServiceSwitch method"
This reverts commit 7afb7e2b77.
2025-09-22 15:26:00 +08:00
7afb7e2b77 fix(custom_robot): Remove unused status variable in ServiceSwitch method
- Eliminated the unused 'status' variable from the ServiceSwitch method to streamline the code and improve clarity.
2025-09-22 15:08:33 +08:00
1e4e5c3943 feat(服务监控): 添加服务状态自动打印功能
当获取服务列表时,系统现在会自动打印每个服务的状态信息到日志中,包括服务名称、当前状态(ACTIVE/INACTIVE)和保护状态(YES/NO)
2025-09-22 14:30:59 +08:00
b6b1dc410b refactor(custom_robot): 移除未使用的运动控制命令
移除BodyHeight、SwitchGait、ContinuousGait、MoveToPos和FastWalk等不再使用的运动控制命令处理逻辑,简化代码结构
2025-09-21 15:21:00 +08:00
dbbe63c7b1 feat(controller): 添加运动切换命令处理和多种运动控制功能
添加对运动切换命令(CheckMode/SelectMode/ReleaseMode)的处理支持
在Controller类中新增多种运动控制功能接口
更新README文档以包含新增的运动切换命令和功能说明
2025-09-21 14:40:11 +08:00
f30590033b refactor(config): 重构配置系统和MQTT相关功能
移除状态发布功能,简化配置系统
更新MQTT配置和主题设置
调整README文档以反映最新变更
2025-09-20 19:54:04 +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
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
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
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
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