UR Robot arm + Gazebo Simulation
Hi guys, ROS-newbie here :-)
Specs:
Version of Ubuntu: 20.04 -- ROS2: Galactic -- Kernel version: 5.15.0-76-generic
The code
- I have built the Galactic version of this: https://github.com/UniversalRobots/Un... in a workspace
- I generated a static URDF file using from the
ros2 run xacro xacro --inorder ur.urdf.xacro ur_type:=ur5 > ur5_robot.urdf
. This converted the .urdf.xacro file from Github to a .urdf file that Gazebo can read. (To my understanding, Gazebo needs a static URDF file in order to function properly.) - I will supply the URDF file in the bottom of this post, since it is very long, and I don't want to crowd the post up here :D. - I created a launch file that now calls this URDF file and gazebo_ros:
Which is here:
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory
import os
def generate_launch_description():
urdf = '/home/user/ur_gazebo_ws/src/ur_gazebo/launch/ur5_robot.urdf'
gazebo_ros_pkg_path = get_package_share_directory('gazebo_ros')
return LaunchDescription([
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros_pkg_path, 'launch', 'gazebo.launch.py')
)
),
Node(
package='gazebo_ros',
executable='spawn_entity.py',
arguments=['-entity', 'ur5', '-file', urdf],
output='screen'
),
])
The problem:
I am trying to run Gazebo simulation with a UR robot arm. (I don't care about changing versions of ROS or Ubuntu if that is required. What I care about, is being able to at least use Python3, since another part of my project requires that.)
I can get Gazebo up and running, and it also tells me that the UR5 arm was successfully loaded into the simulation. There are no visible errors in the terminal. Here is the output from the terminal:
INFO] [gzserver-1]: process started with pid [43474]
[INFO] [gzclient -2]: process started with pid [43476]
[INFO] [spawn_entity.py-3]: process started with pid [43479]
[spawn_entity.py-3] [INFO] [1690231181.844320968] [spawn_entity]: Spawn Entity started
[spawn_entity.py-3] [INFO] [1690231181.844773432] [spawn_entity]: Loading entity XML from file /home/user/ur_gazebo_ws/src/ur_gazebo/launch/ur5_robot.urdf
[spawn_entity.py-3] [INFO] [1690231181.845936152] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5
[spawn_entity.py-3] [INFO] [1690231181.846375949] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-3] [INFO] [1690231182.601153155] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-3] [INFO] [1690231182.827232744] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [ur5]
[INFO] [spawn_entity.py-3]: process has finished cleanly [pid 43479]
Here is a screenshot of Gazebo, where you can see that the UR arm in fact is loaded into the simulation:
It seems to me that something is wrong with the .urdf file that Gazebo is using to create the robot, but I know very little about ROS, so I might be wrong.
If you want to take a look, here is the .urdf file, here is a link: https://drive.google.com/file/d/1qbU1...