diff --git a/.github/LICENSE_HEADER.txt b/.github/LICENSE_HEADER.txt new file mode 100644 index 0000000..ca9ec7e --- /dev/null +++ b/.github/LICENSE_HEADER.txt @@ -0,0 +1,2 @@ +Copyright (c) 2024-2025 Ziqi Fan +SPDX-License-Identifier: Apache-2.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8be893c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.1 + hooks: + - id: insert-license + files: \.(py|yaml)$ + args: + # - --remove-header # Remove existing license headers. Useful when updating license. + - --license-filepath + - .github/LICENSE_HEADER.txt + - --use-current-year + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.1 + hooks: + - id: insert-license + files: \.(cpp|hpp)$ + args: + # - --remove-header # Remove existing license headers. Useful when updating license. + - --license-filepath + - .github/LICENSE_HEADER.txt + - --use-current-year + - --comment-style + - /*| *| */ + +exclude: ^(src/rl_sar/library/matplotlibcpp|src/rl_sar/library/unitree_legged_sdk_3.2|src/rl_sar/library/unitree_sdk2)/ diff --git a/LICENCE b/LICENSE similarity index 99% rename from LICENCE rename to LICENSE index d337cd3..d6da63e 100644 --- a/LICENCE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Fan Ziqi + Copyright 2024-2025 Ziqi Fan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/rl_sar/include/rl_real_a1.hpp b/src/rl_sar/include/rl_real_a1.hpp index 2b15f29..fadeb21 100644 --- a/src/rl_sar/include/rl_real_a1.hpp +++ b/src/rl_sar/include/rl_real_a1.hpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #ifndef RL_REAL_HPP #define RL_REAL_HPP diff --git a/src/rl_sar/include/rl_real_go2.hpp b/src/rl_sar/include/rl_real_go2.hpp index 39b8130..4f54d5d 100644 --- a/src/rl_sar/include/rl_real_go2.hpp +++ b/src/rl_sar/include/rl_real_go2.hpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #ifndef RL_REAL_HPP #define RL_REAL_HPP diff --git a/src/rl_sar/include/rl_sim.hpp b/src/rl_sar/include/rl_sim.hpp index 086e268..259fb28 100644 --- a/src/rl_sar/include/rl_sim.hpp +++ b/src/rl_sar/include/rl_sim.hpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #ifndef RL_SIM_HPP #define RL_SIM_HPP diff --git a/src/rl_sar/library/loop/loop.hpp b/src/rl_sar/library/loop/loop.hpp index 76b2a02..33aa275 100644 --- a/src/rl_sar/library/loop/loop.hpp +++ b/src/rl_sar/library/loop/loop.hpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #ifndef LOOP_H #define LOOP_H diff --git a/src/rl_sar/library/observation_buffer/observation_buffer.cpp b/src/rl_sar/library/observation_buffer/observation_buffer.cpp index 32376f8..96c27d2 100644 --- a/src/rl_sar/library/observation_buffer/observation_buffer.cpp +++ b/src/rl_sar/library/observation_buffer/observation_buffer.cpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #include "observation_buffer.hpp" ObservationBuffer::ObservationBuffer() {} diff --git a/src/rl_sar/library/observation_buffer/observation_buffer.hpp b/src/rl_sar/library/observation_buffer/observation_buffer.hpp index cb4afea..5f4a92d 100644 --- a/src/rl_sar/library/observation_buffer/observation_buffer.hpp +++ b/src/rl_sar/library/observation_buffer/observation_buffer.hpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #ifndef OBSERVATION_BUFFER_HPP #define OBSERVATION_BUFFER_HPP diff --git a/src/rl_sar/library/rl_sdk/rl_sdk.cpp b/src/rl_sar/library/rl_sdk/rl_sdk.cpp index 9d95e13..2ae19a6 100644 --- a/src/rl_sar/library/rl_sdk/rl_sdk.cpp +++ b/src/rl_sar/library/rl_sdk/rl_sdk.cpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #include "rl_sdk.hpp" /* You may need to override this Forward() function diff --git a/src/rl_sar/library/rl_sdk/rl_sdk.hpp b/src/rl_sar/library/rl_sdk/rl_sdk.hpp index 1afd0f6..df279e2 100644 --- a/src/rl_sar/library/rl_sdk/rl_sdk.hpp +++ b/src/rl_sar/library/rl_sdk/rl_sdk.hpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #ifndef RL_SDK_HPP #define RL_SDK_HPP diff --git a/src/rl_sar/models/a1_isaacgym/config.yaml b/src/rl_sar/models/a1_isaacgym/config.yaml index 6afd6a4..8a58e69 100644 --- a/src/rl_sar/models/a1_isaacgym/config.yaml +++ b/src/rl_sar/models/a1_isaacgym/config.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + a1_isaacgym: model_name: "model_0702.pt" framework: "isaacgym" diff --git a/src/rl_sar/models/a1_isaacsim/config.yaml b/src/rl_sar/models/a1_isaacsim/config.yaml index e11becb..d7bf28b 100644 --- a/src/rl_sar/models/a1_isaacsim/config.yaml +++ b/src/rl_sar/models/a1_isaacsim/config.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + a1_isaacsim: model_name: "policy.pt" framework: "isaacsim" diff --git a/src/rl_sar/models/go2_isaacgym/config.yaml b/src/rl_sar/models/go2_isaacgym/config.yaml index 2f18441..acc1ea3 100644 --- a/src/rl_sar/models/go2_isaacgym/config.yaml +++ b/src/rl_sar/models/go2_isaacgym/config.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + go2_isaacgym: model_name: "himloco.pt" framework: "isaacgym" diff --git a/src/rl_sar/models/gr1t1_isaacgym/config.yaml b/src/rl_sar/models/gr1t1_isaacgym/config.yaml index b1ca42b..adf310c 100644 --- a/src/rl_sar/models/gr1t1_isaacgym/config.yaml +++ b/src/rl_sar/models/gr1t1_isaacgym/config.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + gr1t1_isaacgym: model_name: "model_4000_jit.pt" framework: "isaacgym" diff --git a/src/rl_sar/models/gr1t2_isaacgym/config.yaml b/src/rl_sar/models/gr1t2_isaacgym/config.yaml index b83b7c1..0a8dfa3 100644 --- a/src/rl_sar/models/gr1t2_isaacgym/config.yaml +++ b/src/rl_sar/models/gr1t2_isaacgym/config.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + gr1t2_isaacgym: model_name: "model_4000_jit.pt" framework: "isaacgym" diff --git a/src/rl_sar/scripts/actuator_net.py b/src/rl_sar/scripts/actuator_net.py index b62b705..50497ac 100644 --- a/src/rl_sar/scripts/actuator_net.py +++ b/src/rl_sar/scripts/actuator_net.py @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + import os import argparse from matplotlib import pyplot as plt diff --git a/src/rl_sar/scripts/observation_buffer.py b/src/rl_sar/scripts/observation_buffer.py index 230e728..9293dd5 100644 --- a/src/rl_sar/scripts/observation_buffer.py +++ b/src/rl_sar/scripts/observation_buffer.py @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + import torch class ObservationBuffer: diff --git a/src/rl_sar/scripts/rl_sdk.py b/src/rl_sar/scripts/rl_sdk.py index ab426ff..0766e2b 100644 --- a/src/rl_sar/scripts/rl_sdk.py +++ b/src/rl_sar/scripts/rl_sdk.py @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + import torch import yaml import os diff --git a/src/rl_sar/scripts/rl_sim.py b/src/rl_sar/scripts/rl_sim.py index 091cf08..bedf1c7 100644 --- a/src/rl_sar/scripts/rl_sim.py +++ b/src/rl_sar/scripts/rl_sim.py @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + import sys import os import torch diff --git a/src/rl_sar/src/rl_real_a1.cpp b/src/rl_sar/src/rl_real_a1.cpp index b7e005a..7f39f8c 100644 --- a/src/rl_sar/src/rl_real_a1.cpp +++ b/src/rl_sar/src/rl_real_a1.cpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #include "rl_real_a1.hpp" // #define PLOT diff --git a/src/rl_sar/src/rl_real_go2.cpp b/src/rl_sar/src/rl_real_go2.cpp index 9a8fe5b..c23d262 100644 --- a/src/rl_sar/src/rl_real_go2.cpp +++ b/src/rl_sar/src/rl_real_go2.cpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #include "rl_real_go2.hpp" // #define PLOT diff --git a/src/rl_sar/src/rl_sim.cpp b/src/rl_sar/src/rl_sim.cpp index db09a4b..d6f015f 100644 --- a/src/rl_sar/src/rl_sim.cpp +++ b/src/rl_sar/src/rl_sim.cpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #include "rl_sim.hpp" // #define PLOT diff --git a/src/robot_joint_controller/src/robot_joint_controller.cpp b/src/robot_joint_controller/src/robot_joint_controller.cpp index 86e077e..e13612b 100644 --- a/src/robot_joint_controller/src/robot_joint_controller.cpp +++ b/src/robot_joint_controller/src/robot_joint_controller.cpp @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2024-2025 Ziqi Fan + * SPDX-License-Identifier: Apache-2.0 + */ + #include "robot_joint_controller.h" #include diff --git a/src/robots/a1_description/config/robot_control.yaml b/src/robots/a1_description/config/robot_control.yaml index 0e044d4..e4aa601 100644 --- a/src/robots/a1_description/config/robot_control.yaml +++ b/src/robots/a1_description/config/robot_control.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + a1_gazebo: # Publish all joint states ----------------------------------- joint_state_controller: diff --git a/src/robots/go2_description/config/robot_control.yaml b/src/robots/go2_description/config/robot_control.yaml index 2991707..dbfefd2 100755 --- a/src/robots/go2_description/config/robot_control.yaml +++ b/src/robots/go2_description/config/robot_control.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + go2_gazebo: # Publish all joint states ----------------------------------- joint_state_controller: diff --git a/src/robots/gr1t1_description/config/robot_control.yaml b/src/robots/gr1t1_description/config/robot_control.yaml index d622661..c152832 100644 --- a/src/robots/gr1t1_description/config/robot_control.yaml +++ b/src/robots/gr1t1_description/config/robot_control.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + gr1t1_gazebo: # Publish all joint states ----------------------------------- joint_state_controller: diff --git a/src/robots/gr1t2_description/config/robot_control.yaml b/src/robots/gr1t2_description/config/robot_control.yaml index c7c78c1..23407b9 100644 --- a/src/robots/gr1t2_description/config/robot_control.yaml +++ b/src/robots/gr1t2_description/config/robot_control.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024-2025 Ziqi Fan +# SPDX-License-Identifier: Apache-2.0 + gr1t2_gazebo: # Publish all joint states ----------------------------------- joint_state_controller: