Commit Graph

84 Commits

Author SHA1 Message Date
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
f430360516 refactor(recharge): Add include for ROS2 String message
- Added #include for unitree/idl/ros2/String_.hpp in recharge.hpp to support new functionality related to ROS2 string messages.
2025-09-23 19:29:13 +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
d66fbae01f feat(controller): Add ClassicWalk method to controller interface
- Introduced a new method ClassicWalk to the controller class, allowing for additional walking functionality.
2025-09-23 19:15:12 +08:00
0238455ce0 refactor(recharge): Remove unused include for ROS2 String message
- Deleted the unused #include for std_msgs/msg/dds_/_String.hpp in recharge.hpp to clean up the codebase.
2025-09-23 19:12:16 +08:00
97c16f3d44 refactor(custom_robot): Remove unused MQTT client include
- Deleted the unused #include for mqtt_client.hpp in custom_robot.hpp to clean up the codebase.
2025-09-23 19:10:08 +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
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