UniversalRobots / Universal_Robots_ROS2_Gazebo_Simulation

BSD 3-Clause "New" or "Revised" License
69 stars 29 forks source link

Gazebo simulation is not working under ros2 humble. #23

Closed bi3ri closed 11 months ago

bi3ri commented 1 year ago

Hey,

is there any plan or work been done to support ros2 humble in the future?

Thanks! Johannes

Icon45 commented 1 year ago

Hi,

i'm also interested in a support for humble. Would be great if it could be added in the future.

Thanks! Icon

Icon45 commented 1 year ago

Hi @bi3ri ,

i figured out how to get it to work in ros2 humble. If you describe what your issue with running this repo is, maybe i can help to fix it

bi3ri commented 1 year ago

Hey @Icon45, thanks! I think the easiest way is to create a pull request with your changes and link it here

Icon45 commented 1 year ago

Hi @bi3ri

I didn't change any code. I got it to work with the following steps:

  1. I cloned the repo into the src-Directory of my ros2 workspace.
  2. after that I built it using the ˋcolcon buildˋ-command and sourced the workspace using the ˋsource install/setup.bash'-command.
  3. Then I typed the following to start the package: ros2 launch ur_simulation_gazebo ur_sim_controll.launch.py ur_type:=ur10

I used it to simulate a ur10. If you want to simulate a different Robot you can put a different name in the argument. Valid inputs are mentioned in a comment in the launchfile.

This worked for me using my humble installation of Ros2. RVis and Gazebo opened and I was shown the Robot. Unfortunately I encountered similar problems as described in issue #19 with the breaking joints.

Hope this helps. If not let me know.

danzimmerman commented 1 year ago

This package just isn't released at all yet, but I've also found that it works fine on Humble when built from source except for the breaking joints problem.

The issue in #19 with breaking joints in Gazebo Classic needs modifications to https://github.com/UniversalRobots/Universal_Robots_ROS2_Description so that the URDF joint dynamics friction values can be set. I opened https://github.com/UniversalRobots/Universal_Robots_ROS2_Description/pull/56 to allow external packages to set these values, and #24 here to launch a Gazebo simulation with joint friction values computed from other robot parameters.

An alternative would be to set the Open Dynamics Engine fmax parameter in some other way. There's a lot of detail in #19 about what's going on there.

Icon45 commented 1 year ago

Hi @danzimmerman,

i'm currently using your versions of this Repo and the Description-Repo. You've posted them recently in https://github.com/UniversalRobots/Universal_Robots_ROS2_Description/issues/53.

But in your versions Rviz doesn't load the Robot. (Don't know if you know about this issue.) Otherwise your versions are working fine on humble. If the Rviz stuff is fixed your modifications to the friction should enable a decent simulation in Rviz and Gazebo on humble.

danzimmerman commented 1 year ago

@Icon45 Thanks for the bug report! Will take a look tonight.

LaurenceLamarche commented 1 year ago

@Icon45 Is it possible to know what version of Gazebo you have installed? I get an error message when reproducing your steps: [ERROR] [launch]: Caught exception in launch (see debug for traceback): "package 'gazebo_ros' not found

Icon45 commented 1 year ago

Hi @LaurenceLamarche,

i have gazebo11 installed. The error you get might be because you are missing the Gazebo-Ros2-Packages. Have you installed them using sudo apt install ros-humble-gazebo-ros-pkgs ? You can check that by running the command:apt list --installed. If you haven't installed them you can do so by running sudo apt install ros-humble-gazebo-ros-pkgs.

If the error persists let me know.

edtriccorp commented 1 year ago

Hi @bi3ri

I didn't change any code. I got it to work with the following steps:

  1. I cloned the repo into the src-Directory of my ros2 workspace.
  2. after that I built it using the ˋcolcon buildˋ-command and sourced the workspace using the ˋsource install/setup.bash'-command.
  3. Then I typed the following to start the package: ros2 launch ur_simulation_gazebo ur_sim_controll.launch.py ur_type:=ur10

I used it to simulate a ur10. If you want to simulate a different Robot you can put a different name in the argument. Valid inputs are mentioned in a comment in the launchfile.

This worked for me using my humble installation of Ros2. RVis and Gazebo opened and I was shown the Robot. Unfortunately I encountered similar problems as described in issue #19 with the breaking joints.

Hope this helps. If not let me know.

Hello,

I am new to ROS/ROS2 and Universal Robotics. We have a UR10e. I am aiming to use ROS2, Gazebo, and Polyscope 6 Beta (we are a beta tester) for modeling and simulation of the UR10e.

