diff --git a/docs/humanoid/g1_corridor_teleop/index.md b/docs/humanoid/g1_corridor_teleop/index.md new file mode 100644 index 0000000000..67ab19fad5 --- /dev/null +++ b/docs/humanoid/g1_corridor_teleop/index.md @@ -0,0 +1,33 @@ +# G1 室内走廊键盘遥控 + +通过键盘复现 G1 预训练步态在室内走廊的前进、转向和停止。 + +## 环境与运行 + +使用 Python 3.11。在模块目录运行 `python -m pip install -r requirements.txt`。 + +在模块目录运行 `python scripts/fetch_assets.py /path/to/unitree_rl_gym` 获取固定版本的 G1 资产。底层步态来自 Unitree 预训练策略。 + +```bash +python main.py --assets /path/to/unitree_rl_gym +``` + +使用 WASD 或方向键前进、后退和转向,空格停车,+/- 调速。持续按键维持命令,0.6 秒无按键后速度归零。无窗口时可运行 `--mode smoke` 验证步态。 + +## ROS launch + +在 ROS Noetic 源码空间运行,将路径替换为实际值。 + +```bash +source /opt/ros/noetic/setup.bash +export ROS_PACKAGE_PATH="$PWD:${ROS_PACKAGE_PATH:-}" +roslaunch g1_corridor_teleop main.launch sim_python:=/path/to/python sim_entry:=/path/to/main.py assets:=/path/to/unitree_rl_gym +``` + +## 运行效果 + +![G1 室内走廊键盘遥控](../../img/g1_corridor_teleop/teleop.png) + +## 大模型使用声明 + +使用 OpenAI Codex 辅助拆分、编程、验证和文档整理,提交者复核并对提交内容负责。 diff --git a/docs/img/g1_corridor_teleop/teleop.png b/docs/img/g1_corridor_teleop/teleop.png new file mode 100644 index 0000000000..644b0e10cd Binary files /dev/null and b/docs/img/g1_corridor_teleop/teleop.png differ diff --git a/docs/index.md b/docs/index.md index 9f6f16ff53..56129b6206 100644 --- a/docs/index.md +++ b/docs/index.md @@ -86,6 +86,7 @@ ROS 2 服务与参数基础实验(无人机模式切换与在线调参):[c ## 2. 人形机器人 * [人形机器人基础](./humanoid/humanoid_basics.md) +* [G1 室内走廊键盘遥控](./humanoid/g1_corridor_teleop/index.md) * [人形机器人双臂搬运负载的神经网络平衡控制](./humanoid/humanoid_carry_payload_nn.md) * [双足步态生成与 ZMP 稳定性](./humanoid/bipedal_gait_zmp.md) * [基于三次样条插值的双足多步态平滑切换](./humanoid/biped_cubic_spline_gait_switch.md) diff --git a/mkdocs.yml b/mkdocs.yml index edf15e5906..80398fc47a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -80,6 +80,7 @@ nav: - 人形机器人: - 人形机器人基础: './humanoid/humanoid_basics.md' + - G1 室内走廊键盘遥控: './humanoid/g1_corridor_teleop/index.md' - 双臂搬运负载的神经网络平衡控制: './humanoid/humanoid_carry_payload_nn.md' - 双足步态生成与 ZMP 稳定性: './humanoid/bipedal_gait_zmp.md' - 基于三次样条插值的双足多步态平滑切换: './humanoid/biped_cubic_spline_gait_switch.md' diff --git a/src/humanoid/g1_corridor_teleop/.gitattributes b/src/humanoid/g1_corridor_teleop/.gitattributes new file mode 100644 index 0000000000..f13e51c0ec --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/.gitattributes @@ -0,0 +1,2 @@ +*.py text eol=lf +*.sh text eol=lf diff --git a/src/humanoid/g1_corridor_teleop/CMakeLists.txt b/src/humanoid/g1_corridor_teleop/CMakeLists.txt new file mode 100644 index 0000000000..b84a1b1593 --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.0.2) +project(g1_corridor_teleop) +find_package(catkin REQUIRED) +catkin_package() +catkin_install_python(PROGRAMS scripts/task_runner.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) +install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) diff --git a/src/humanoid/g1_corridor_teleop/README.md b/src/humanoid/g1_corridor_teleop/README.md new file mode 100644 index 0000000000..20ed779402 --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/README.md @@ -0,0 +1,29 @@ +# G1 室内走廊键盘遥控 + +通过键盘复现 G1 预训练步态在室内走廊的前进、转向和停止。 + +## 环境与运行 + +使用 Python 3.11。在模块目录运行 `python -m pip install -r requirements.txt`。 + +在模块目录运行 `python scripts/fetch_assets.py /path/to/unitree_rl_gym` 获取固定版本的 G1 资产。底层步态来自 Unitree 预训练策略。 + +```bash +python main.py --assets /path/to/unitree_rl_gym +``` + +使用 WASD 或方向键前进、后退和转向,空格停车,+/- 调速。持续按键维持命令,0.6 秒无按键后速度归零。无窗口时可运行 `--mode smoke` 验证步态。 + +## ROS launch + +在 ROS Noetic 源码空间运行,将路径替换为实际值。 + +```bash +source /opt/ros/noetic/setup.bash +export ROS_PACKAGE_PATH="$PWD:${ROS_PACKAGE_PATH:-}" +roslaunch g1_corridor_teleop main.launch sim_python:=/path/to/python sim_entry:=/path/to/main.py assets:=/path/to/unitree_rl_gym +``` + +## 大模型使用声明 + +使用 OpenAI Codex 辅助拆分、编程、验证和文档整理,提交者复核并对提交内容负责。 diff --git a/src/humanoid/g1_corridor_teleop/launch/main.launch b/src/humanoid/g1_corridor_teleop/launch/main.launch new file mode 100644 index 0000000000..ebb8a1f2cb --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/launch/main.launch @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/humanoid/g1_corridor_teleop/main.py b/src/humanoid/g1_corridor_teleop/main.py new file mode 100644 index 0000000000..a5b826dec9 --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/main.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +"""通过键盘复现 G1 预训练步态在室内走廊的前进、转向和停止。""" +import argparse +import json +from pathlib import Path + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--assets', required=True, help='Path to unitree_rl_gym checkout') + parser.add_argument('--mode', choices=['teleop', 'smoke'], default='teleop') + parser.add_argument('--output', type=Path) + parser.add_argument('--dataset', type=Path, default=Path('data/visual_patrol')) + parser.add_argument('--weights', type=Path, default=Path(__file__).resolve().parent / 'models') + parser.add_argument('--samples', type=int, default=100) + parser.add_argument('--epochs', type=int, default=15) + parser.add_argument('--seed', type=int, default=7) + parser.add_argument('--seconds', type=float, default=45) + parser.add_argument('--record', action='store_true') + parser.add_argument('--controller',choices=['navigation','perception','end2end'],default='navigation') + args = parser.parse_args() + if args.mode == 'teleop': + from patrol.runtime import teleop + teleop(args.assets,args.seed,args.seconds,args.output) + return + from patrol.locomotion import Walker + result = Walker(args.assets).smoke_test() + report = json.dumps(result, indent=2) + print(report) + if args.output: + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(report+'\n', encoding='utf-8') + if result['fallen'] or result['displacement_m'] < 0.5: + raise SystemExit(1) + + +if __name__ == '__main__': + main() diff --git a/src/humanoid/g1_corridor_teleop/package.xml b/src/humanoid/g1_corridor_teleop/package.xml new file mode 100644 index 0000000000..d0ddda5d2b --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/package.xml @@ -0,0 +1,9 @@ + + + g1_corridor_teleop0.1.0 + MuJoCo G1 visual floor perception, image control and ROS indoor navigation. + OpenHUTB contributor + BSD-3-Clause + catkin + rospy + diff --git a/src/humanoid/g1_corridor_teleop/patrol/__init__.py b/src/humanoid/g1_corridor_teleop/patrol/__init__.py new file mode 100644 index 0000000000..bc4204b4fb --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/patrol/__init__.py @@ -0,0 +1 @@ +"""Visual patrol on a physics simulated G1 humanoid.""" diff --git a/src/humanoid/g1_corridor_teleop/patrol/locomotion.py b/src/humanoid/g1_corridor_teleop/patrol/locomotion.py new file mode 100644 index 0000000000..d072059b3d --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/patrol/locomotion.py @@ -0,0 +1,85 @@ +"""G1 velocity-command adapter using Unitree's pretrained locomotion policy. + +Observation ordering and PD gains follow unitree_rl_gym/deploy/deploy_mujoco +(BSD-3-Clause). This module does not train the underlying walking policy. +""" +from pathlib import Path +import math + +import mujoco +import numpy as np +import torch +import yaml + + +class Walker: + def __init__(self, assets, xml_path=None): + assets = Path(assets).resolve() + config_path = assets / 'deploy/deploy_mujoco/configs/g1.yaml' + self.config = yaml.safe_load(config_path.read_text(encoding='utf-8')) + def resolve(value): + return value.replace('{LEGGED_GYM_ROOT_DIR}', assets.as_posix()) + self.model = mujoco.MjModel.from_xml_path(str(xml_path or resolve(self.config['xml_path']))) + self.data = mujoco.MjData(self.model) + self.model.opt.timestep = self.config['simulation_dt'] + torch.set_num_threads(2) + self.policy = torch.jit.load(resolve(self.config['policy_path']), map_location='cpu').eval() + self.default = np.asarray(self.config['default_angles'], dtype=np.float32) + self.kp = np.asarray(self.config['kps']) + self.kd = np.asarray(self.config['kds']) + self.command = np.zeros(3, dtype=np.float32) + self.action = np.zeros(self.config['num_actions'], dtype=np.float32) + self.target = self.default.copy() + self.counter = 0 + mujoco.mj_forward(self.model, self.data) + + def set_command(self, vx=0.0, vy=0.0, wz=0.0): + value = np.array([vx, vy, wz], dtype=np.float32) + if not np.isfinite(value).all(): + raise ValueError('Command must be finite') + self.command[:] = np.clip(value, [-0.3, -0.2, -0.5], [0.5, 0.2, 0.5]) + + @property + def yaw(self): + w, x, y, z = self.data.qpos[3:7] + return math.atan2(2*(w*z+x*y), 1-2*(y*y+z*z)) + + @property + def fallen(self): + return self.data.qpos[2] < 0.40 or not np.isfinite(self.data.qpos).all() + + def step(self): + c, d = self.config, self.data + for _ in range(c['control_decimation']): + d.ctrl[:] = (self.target-d.qpos[7:])*self.kp-d.qvel[6:]*self.kd + mujoco.mj_step(self.model, d) + self.counter += 1 + w, x, y, z = d.qpos[3:7] + gravity = np.array([2*(-z*x+w*y), -2*(z*y+w*x), 1-2*(w*w+z*z)]) + phase = 2*np.pi*(d.time % 0.8)/0.8 + observation = np.concatenate([ + d.qvel[3:6]*c['ang_vel_scale'], gravity, + self.command*np.asarray(c['cmd_scale']), + (d.qpos[7:]-self.default)*c['dof_pos_scale'], + d.qvel[6:]*c['dof_vel_scale'], self.action, + [np.sin(phase), np.cos(phase)], + ]).astype(np.float32) + with torch.inference_mode(): + self.action = self.policy(torch.from_numpy(observation)[None]).numpy().reshape(-1) + self.target = self.action*c['action_scale']+self.default + + def smoke_test(self, seconds=12.0): + start = self.data.qpos[:3].copy() + min_height = float(start[2]) + while self.data.time < seconds: + t = self.data.time + self.set_command(0.0 if t < 2 or t >= 10 else 0.3, + wz=0.25 if 6 <= t < 10 else 0.0) + self.step() + min_height = min(min_height, float(self.data.qpos[2])) + if self.fallen: + break + return dict(simulated_seconds=float(self.data.time), fallen=bool(self.fallen), + displacement_m=float(np.linalg.norm(self.data.qpos[:2]-start[:2])), + min_height_m=min_height, final_yaw_rad=float(self.yaw), + final_position=self.data.qpos[:3].tolist()) diff --git a/src/humanoid/g1_corridor_teleop/patrol/runtime.py b/src/humanoid/g1_corridor_teleop/patrol/runtime.py new file mode 100644 index 0000000000..c848fe6d23 --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/patrol/runtime.py @@ -0,0 +1,46 @@ +import json +from pathlib import Path +import time + +import numpy as np + +from .scene import IndoorSimulator + + +def teleop(assets,seed=0,seconds=45,output=None): + """Interactive MuJoCo viewer; arrow/WASD commands expire after 0.6s.""" + import mujoco.viewer + sim = IndoorSimulator(assets,seed) + command = np.zeros(2) + speed = [.25] + last_key = [0.] + events = [] + def key(code): + if code in (87,265): command[:] = [speed[0],0] + elif code in (83,264): command[:] = [-speed[0],0] + elif code in (65,263): command[:] = [0,.35] + elif code in (68,262): command[:] = [0,-.35] + elif code == 32: command[:] = 0 + elif code in (61,334): speed[0] = min(.4,speed[0]+.05) + elif code in (45,333): speed[0] = max(.1,speed[0]-.05) + last_key[0] = time.monotonic() + events.append(dict(key=code,command=command.tolist(),time=float(sim.data.time))) + print('WASD/arrows: move, space: stop, +/-: speed; repeat presses to keep moving.',flush=True) + try: + with mujoco.viewer.launch_passive(sim.model,sim.data,key_callback=key) as viewer: + while viewer.is_running() and not sim.fallen and sim.data.time.6: command[:] = 0 + sim.set_command(command[0],wz=command[1]) + sim.step() + viewer.sync() + time.sleep(max(0,.02-(time.monotonic()-start))) + finally: + sim.set_command() + if output: + output=Path(output) + output.mkdir(parents=True,exist_ok=True) + (output/'teleop_check.json').write_text(json.dumps(dict(events=events, + final_position=sim.data.qpos[:3].tolist(),fallen=bool(sim.fallen), + simulated_seconds=float(sim.data.time)),indent=2),encoding='utf-8') + sim.close() diff --git a/src/humanoid/g1_corridor_teleop/patrol/scene.py b/src/humanoid/g1_corridor_teleop/patrol/scene.py new file mode 100644 index 0000000000..df750e8a32 --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/patrol/scene.py @@ -0,0 +1,112 @@ +"""Generate indoor geometry without changing the upstream robot assets.""" +from pathlib import Path +import tempfile +import xml.etree.ElementTree as ET + +import mujoco +import numpy as np + +from .locomotion import Walker + + +def build_scene(assets, seed=0): + asset_dir = Path(assets).resolve() / 'resources/robots/g1_description' + tree = ET.parse(asset_dir/'g1_12dof.xml') + root = tree.getroot() + root.find('compiler').set('meshdir', (asset_dir/'meshes').as_posix()) + world = root.find('worldbody') + pelvis = world.find("body[@name='pelvis']") + for geom in pelvis.iter('geom'): + geom.set('group', '1') + ET.SubElement(pelvis, 'camera', name='front', pos='0.16 0 0.35', + xyaxes='0 -1 0 0.35 0 0.94', fovy='75') + visual = ET.SubElement(root, 'visual') + ET.SubElement(visual, 'global', offwidth='640', offheight='480') + ET.SubElement(visual, 'headlight', ambient='0.4 0.4 0.4', diffuse='0.6 0.6 0.6') + rng = np.random.default_rng(seed) + brightness = float(rng.uniform(.6, .95)) + ET.SubElement(world, 'light', pos='3 0 4', diffuse=f'{brightness} {brightness} {brightness}') + ET.SubElement(world, 'geom', name='floor', type='plane', size='15 15 .1', rgba='.65 .65 .60 1') + boxes = [('left_wall', [4, 2, 1], [6, .12, 1]), + ('right_wall', [4, -2, 1], [6, .12, 1]), + ('back_wall', [-2, 0, 1], [.12, 2, 1]), + ('end_wall', [10, 0, 1], [.12, 2, 1]), + ('door_left', [5, 1.65, .9], [.12, .35, .9]), + ('door_right', [5, -1.65, .9], [.12, .35, .9]), + ('cabinet', [3, .95 + float(rng.uniform(-.15, .15)), .45], [.3, .3, .45])] + for name, pos, size in boxes: + rgba = [*rng.uniform(.25, .75, 3), 1] + ET.SubElement(world, 'geom', name=name, type='box', + pos=' '.join(map(str, pos)), size=' '.join(map(str, size)), + rgba=' '.join(map(str, rgba))) + ET.SubElement(world, 'geom', name='inspection_marker', type='box', + pos='9.84 0 1', size='.02 .35 .35', rgba='.1 .7 .8 1', + contype='0', conaffinity='0') + return ET.tostring(root, encoding='unicode') + + +class IndoorSimulator(Walker): + def __init__(self, assets, seed=0): + # MuJoCo 3.2 parses an XML file; generated files remain outside the repo. + with tempfile.TemporaryDirectory(prefix='humanoid_scene_') as folder: + path = Path(folder)/'scene.xml' + path.write_text(build_scene(assets, seed), encoding='utf-8') + super().__init__(assets, path) + self.renderer = None + self.floor_id = self.model.geom('floor').id + self.rng = np.random.default_rng(seed) + self.odom = np.zeros(3) + self._last_yaw = self.yaw + + def step(self): + super().step() + # Simulated velocity/gyro measurements, integrated independently of position. + dt = self.model.opt.timestep*self.config['control_decimation'] + yaw = self.yaw + rotation = np.array([[np.cos(yaw), np.sin(yaw)], [-np.sin(yaw), np.cos(yaw)]]) + body_velocity = rotation @ self.data.qvel[:2] + body_velocity += self.rng.normal(0, .003, 2) + dyaw = (yaw-self._last_yaw+np.pi)%(2*np.pi)-np.pi + self._last_yaw = yaw + self.odom[2] += dyaw + self.rng.normal(0, .0002) + c, s = np.cos(self.odom[2]), np.sin(self.odom[2]) + self.odom[:2] += np.array([[c, -s], [s, c]])@body_velocity*dt + + def image(self, labels=False, depth=False): + if self.renderer is None: + self.renderer = mujoco.Renderer(self.model, height=96, width=128) + r = self.renderer + r.disable_segmentation_rendering() + r.disable_depth_rendering() + r.update_scene(self.data, camera='front') + rgb = r.render().copy() + if labels: + r.enable_segmentation_rendering() + segmentation = r.render().copy() + r.disable_segmentation_rendering() + return rgb, (segmentation[:, :, 0] == self.floor_id).astype(np.uint8) + if depth: + r.enable_depth_rendering() + result = r.render().copy() + r.disable_depth_rendering() + return rgb, result + return rgb + + def scan(self, count=180): + origin = self.data.qpos[:3].copy() + origin[2] = .65 + ranges = [] + geom_id = np.zeros(1, dtype=np.int32) + # Only static geometry: no robot self returns. Angle frame is level base_link. + for angle in np.linspace(-np.pi, np.pi, count, endpoint=False): + a = angle + self.yaw + distance = mujoco.mj_ray(self.model, self.data, origin, + np.array([np.cos(a), np.sin(a), 0.]), np.array([1,0,0,0,0,0], dtype=np.uint8), 1, + self.model.body('pelvis').id, geom_id) + ranges.append(float(np.clip(distance if distance >= 0 else 8., .05, 8.))) + return ranges + + def close(self): + if self.renderer: + self.renderer.close() + self.renderer = None diff --git a/src/humanoid/g1_corridor_teleop/requirements.txt b/src/humanoid/g1_corridor_teleop/requirements.txt new file mode 100644 index 0000000000..f55b4da02e --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/requirements.txt @@ -0,0 +1,6 @@ +mujoco==3.2.0 +numpy>=1.24 +torch>=2.0 +PyYAML>=6 +Pillow>=10 +imageio>=2.30 diff --git a/src/humanoid/g1_corridor_teleop/scripts/fetch_assets.py b/src/humanoid/g1_corridor_teleop/scripts/fetch_assets.py new file mode 100755 index 0000000000..71f10aa86b --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/scripts/fetch_assets.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +"""Fetch the exact upstream model/policy revision; never overwrite an existing path.""" +import argparse +from pathlib import Path +import subprocess + +REVISION = '276801e46c5d433564f24658bac64f254b7d2d4b' +URL = 'https://github.com/unitreerobotics/unitree_rl_gym.git' + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('destination',type=Path) + args = parser.parse_args() + target = args.destination.resolve() + if target.exists(): + raise SystemExit('Destination exists; use a new directory or validate the existing revision manually.') + subprocess.run(['git','clone','--filter=blob:none','--no-checkout',URL,str(target)],check=True) + subprocess.run(['git','-C',str(target),'sparse-checkout','set','deploy','resources/robots/g1_description'],check=True) + subprocess.run(['git','-C',str(target),'checkout','--detach',REVISION],check=True) + print(target) + + +if __name__ == '__main__': + main() diff --git a/src/humanoid/g1_corridor_teleop/scripts/task_runner.py b/src/humanoid/g1_corridor_teleop/scripts/task_runner.py new file mode 100755 index 0000000000..c1112df063 --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/scripts/task_runner.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +"""Launch standalone simulation/learning tasks through a ROS launch file.""" +import subprocess +import rospy + + +def main(): + rospy.init_node('humanoid_task_runner') + args = [rospy.get_param('~sim_python'),rospy.get_param('~sim_entry'), + '--assets',rospy.get_param('~assets'),'--mode',rospy.get_param('~task'), + '--weights',rospy.get_param('~weights'),'--output',rospy.get_param('~output'), + '--seconds',str(rospy.get_param('~seconds',45))] + child = subprocess.Popen(args) + try: + while child.poll() is None and not rospy.is_shutdown(): + rospy.rostime.wallsleep(.1) + if child.poll() not in (None,0): + raise RuntimeError('Simulation task failed with exit code %s'%child.returncode) + finally: + if child.poll() is None: + child.terminate() + child.wait(timeout=10) + + +if __name__ == '__main__': + main() diff --git a/src/humanoid/g1_corridor_teleop/third_party_license.md b/src/humanoid/g1_corridor_teleop/third_party_license.md new file mode 100644 index 0000000000..9ad8f6dbb0 --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/third_party_license.md @@ -0,0 +1,23 @@ +BSD 3-Clause License +Copyright (c) 2016-2023 HangZhou YuShu TECHNOLOGY CO.,LTD. ("Unitree Robotics") +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/humanoid/g1_corridor_teleop/third_party_notices.md b/src/humanoid/g1_corridor_teleop/third_party_notices.md new file mode 100644 index 0000000000..01dd8c97e2 --- /dev/null +++ b/src/humanoid/g1_corridor_teleop/third_party_notices.md @@ -0,0 +1,20 @@ +# Third-party sources + +The G1 MJCF/STL assets, pretrained `motion.pt`, policy observation convention, +PD gains and action scaling originate from +[Unitree RL Gym](https://github.com/unitreerobotics/unitree_rl_gym), revision +`276801e46c5d433564f24658bac64f254b7d2d4b`, BSD-3-Clause. +The upstream copyright and license are preserved in [third_party_license.md](third_party_license.md). +Assets are fetched separately and are not duplicated into this module. + +`patrol/locomotion.py` adapts the upstream deployment equations and observation +ordering. The pretrained walking policy is not an original training result. + +MuJoCo supplies physical simulation, rendering and ray queries. ROS Noetic +gmapping and move_base supply SLAM and classical navigation. These components +retain their respective upstream licenses; no claim of a new SLAM algorithm is made. + +FloorNet, MaskController, ImageController and CostNet, the training data generator, visual corridor +controller, indoor scene generator, ROS stdio bridge and evaluation code were +created for this project with AI assistance. Training weights under `models/` +were produced by this module's training script.