🚀 神經運動規劃器(Neural MP)
神經運動規劃器(Neural MP)是一個基於機器學習的機器人操作任務運動規劃系統。它將在大規模模擬數據上訓練的神經網絡與輕量級優化技術相結合,以生成高效、無碰撞的軌跡。Neural MP 旨在跨不同環境和障礙物配置進行泛化,適用於模擬和現實世界的機器人應用。本倉庫包含 Neural MP 的模型權重。
所有 Neural MP 檢查點以及我們的 代碼庫 均在 MIT 許可證下發布。
如需瞭解完整詳情,請閱讀我們的 論文 並訪問 我們的項目頁面。
✨ 主要特性
- 基於機器學習,結合神經網絡與優化技術,生成高效無碰撞軌跡。
- 能在不同環境和障礙物配置中實現泛化,適用於模擬和現實場景。
📦 安裝指南
請閱讀 此處 獲取詳細安裝說明。
💻 使用示例
基礎用法
Neural MP 模型以 3D 點雲以及 Franka 機器人的起始和目標角度作為輸入,並預測 7 自由度的關節增量動作。我們提供了一個包裝類 NeuralMP 用於推理,並將模型部署到現實世界中。
以下是使用 Manimo Franka 控制庫的部署示例:
注意:不強制使用 Manimo,你可以通過創建一個繼承自 FrankaRealEnv 的包裝類(見 franka_real_env.py)來使用其他 Franka 控制庫。
import argparse
import numpy as np
from neural_mp.envs.franka_real_env import FrankaRealEnvManimo
from neural_mp.real_utils.neural_motion_planner import NeuralMP
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--mdl_url",
type=str,
default="mihdalal/NeuralMP",
help="hugging face url to load the neural_mp model",
)
parser.add_argument(
"--cache-name",
type=str,
default="scene1_single_blcok",
help="Specify the scene cache file with pcd and rgb data",
)
parser.add_argument(
"--use-cache",
action="store_true",
help=("If set, will use pre-stored point clouds"),
)
parser.add_argument(
"--debug-combined-pcd",
action="store_true",
help=("If set, will show visualization of the combined pcd"),
)
parser.add_argument(
"--denoise-pcd",
action="store_true",
help=("If set, will apply denoising to the pcds"),
)
parser.add_argument(
"--train-mode", action="store_true", help=("If set, will eval with policy in training mode")
)
parser.add_argument(
"--tto", action="store_true", help=("If set, will apply test time optimization")
)
parser.add_argument(
"--in-hand", action="store_true", help=("If set, will enable in hand mode for eval")
)
parser.add_argument(
"--in-hand-params",
nargs="+",
type=float,
default=[0.1, 0.1, 0.1, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 1.0],
help="Specify the bounding box of the in hand object. 10 params in total [size(xyz), pos(xyz), ori(xyzw)] 3+3+4.",
)
args = parser.parse_args()
env = FrankaRealEnvManimo()
neural_mp = NeuralMP(
env=env,
model_url=args.mdl_url,
train_mode=args.train_mode,
in_hand=args.in_hand,
in_hand_params=args.in_hand_params,
visualize=True,
)
points, colors = neural_mp.get_scene_pcd(
use_cache=args.use_cache,
cache_name=args.cache_name,
debug_combined_pcd=args.debug_combined_pcd,
denoise=args.denoise_pcd,
)
start_config = np.array([-0.538, 0.628, -0.061, -1.750, 0.126, 2.418, 1.610])
goal_config = np.array([1.067, 0.847, -0.591, -1.627, 0.623, 2.295, 2.580])
if args.tto:
trajectory = neural_mp.motion_plan_with_tto(
start_config=start_config,
goal_config=goal_config,
points=points,
colors=colors,
)
else:
trajectory = neural_mp.motion_plan(
start_config=start_config,
goal_config=goal_config,
points=points,
colors=colors,
)
success, joint_error = neural_mp.execute_motion_plan(trajectory, speed=0.2)
📚 詳細文檔
模型概要
📄 許可證
本項目採用 MIT 許可證。所有 Neural MP 檢查點以及我們的 代碼庫 均在該許可證下發布。