技术分享:Franka机器人在仿真平台Mujoco的使用

本文将探讨Franka机器人在仿真平台Mujoco的使用

图片

MuJoCo介绍

MuJoCo代表多关节动力学。它是一种通用物理引擎,旨在促进机器人技术、生物力学、图形和动画、机器学习以及其他需要快速准确地模拟与环境交互的铰接结构领域的研究和开发。它最初由 Roboti LLC 开发,于 2021 年 10 月被 DeepMind 收购并免费提供,并于 2022 年 5 月开源。MuJoCo 代码库可在GitHub 上的google-deepmind/mujoco存储库中找到。

MuJoCo 是一个带有 C API 的 C/C++ 库,供研究人员和开发人员使用。运行时模拟模块经过调整,可最大程度地提高性能,并在内置 XML 解析器和编译器预先分配的低级数据结构上运行。用户使用本机 MJCF 场景描述语言(一种 XML 文件格式,旨在尽可能方便人类阅读和编辑)定义模型。还可以加载 URDF 模型文件。该库包括具有本机 GUI 的交互式可视化,以 OpenGL 呈现。MuJoCo 进一步公开了大量用于计算物理相关量的实用函数。

MuJoCo 可用于实现基于模型的计算,例如控制合成、状态估计、系统识别、机制设计、通过逆动力学进行数据分析以及机器学习应用的并行采样。它还可以用作更传统的模拟器,包括用于游戏和交互式虚拟环境。

Franka Robotics老的型号为Panda 已经停产,升级后的产品为Franka Research 3,简称“FR3”,以下部署均是在FR3在仿真平台Mujoco的基础上的测试。

Franka URDF描述

参考:https://github.com/frankaemika/franka_description

更多www.pnprobotics.com

概述

Franka 描述存储库提供所有 Franka Robotics 模型。它包括详细的 3D 模型和必要的机器人参数,这对于在各种环境中模拟这些机器人至关重要。此外,该存储库还提供了为所选 Franka 机器人模型创建 URDF(统一机器人描述格式)的功能。

特征

全面的 3D 模型:所有 Franka Robotics 模型的详细 3D 模型,可实现精确的模拟和可视化。

  • 机器人参数:实现真实可靠的模拟所需的所有机器人参数。

  • URDF 创建:能够为任何选定的 Franka 机器人模型创建 URDF 文件,这对于 ROS 和其他机器人中间件中的机器人模拟至关重要。

先决条件

  • Docker

URDF 创建

要开始生成,请执行 start.sh 脚本。传递给 sh 脚本的参数将从 create_urdf.py 中使用。

# Start the generation of the urdf model./scripts/create_urdf.sh <robot_id> <ee_id>

urdf 生成由 create_urdf.py 脚本执行,该脚本提供几个参数来定制输出 urdf 模型:

usage: create_urdf.py [-h] [--robot-ee] [--no-ee] [--with-sc] [--abs-path] [--host-dir HOST_DIR] [--only-ee] robot_model

Generate franka robots urdf models. Script to be executed from franka_description root folder!

positional arguments:

robot_model          id of the robot model (accepted values are: fr3, fp3, fer, none)

optional arguments:

-h, --help           show this help message and exit

--robot-ee           id of the robot end effector (accepted values are: franka_hand, cobot_pump)

--no-ee              Disable loading of end-effector (robot-ee would be ingnored if set) [WARNING: this argument will be removed in future releases, introducing "none" as ee id].

--with-sc            Include self-collision volumes in the urdf model.

--abs-path           Use absolute paths.

--host-dir HOST_DIR  Provide a host directory for the absolute path.

--only-ee            Get URDF with solely end-effector data

通过 ROS2 进行可视化

franka_description作为 ROS2 包提供。可以使用以下命令通过 RViz 查看 urdf 文件:

# visualize_franka.sh launches the visualize_franka.launch.py in a ros2 instance running in the docker container

# The arguments given to the .sh script are forwarded as launch arguments

# Accepted launch arguments are:

#     arm_id - accepted values are: fr3, fp3, fer

#     load_gripper - accepted values are: true (default ee_id is franka_hand), false (ee_id will be ignored) [WARNING: this argument will be removed in future releases, introducing "none" as ee id]

#     ee_id - accepted values are: franka_hand, cobot_pump./scripts/visualize_franka.sh arm_id:=<robot_id>

MUJOCO FR3 Description (MJCF)

参考:https://github.com/google-deepmind/mujoco_menagerie/blob/main/franka_fr3/README.md

概述

此软件包包含由Franka Robotics (以前称为 Franka Emika)开发的Franka Research 3(又名 FR3)的简化机器人描述 (MJCF) 。

URDF→MJCF导入步骤

  1. 在franka_description中运行 URDF 生成脚本。

    1. 使用的命令:./scripts/create_urdf.sh fr3

  2. 使用Blender将 DAE 可视化网格转换为 OBJ 。

    1. 删除了 DAE 文件中的许可证标头,以便在 Blender 中正确加载。

    2. 导出时,确保“上轴”为 +Z,“前轴”为 +Y。

  3. 使用 处理的 OBJ 文件obj2mjcf。

  4. 添加<mujoco> <compiler discardvisual="true" strippath="false" fusestatic="false" balanceinertia="true"/> </mujoco>到 URDF<robot>条款中。

  5. 将URDF加载到MuJoCo中并保存相应的MJCF。

  6. 减轻机器人上使用的黑色以更好地匹配现实世界。

  7. 手动编辑 MJCF 以将公共属性提取到该<default>部分中。

  8. 为手臂添加了位置控制执行器。

  9. 添加了scene.xml包括机器人在内的内容,带有纹理的地平面、天空和雾霾。

图片

如有混淆,参考英文如下:

  1. Ran the URDF generation script in franka_description.

    1. Command used: ./scripts/create_urdf.sh fr3

  2. Converted the DAE visual meshes to OBJ using Blender.

    1. Removed license headers in the DAE files to properly load in Blender.

    2. When exporting, ensure "up axis" is +Z, and "forward axis" is +Y.

  3. Processed OBJ files with obj2mjcf.

  4. Added <mujoco> <compiler discardvisual="true" strippath="false" fusestatic="false" balanceinertia="true"/> </mujoco> to the URDF's <robot> clause.

  5. Loaded the URDF into MuJoCo and saved a corresponding MJCF.

  6. Lightened the black color used on the robot to better match the real world.

  7. Manually edited the MJCF to extract common properties into the <default> section.

  8. Added position-controlled actuators for the arm.

  9. Added scene.xml which includes the robot, with a textured groundplane, skybox, and haze.

集智联机器人(Plug & Play Robotics),简称PNP机器人,是Franka Robotics和思灵机器人金牌合作伙伴,集智联机器人团队成员均来自于国内外机器人行业知名企业,具有较强的学术背景。PNP机器人致力于为客户提供从硬件到软件的全方位支持,帮助客户快速实现机器人的部署与应用,提升生产效率和智能化水平。 PNP机器人和思灵机器人以及旗下Franka机器人等深度合作,聚焦面向生活和工业场景的单臂/双臂数据采集场景,致力于机器人即插即用(Plug & Play  )技术和具身智能通用解决方案。                

通过PNP机器人平台,您可以轻松购买各种机器人相关产品,省心省事省力。我们专注于为用户提供专业、便捷且经济实惠的机器人系统及定制服务,帮助您实现更多可能。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值