I am sure much of what I am encountering is on me but I am unable to get this to work. I have ROS humble and ROS rolling installed on Ubuntu 22.04 with RT_PREEMPT enabled.

When running through the README instructions I get the following when referencing "Universal_Robots_ROS2_Gazebo_Simulation.rolling.repos" :

~/rosworkspaces/ur_gazebo_ros2_ws$ rosdep install --ignore-src --from-paths src -y -r

'ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies: ur_msgs: Cannot locate rosdep definition for [message_generation] moveit_core: Cannot locate rosdep definition for [orocos_kdl] moveit_kinematics: Cannot locate rosdep definition for [orocos_kdl] Continuing to install resolvable dependencies... executing command [sudo -H apt-get install -y docker.io] Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: containerd.io : Conflicts: containerd Conflicts: runc E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. executing command [sudo -H apt-get install -y ros-humble-warehouse-ros-mongo] Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package ros-humble-warehouse-ros-mongo ERROR: the following rosdeps failed to install apt: command [sudo -H apt-get install -y docker.io] failed apt: command [sudo -H apt-get install -y ros-humble-warehouse-ros-mongo] failed apt: Failed to detect successful installation of [docker.io] apt: Failed to detect successful installation of [ros-humble-warehouse-ros-mongo]'

I know I have Docker installed correctly as that is what I have been using to work with Polyscope.

Icon45 commented 1 year ago

Hi @edtriccorp

as im also quite new to UR-Simulation i'm afraid i cannot really help you. I just barely got the normal gazebo simulation working under humble. I don't really know if there could be issues with using Polyscope or having two versions of ros installed.

danzimmerman commented 1 year ago

When running through the README instructions I get the following when referencing "Universal_Robots_ROS2_Gazebo_Simulation.rolling.repos"

I'd skip using vcs to import source dependencies from the .repos files. They haven't been updated in over a year, and predate the Humble release (i.e. Rolling was "slightly pre-Humble").

The Rolling .repos file in particular refers to a couple of @destogl's repos (Moveit2 and ur_msgs forks) and points to non-existent branches in both. I tried using vcs to import the Rolling .repos file, and since the repositories exist but the relevant branches are missing, the repos are cloned with their default branches.

The fork of Moveit 2 is not up-to-date with Picknik's repo, and so refers to an outdated orocos_kdl (these days it's orocos_kdl_vendor). Also, there's no ros2 branch of ur_msgs today, so it gets cloned on the melodic-devel branch and tries to find the ROS 1 package message_generation.

Try making a workspace just cloning this repository and use rosdep to install dependencies, skipping the vcs import of the .repos files. If you can't find anything then, go find and clone any needed source repos one-by-one.

I can't check my ROS computer right now to see what I have installed from source in my Rolling installation, but I think most of the dependencies here can be satisfied with released binaries. I know on Humble I needed to clone and build gazebo_ros2_control and get a subtle runtime error if I don't, but I think on Rolling that has a binary release.

edtriccorp commented 1 year ago

Hi,

Thank you @Icon45. @danzimmerman your inputs definitely got me further along thanks much!

Would you happen to know the significance of the colcon flags --mixin rel-with-deb-info compile-commands ccache as provided in the instructions/README? I get the error "colcon: error: unrecognized arguments: --mixin rel-with-deb-info compile-commands ccache" ?

danzimmerman commented 1 year ago

I don't know much about the mixins but it seems they're shortcuts to longer command specifications (possibly considered easy to remember? Less exposure to raw CMake?)

For example, for --mixin rel-with-deb-info:

https://github.com/colcon/colcon-mixin-repository/blob/master/build-type.mixin#L9

Release with debug info compiles with compiler optimizations turned on (similar to Release mode) but retains debug symbols so that your debugger can give more information if something crashes.

I usually use --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo at the command line to achieve this.

You can look up the others here if you want to map them to CMake commands.

colcon-mixin is its own package, is it possible you don't have it installed? See, for example: https://moveit.picknik.ai/humble/doc/tutorials/getting_started/getting_started.html#install-ros-2-and-colcon

I don't use it so far and haven't used the ccache or compile-commands equivalents. Not sure of their significance here.

danzimmerman commented 1 year ago

The joint-breaking issue in #19 is solved for me with the update to gazebo_ros2_control that came in here https://github.com/ros-controls/gazebo_ros2_control/pull/213

fmauch commented 11 months ago

Closing this, since I gave everything a rehault and except for #34 things seem to be fine.