新闻资讯

联系我们 Contact Us

电话:010-82488500

传真:010-82488501

E-mail:znj@bjrobot.com

您现在的位置:主页 > 新闻资讯 >

ALOHA ( Viper 300 Widow X 250 6DOF软件安装)第二部分

作者: bjrobot 时间:2023-05-15 来源:未知
摘要:ALOHA: A Low-cost Open-source Hardware System for Bimanual Teleoperation ALOHA:一种用于双手远程操作的低成本开源硬件系统 This codebase contains implementation for teleoperation and data collection with the ALOHA hardwar

ALOHA: A Low-cost Open-source Hardware System for Bimanual Teleoperation

ALOHA:一种用于双手远程操作的低成本开源硬件系统

 

This codebase contains implementation for teleoperation and data collection with the ALOHA hardware. To train imitation learning algorithms, you would also need to install ACT .

该代码库包含使用ALOHA硬件进行远程操作和数据收集的实现。要训练模仿学习算法,您还需要安装ACT。

 

Repo Structure

回购结构

  • config: a config for each robot, designating the port they should bind to, more details in quick start guide.
  • launch: a ROS launch file for all 4 cameras and all 4 robots.
  • aloha_scripts: python code for teleop and data collection

 

Quick start guide

快速入门指南

 

Hardware selection

硬件选择

 

We suggest using a "heavy-duty" computer if possible.

如果可能的话,我们建议使用“重型”计算机。

In particular, at least 4 USB3 ports are needed. We have seen in one case that a machine was not able to stably connect to all 4 robot arms simultaneously over USB.

特别是,至少需要4个USB3端口。我们在一个案例中看到,一台机器无法通过USB同时稳定地连接到所有4个机械臂。

Software selection -- OS:

软件选择——操作系统:

 

Currently tested and working configurations:

当前测试和工作配置:

Ubuntu 18.04 + ROS 1 noetic

Ubuntu 20.04 + ROS 1 noetic

Ongoing testing (compatibility effort underway):

正在进行的测试(正在进行兼容性工作):

ROS 2

 

Software installation - ROS:

软件安装-ROS:

  1. Install ROS and interbotix software following https://docs.trossenrobotics.com/interbotix_xsarms_docs/
  2. This will create the directory ~/interbotix_wswhich contains src.
  3. git clone this repo inside~/interbotix_ws/src
  4. source /opt/ros/noetic/setup.sh && source ~/interbotix_ws/devel/setup.sh
  5. sudo apt-get install ros-noetic-usb-cam && sudo apt-get install ros-noetic-cv-bridge
  6. run catkin_makeinside ~/interbotix_ws, make sure the build is successful
  7. go to ~/interbotix_ws/src/interbotix_ros_toolboxes/interbotix_xs_toolbox/interbotix_xs_modules/src/interbotix_xs_modules/arm.py, find function publish_positions. Change self.T_sb = mr.FKinSpace(self.robot_des.M, self.robot_des.Slist, self.joint_commands)to self.T_sb = None. This prevents the code from calculating FK at every step which delays teleoperation.

Hardware installation:

硬件安装:

 

The goal of this section is to run roslaunch aloha 4arms_teleop.launch, which starts communication with 4 robots and 4 cameras. It should work after finishing the following steps:

Step 1: Connect 4 robots to the computer via USB, and power on. Do not use extension cable or usb hub.

  • To check if the robot is connected, install dynamixel wizard here
  • Dynamixel wizard is a very helpful debugging tool that connects to individual motors of the robot. It allows things such as rebooting the motor (very useful!), torque on/off, and sending commands. However, it has no knowledge about the kinematics of the robot, so be careful about collisions. The robot will collapse if motors are torque off ie there is no automatically engaged brakes in joints.
  • Open Dynamixel wizard, go into optionsand select:
    • Protocal 2.0
    • All ports
    • 1000000 bps
    • ID range from 0-10
  • Note: repeat above everytime before you scan.
  • Then hit Scan. There should be 4 devices showing up, each with 9 motors.
  • One issue that arises is the port each robot binds to can change over time, eg a robot that is initially ttyUSB0might suddenly become ttyUSB5. To resolve this, we bind each robot to a fixed symlink port with the following mapping:
    • ttyDXL_master_right: right master robot (master: the robot that the operator would be holding)
    • ttyDXL_puppet_right: right puppet robot (puppet: the robot that performs the task)
    • ttyDXL_master_left: left master robot
    • ttyDXL_puppet_left: left puppet robot
  • Take ttyDXL_master_right: right master robot as an example:
  1. Find the port that the right master robot is currently binding to, egttyUSB0
  2. run udevadm info --name=/dev/ttyUSB0 --attribute-walk | grep serialto obtain the serial number. Use the first one that shows up, the format should look similar to FT6S4DSP.
  3. sudo vim /etc/udev/rules.d/99-fixed-interbotix-udev.rulesand add the following line:

SUBSYSTEM=="tty", ATTRS{serial}=="<serial number here>", ENV{ID_MM_DEVICE_IGNORE}="1", ATTR{device/latency_timer}="1", SYMLINK+="ttyDXL_master_right"

  1. This will make sure the right master robot is always binding tottyDXL_master_right
  2. Repeat with the rest of 3 arms.
  • To apply the changes, runsudo udevadm control --reload && sudo udevadm trigger
  • If successful, you should be able to find ttyDXL*in your/dev

Step 2: Set max current for gripper motors

  • Open Dynamixel Wizard, and select the wrist motor for puppet arms. The name of it should be[ID:009] XM430-W350
  • Tip: the LED on the base of robot will flash when it is talking to Dynamixel Wizard. This will help determine which robot is selected.
  • Find 38 Current Limit, enter 500, then hit saveat the bottom.
  • Repeat this for both puppet robots.
  • This limits the max current through gripper motors, to prevent overloading errors.

