Commit Graph

74 Commits

Author SHA1 Message Date
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
af7eeafd0f build(CMake): Add status message for unitree_sdk2 detection
- Included a status message to confirm the location of the found unitree_sdk2 during the CMake configuration process.
2025-09-22 15:55:19 +08:00
d7c51ac004 refactor(CMake): Add include directory for unitree SDK
- Included the path for unitree SDK in the CMake configuration to ensure proper access to necessary headers.
2025-09-22 15:53:11 +08:00
513fbe8d6a refactor(CMake): Update include directories for main target
- Reintroduced the target include directory for the main target to use a hardcoded path.
- Removed the previous target include directory declaration to streamline the configuration.
2025-09-22 15:44:15 +08:00
ec880c8a8d refactor(CMake): Rename project from 'lzwc_go2' to 'main'
- Updated the project name in CMakeLists.txt to reflect a more generic naming convention.
2025-09-22 15:42:22 +08:00
317b375bad refactor(CMake): Remove debug messages and update include directories
- Removed status messages for unitree_sdk2 include directories and libraries from the CMake configuration.
- Updated the target include directories for the main target to use a hardcoded path instead of the variable.
2025-09-22 15:40:25 +08:00
a058f3c2c9 build(CMake): Add debug messages for unitree_sdk2 include directories and libraries
- Added status messages to display the include directories and libraries for unitree_sdk2 during the CMake configuration process.
2025-09-22 15:37:06 +08:00
ef57e9b8a4 refactor(CMake): Rename project and update include directories
- Changed project name from 'unitree_go2_custom' to 'lzwc_go2'.
- Added include directory for 'unitree_sdk2' to the main target.
2025-09-22 15:33:00 +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
ccaf5f3513 build: 更新导航头文件中的消息依赖
将std_msgs/msg/dds_/String_.hpp替换为unitree/idl/ros2/String_.hpp以使用统一的消息接口
2025-09-22 14:40:38 +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
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