From f8503cd1c1e965752b85669cb896289463a6c2ba Mon Sep 17 00:00:00 2001 From: youjian <1124895509@qq.com> Date: Sat, 28 Sep 2024 17:13:16 +0800 Subject: [PATCH 1/4] Add LegCmd and LegCommandSender. --- .pre-commit-config.yaml | 6 ++--- .../rm_common/decision/command_sender.h | 27 +++++++++++++++++++ rm_msgs/CMakeLists.txt | 1 + rm_msgs/msg/LegCmd.msg | 4 +++ 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 rm_msgs/msg/LegCmd.msg diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d0447fb2..9f6941c5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: # Standard hooks - - repo: https://github.com/pre-commit/pre-commit-hooks + - repo: git@github.com:pre-commit/pre-commit-hooks.git rev: v4.0.1 hooks: - id: check-added-large-files @@ -28,12 +28,12 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - - repo: https://github.com/psf/black + - repo: git@github.com:psf/black rev: 20.8b1 hooks: - id: black - - repo: https://github.com/Lucas-C/pre-commit-hooks-markup + - repo: git@github.com:Lucas-C/pre-commit-hooks-markup rev: v1.0.1 hooks: - id: rst-linter diff --git a/rm_common/include/rm_common/decision/command_sender.h b/rm_common/include/rm_common/decision/command_sender.h index 74a60619..ee37bf7f 100644 --- a/rm_common/include/rm_common/decision/command_sender.h +++ b/rm_common/include/rm_common/decision/command_sender.h @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -564,6 +565,32 @@ class BalanceCommandSender : public CommandSenderBase void setZero() override{}; }; +class LegCommandSender : public CommandSenderBase +{ +public: + explicit LegCommandSender(ros::NodeHandle& nh) : CommandSenderBase(nh) + { + } + + void setJump(bool jump) + { + msg_.jump = jump; + } + void setLgeLength(double length) + { + msg_.leg_length = length; + } + bool getJump() + { + return msg_.jump; + } + double getLgeLength() + { + return msg_.leg_length; + } + void setZero() override{}; +}; + class Vel3DCommandSender : public HeaderStampCommandSenderBase { public: diff --git a/rm_msgs/CMakeLists.txt b/rm_msgs/CMakeLists.txt index 0038f82c..1399bfdd 100644 --- a/rm_msgs/CMakeLists.txt +++ b/rm_msgs/CMakeLists.txt @@ -22,6 +22,7 @@ add_message_files( GimbalCmd.msg GimbalDesError.msg GimbalPosState.msg + LegCmd.msg LpData.msg LocalHeatState.msg KalmanData.msg diff --git a/rm_msgs/msg/LegCmd.msg b/rm_msgs/msg/LegCmd.msg new file mode 100644 index 00000000..43241ab3 --- /dev/null +++ b/rm_msgs/msg/LegCmd.msg @@ -0,0 +1,4 @@ +bool jump +float64 leg_length + +time stamp From 4a11fca4401aeaa41e65455d45c4e0bb11043612 Mon Sep 17 00:00:00 2001 From: youjian <1124895509@qq.com> Date: Sun, 29 Sep 2024 15:34:18 +0800 Subject: [PATCH 2/4] Delete unused stamp in LegCmd.msg. --- rm_msgs/msg/LegCmd.msg | 2 -- 1 file changed, 2 deletions(-) diff --git a/rm_msgs/msg/LegCmd.msg b/rm_msgs/msg/LegCmd.msg index 43241ab3..57f90085 100644 --- a/rm_msgs/msg/LegCmd.msg +++ b/rm_msgs/msg/LegCmd.msg @@ -1,4 +1,2 @@ bool jump float64 leg_length - -time stamp From e27d4f1159f3ff9c9437644e3ccefa304b917745 Mon Sep 17 00:00:00 2001 From: WUYOUJIAN <117335706+YoujianWu@users.noreply.github.com> Date: Sun, 29 Sep 2024 15:41:50 +0800 Subject: [PATCH 3/4] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f6941c5..14ba47ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: # Standard hooks - - repo: git@github.com:pre-commit/pre-commit-hooks.git + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 hooks: - id: check-added-large-files @@ -28,12 +28,12 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - - repo: git@github.com:psf/black + - repo: https://github.com/psf/black rev: 20.8b1 hooks: - id: black - - repo: git@github.com:Lucas-C/pre-commit-hooks-markup + - repo: https://github.com/Lucas-C/pre-commit-hooks-markup rev: v1.0.1 hooks: - id: rst-linter @@ -55,3 +55,4 @@ repos: language: system always_run: true pass_filenames: false + From 2697d1a0b64df4e59b1be8aab935d0e5fa64ab86 Mon Sep 17 00:00:00 2001 From: WUYOUJIAN <117335706+YoujianWu@users.noreply.github.com> Date: Sun, 29 Sep 2024 15:53:46 +0800 Subject: [PATCH 4/4] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14ba47ff..d0447fb2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,4 +55,3 @@ repos: language: system always_run: true pass_filenames: false -