Step 3: Setup 4 cameras

  • You may use usb hub here, but maximum 2 cameras per hub for reasonable latency.
  • To make sure all 4 cameras are binding to a consistent port, similar steps are needed.
  • Cameras are by default binding to /dev/video{0, 1, 2...}, while we want to have symlinks{CAM_RIGHT_WRIST, CAM_LEFT_WRIST, CAM_LOW, CAM_HIGH}
  • Take CAM_RIGHT_WRISTas an example, and let's say it is now binding to /dev/video0. run udevadm info --name=/dev/video0 --attribute-walk | grep serialto obtain it's serial. Use the first one that shows up, the format should look similar to 0E1A2B2F.
  • Then sudo vim /etc/udev/rules.d/99-fixed-interbotix-udev.rulesand add the following line

SUBSYSTEM=="video4linux", ATTRS{serial}=="<serial number here>", ATTR{index}=="0", ATTRS{idProduct}=="085c", ATTR{device/latency_timer}="1", SYMLINK+="CAM_RIGHT_WRIST"

  • Repeat this for {CAM_LEFT_WRIST, CAM_LOW, CAM_HIGH}in additional toCAM_RIGHT_WRIST
  • To apply the changes, runsudo udevadm control --reload && sudo udevadm trigger
  • If successful, you should be able to find {CAM_RIGHT_WRIST, CAM_LEFT_WRIST, CAM_LOW, CAM_HIGH}in your/dev

At this point, have a new terminal

conda deactivate # if conda shows up by default

source /opt/ros/noetic/setup.sh && source ~/interbotix_ws/devel/setup.sh

roslaunch aloha 4arms_teleop.launch

If no error message is showing up, the computer should be successfully connected to all 4 cameras and all 4 robots.

 

 

Trouble shooting

故障排除

 

Make sure Dynamixel Wizard is disconnected, and no app is using webcam's stream. It will prevent ROS from connecting to these devices.

请确保Dynamixel向导已断开连接,并且没有任何应用程序正在使用网络摄像头的流。它将阻止ROS连接到这些设备。

 

 

Software installation - Conda:

软件安装-康达:

 

conda create -n aloha python=3.8

conda activate aloha

pip install torchvision

pip install torch

pip install pyquaternion

pip install pyyaml

pip install rospkg

pip install pexpect

pip install mujoco

pip install dm_control

pip install opencv-python

pip install matplotlib

pip install einops

pip install packaging

pip install h5py

pip install h5py_cache

 

Testing teleoperation

测试远程操作

 

Notice : Before running the commands below, be sure to place all 4 robots in their sleep positions, and open master robot's gripper. All robots will rise to a height that is easy for teleoperation.

注意:在运行以下命令之前,请确保将所有4个机器人置于睡眠位置,并打开主机器人的夹具。所有的机器人都将上升到一个便于远程操作的高度。

 

# ROS terminal

conda deactivate

source /opt/ros/noetic/setup.sh && source ~/interbotix_ws/devel/setup.sh

roslaunch aloha 4arms_teleop.launch

 

# Right hand terminal

conda activate aloha

cd ~/interbotix_ws/src/aloha/aloha_scripts

python3 one_side_teleop.py right

 

# Left hand terminal

conda activate aloha

cd ~/interbotix_ws/src/aloha/aloha_scripts

python3 one_side_teleop.py left

 

The teleoperation will start when the master side gripper is closed.

当主侧夹持器关闭时,远程操作将开始。

 

 

Example Usages

示例用法

 

To set up a new terminal, run:

要设置新终端,请运行:

 

conda activate aloha

cd ~/interbotix_ws/src/aloha/aloha_scripts

 

 

The one_side_teleop.pywe ran is for testing teleoperation and has no data collection. To collect data for an episode, run:

我们运行的one_side_teleop.pywe用于测试远程操作,没有数据收集。要收集某一事件的数据,请运行:

 

python3 record_episodes.py --dataset_dir <data save dir> --episode_idx 0

 

 

This will store a hdf5 file at <data save dir>. To change episode length and other params, edit constants.pydirectly.

这将在<data save dir>中存储一个hdf5文件。要更改剧集长度和其他参数,请直接编辑constants.py

 

To visualize the episode collected, run:

要可视化收集的剧集,请运行:

 

python3 visualize_episodes.py --dataset_dir <data save dir> --episode_idx 0

 

 

To replay the episode collected with real robot, run:

要回放使用真实机器人收集的剧集,请运行:

 

python3 replay_episodes.py --dataset_dir <data save dir> --episode_idx 0

 

To lower 4 robots before eg cutting off power, run:

要在切断电源之前降低4个机器人,请运行:

 

python3 sleep.py

 

待续

 

智能佳机器人

400 099 1872

www.bjrobot.com

 

购买链接:智能佳(ZNJ) ViperX 300 6DOF自由度机械臂 Dynamixel X系列伺服舵机 ViperX 300 6DOF【图片 价格 品牌 报价】-京东 (jd.com)

智能佳(ZNJ) WidowX 250 机械臂 6DOF自由度 更高扭矩 智能机械手 6DOF【图片 价格 品牌 报价】-京东 (jd.com)

电话邮箱

电话:010-82488500
传真:010-82488501
E-mail: znj@bjrobot.com

网站首页 产品中心 解决方案 联系我们

Copyright © 2006-2023 bjrobot 智能佳科技 京ICP备13001844号

在线客服

点击这里给我发消息 点击这里给我发消息 点击这里给我发消息