Resources for setting up a Gazebo simulation of a UR5e on my own system

Hello,

I’ve garnered some knowledge from my Construct courses and my next step is setting up ROS2 on my lab’s own computer. I have ROS2 installed, but now I don’t know what to do in order to get a Gazebo simulation set up for a UR5e. I’m really in need of baby step instructions that are thorough and explain every step. Does anyone have any idea where I can learn the steps for installing and setting up a UR5e in Gazebo? I can’t seem to find anything online, and AI is overly-vague.

Thank you!

Hi @rlgraf ,

Let me get straight to the point:

Install ROS2:

locale  # check for UTF-8
sudo apt update && sudo apt install -y locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
locale  # verify settings
sudo apt install -y software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install -y curl
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update

sudo apt install -y ros-<distro>-desktop
sudo apt install -y ros-dev-tools

Install ROS2 Manipulation:

sudo apt install -y ros-<distro>-moveit
sudo apt install -y ros-<distro>-rmw-cyclonedds-cpp

Install ROS2 Control: [Needed for ROS2 Manipulation]

sudo apt install -y ros-<distro>-ros2-control
sudo apt install -y ros-<distro>-ros2-controllers
sudo apt install -y ros-<distro>-gazebo-ros2-control
sudo apt install -y ros-<distro>-gazebo-ros2-control-demos

Install Gazebo Classic (Not the modern Gazebo Sim version):

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
cat /etc/apt/sources.list.d/gazebo-stable.list
wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt update
sudo apt install -y gazebo11

Install all Universal Robot packages:

sudo apt install -y ros-<distro>-ur-client-library
sudo apt install -y ros-<distro>-ur-controllers
sudo apt install -y ros-<distro>-ur-description
sudo apt install -y ros-<distro>-ur-msgs
sudo apt install -y ros-<distro>-ur-robot-driver

The ros-<distro>-ur-description package contains all robot description files for UR3, UR5, URx…

Replace <distro> in all the lines above with the ROS2 distribution you have installed: foxy, galactic, humble, iron, jazzy, etc.

I hope this helps! Let me know if you need anything else!

Regards,
Girish

When I get down to “sudo apt install -y gazebo11” I am getting the output:

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package gazebo11 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package ‘gazebo11’ has no installation candidate

Do you have an idea of how to remedy this? Thank you for your help so far!

Russell

Hi @rlgraf ,

I believe that gazebo11 has been removed from Ubuntu PPAs.
Gazebo 11 reaches End-of-Life on January 2025, which is this month.
So I was not exactly sure if it was removed (or dereferenced) from downloadable sources.
I thought it would be removed by the end of January 2025, but I guess I was wrong. The Gazebo developers would have removed it already (I am not 100% sure at this point).

There is an issue page on GitHub about this: Gazebo Classic (gazebo11) can't be installed on Ubuntu 22.04 Jammy with ROS2 Humble. · Issue #3357 · gazebosim/gazebo-classic · GitHub

Maybe you can try installing the new Gazebo Sim (based on your Ubuntu distribution) from here: Gazebo Harmonic — Gazebo harmonic documentation
(Harmonic is the current LTS, the previous LTS was Ignition Fortress. Ignition Fortress is quite buggy, so I would not recommend using it. Just switch over to Harmonic.)

You can still download gazebo11 (or Gazebo Classic version) source files and build it on your computer. Here is the link for that: Gazebo : Tutorial : From source (Ubuntu and Mac)

You are in a tricky time period unfortunately. You need to decide one option out of these two:

  1. Start using Gazebo Sim (Harmonic) from the beginning. Instead of starting with Gazebo Classic.
  2. Install Gazebo Classic from source and then switch over to Gazebo Sim eventually.

The migration grace period for switch over from Gazebo Classic to Gazebo Sim is also over, which is evident from you unable to download gazebo11 (Gazebo Classic). I recommend that you install Gazebo Sim and start with that directly rather than try to install Gazebo Classic (which will be a waste of time for you at this point).

Let me / us know if you face any issues when you are installing Gazebo Sim!

Regards,
Girish

I have (I believe) successfully installed, Gazebo Sim, am able to open up a blank simulation environment, and I have installed the Universal Robot packages. Now, what steps do I take to get the UR53 to generate in my Gazebo simulation?

Russell

Hi @rlgraf ,

Good! From this point onward, you will have to configure all your launch files that work with Gazebo Classic version of simulation to work with Gazebo Sim (modern version).

Now the first place to start is to understand how Gazebo Sim works.
There is already a course present in The Construct that gives you an introductory understanding on how to use Gazebo Sim. The course name is Introduction to Gazebo Sim with ROS2.
This step is going to take you a bit of time, few days to a week, based on your speed of understanding things.

These are the steps you will follow:

  1. Convert all your simulation launch files for UR5e to work with Gazebo Sim.
  2. Implement the required ROS-GZ bridge to enable communication between ROS2 topics and Gazebo Sim topics. You need this to control the robot in simulation.
  3. You need to modify the URDF/xacro files of the robot (if not done already) to work with Gazebo Sim.
  4. Do step 3 for the gripper model that you desire to use.

Once you have done all the 4 above steps, you should be able to spawn and control the robot with Gazebo Sim version.

Regards,
Girish

Great! I am about halfway through the course, and will reach back out if I have any more questions about spawning the UR5e once I have finished. Thank you!

Russell

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.