UniversalRobots / Universal_Robots_ROS2_Driver

Universal Robots ROS2 driver supporting CB3 and e-Series
BSD 3-Clause "New" or "Revised" License
435 stars 225 forks source link

Creating a ROS2 package to simulate UR in Gazebo #1085

Closed PeymanAmirii closed 2 months ago

PeymanAmirii commented 3 months ago

Affected ROS2 Driver version(s)

2.4.9

Used ROS distribution.

Humble, Iron

Which combination of platform is the ROS driver running on.

Ubuntu Linux with standard kernel

How is the UR ROS2 Driver installed.

Build the driver from source and using the UR Client Library from binary

Which robot platform is the driver connected to.

Real robot

Robot SW / URSim version(s)

UR5

How is the ROS driver used.

Others

Issue details

I want to simulate a pick and place task by UR5 in Gazebo through developing a ROS2 package. I ran all the following commands in a single new terminal.

  1. At first I installed the potentially needed packages:
sudo apt install ros-iron-ur
sudo apt install gazebo
sudo apt install ros-iron-gazebo-ros
  1. Then, I set up the workspace and subordinary files:
source /opt/ros/iron/setup.bash
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
colcon build --symlink-install
source install/setup.bash
  1. Afterwards, I cloned the driver and description (containing XACRO files) files:
cd ~/ros2_ws/src
git clone -b iron https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver.git
git clone https://github.com/UniversalRobots/Universal_Robots_ROS2_Description.git
  1. Then, I installed dependencies:
cd ~/ros2_ws
rosdep update
rosdep install --from-paths src --ignore-src -r -y
  1. Afterwards, I built the workspcace:
source /opt/ros/iron/setup.bash
source install/setup.bash
colcon build --symlink-install
  1. Then, I created the package:
source /opt/ros/iron/setup.bash
source install/setup.bash
cd ~/ros2_ws/src
ros2 pkg create --build-type ament_python ur5e_gazebo_demo --dependencies rclpy --license Apache-2.0
  1. FInally, I checked whether the package is created or not: ros2 pkg list | grep ur5e_gazebo_demo

However, it printed nothing because it seems that the package is not created. Additionally, I tested the above instructions in ROS2 Iron and Humble (for Humble I replaced every iron word with humble) using setuptools package version 58.2.0 (as mentioned in the clip https://www.youtube.com/watch?v=iBGZ8LEvkCY&t=551s to remove stderr) and the most up-to-date version of 73.0.0.

With setuptools version 73.0.0 in Iron, I get the following error after building the package:

Summary: 0 packages finished [2.45s]
  1 package failed: ur_dashboard_msgs
  1 package aborted: ur_description
  1 package had stderr output: ur_dashboard_msgs
  5 packages not processed

With setuptools version 58.2.0 in Iron, I get the follwoing warning after building the package:

Summary: 7 packages finished [48.4s]
  2 packages had stderr output: ur_calibration ur_robot_driver

With setuptools version 73.0.0 in Humble, I get the following error after building the package:

Summary: 0 packages finished [2.59s]
  1 package failed: ur_dashboard_msgs
  1 package aborted: ur_description
  1 package had stderr output: ur_dashboard_msgs
  6 packages not processed

With setuptools version 58.2.0 in Humble, I get the follwoing warning after building the package:

Summary: 8 packages finished [42.2s]
  2 packages had stderr output: ur_calibration ur_robot_driver

Relevant log output

No response

Accept Public visibility

fmauch commented 2 months ago

Hi, thank you for posting this issue.

To be honest, I don't really see any relation of your problem to this repo, since you seem to face challenges creating your own ros2 package. This is something, we cannot really support here, I'm afraid.

Nevertheless, I'd like to drop some comments regarding what you did:

  1. Regarding gazebo, there is also a gazebo support package for ur. That could serve as a starting point. It basically contains an empty world with a UR controlled in Gazebo. For your application, you will obviously extend the URDF used.
  2. You installed the ur support packages using sudo apt install ros-iron-ur. This is great. I don't see any further requirement to clone and build the driver / description from source.
  3. When reporting build errors, it is highly beneficial to post the actual error output, as otherwise there is no information where to start investigating. However, in your case I would suggest to simply not build packages from source that are already installed from binary packages (as mentioned in the last point).

I hope, this helps clearing things up a bit. If you keep having troubles creating your own packages, I suggest posting a question on robotics.stackexchange.com would be a good starting point. Try to make your package example as minimal as possible.