Use ROS2 and Gazebo to simulate 2 UR5 assembling objects.
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 git@github.com: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
use_sim_time=true
,而且目前来看最好在launch文件里面来设置