Use ROS2 and Gazebo to simulate 2 UR5 assembling objects.
- Ubuntu 22.04
- ROS2 humble
Before installation, you need some dependencies installed.
Unlike ROS, Gazebo is not installed when you install ROS2. You need to install it manually.
sudo apt update
sudo apt install gazebo
sudo apt install ros-humble-moveit*
sudo apt install ros-humble-ros2-control
sudo apt install ros-humble-ros2-controllers
sudo apt install ros-humble-image-pipeline
sudo apt install ros-humble-compressed-image-transport
sudo apt install ros-humble-compressed-depth-image-transport
sudo apt install ros-humble-vision-msgs
Now clone this repo
cd ~
git clone [email protected]:zitongbai/UR5e_Vision_Assemble.git --recurse-submodules
You can refer to the README.md in the vision package.
You should not only set up the conda environment, but also train the yolov5 and move the weight files for later usage.
Under the original python environment, you should upgrade the numpy version
pip install -U numpy
Build the repo
cd ~/UR5e_Vision_Assemble
colcon build --symlink-install
Start the simulation environment
cd ~/UR5e_Vision_Assemble
source install/setup.bash
ros2 launch bringup simulation.launch.py
Launch the demo
# in another terminal
cd ~/UR5e_Vision_Assemble
source install/setup.bash
ros2 launch ur5e_gripper_control demo4.launch.py
make sure you have all the dependences installed
make sure you have local gazebo model in ~/.gazebo/models
- 调用moveit控制的那个launch文件也需要单独加载kinematics等参数(robot_description之类的倒是不用,好奇怪)
- xml文件的注释中不要含有冒号:
- 记得区分${xxx}和$(arg xxx)
- 仿真需要设置
use_sim_time=true
,而且目前来看最好在launch文件里面来设置 - 因为固定link的tf没有被发布出来导致深度相机返回的数据有问题
- Gazebo grasp plugin for ROS2 gazebo_pkgs
- ros2_robotiq_gripper
- Universal_Robots_ROS2_Description
- Universal_Robots_ROS2_Driver