Commit Graph

64 Commits

Author SHA1 Message Date
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
acae58fa18 refactor(controller): Remove StaticWalk method from controller interface
- Deleted the StaticWalk method from the controller header and implementation files to streamline the interface and eliminate unused functionality.
2025-09-23 19:23:34 +08:00
175b37ad49 refactor(controller): Replace ClassicWalk with StaticWalk method
- Renamed the ClassicWalk method to StaticWalk in the controller interface, removing the flag parameter for a simplified usage.
- Updated the implementation to reflect the new method signature, ensuring consistency across the controller functionality.
2025-09-23 19:22:08 +08:00
44becb76e6 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.
2025-09-23 19:19:18 +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
5247295521 refactor(low_controller): 移动UT_CPU_ID_NONE定义并更新引用
将UT_CPU_ID_NONE宏定义移动到头文件顶部常量定义区域
在cpp文件中使用新的宏定义位置替代完整命名空间引用
2025-09-22 19:29:17 +08:00
95446bdc94 refactor(low_controller): 移除停止时的线程清理并添加CPU ID宏定义
移除LowController::stop()中不必要的线程清理代码,因为running_标志位已足够控制线程行为
在头文件中添加UT_CPU_ID_NONE宏定义用于CPU标识
2025-09-22 19:27:04 +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
de6e080dca Revert "refactor(controller): Remove unused motion control methods"
This reverts commit bd023eaba3.
2025-09-22 15:25:42 +08:00
cdcc95bff3 Revert "refactor(controller): Remove additional unused motion control methods"
This reverts commit 2189d7841f.
2025-09-22 15:24:58 +08:00
2189d7841f refactor(controller): Remove additional unused motion control methods
- Deleted the UseRemoteCommandFromApi, MoveToAbsolutePosition, and MoveToIncrementPosition methods from the controller interface and implementation. This further simplifies the code structure and enhances maintainability.
2025-09-22 15:18:30 +08:00
bd023eaba3 refactor(controller): Remove unused motion control methods
- Eliminated several unused motion control methods from the controller interface and implementation, including Content, LeftFlip, BackFlip, HandStand, FreeWalk, FreeBound, FreeJump, FreeAvoid, ClassicWalk, WalkUpright, CrossStep, AutoRecoverSet, StaticWalk, TrotRun, and EconomicGait. This cleanup simplifies the code structure and improves maintainability.
2025-09-22 15:15:10 +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
48cae46960 refactor(navigation): Update ChannelSubscriberPtr to use specific message type
- Changed ChannelSubscriberPtr to ChannelSubscriberPtr<std_msgs::msg::dds_::String_> for slamInfo and slamKeyInfo in navigation.hpp and navigation.cpp.
- Updated initialization of subscribers to reflect the new type specification.
2025-09-22 14:50:52 +08:00
6b9ad80757 fix(命名空间): 修复Unitree SDK类型命名空间问题并重构PoseData
- 将ChannelSubscriberPtr改为unitree::robot::ChannelSubscriberPtr
- 重构PoseData结构为poseDate类,增加JSON序列化功能
- 更新相关代码以使用新的poseDate类
2025-09-22 14:46:18 +08:00
1e4e5c3943 feat(服务监控): 添加服务状态自动打印功能
当获取服务列表时,系统现在会自动打印每个服务的状态信息到日志中,包括服务名称、当前状态(ACTIVE/INACTIVE)和保护状态(YES/NO)
2025-09-22 14:30:59 +08:00
ec6f4c0057 feat(导航): 实现SLAM信息处理和导航状态管理
添加SLAM信息订阅处理功能,包括位姿更新和任务结果处理
引入PoseData结构体存储当前位姿信息
使用常量定义替换硬编码的API ID
增加导航状态管理功能(到达检测)
2025-09-22 11:33:15 +08:00
1d8daa7542 fix(navigation): 修复Navigation类中Init方法的实现
移除对Client::Init()的显式调用,因为基类构造函数已处理该初始化。同时更新README.md中的相关描述。
2025-09-21 15:24:58 +08:00
b6b1dc410b refactor(custom_robot): 移除未使用的运动控制命令
移除BodyHeight、SwitchGait、ContinuousGait、MoveToPos和FastWalk等不再使用的运动控制命令处理逻辑,简化代码结构
2025-09-21 15:21:00 +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
f30590033b refactor(config): 重构配置系统和MQTT相关功能
移除状态发布功能,简化配置系统
更新MQTT配置和主题设置
调整README文档以反映最新变更
2025-09-20 19:54:04 +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