🚀 神经运动规划器(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 检查点以及我们的 代码库 均在该许可证下发布。