UniversalRobots / Universal_Robots_ROS2_Gazebo_Simulation

BSD 3-Clause "New" or "Revised" License
63 stars 27 forks source link

can not build on ros2 humble #58

Closed T-BonesLek closed 6 months ago

T-BonesLek commented 6 months ago

Summary: 74 packages finished [31.6s] 6 packages had stderr output: controller_manager moveit_configs_utils ros2_controllers_test_nodes ros2controlcli rqt_controller_manager rqt_joint_trajectory_controller

ex: stderr: ros2controlcli
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.

T-BonesLek commented 6 months ago

ros2 launch ur_simulation_gazebo ur_sim_moveit.launch.py

[INFO] [launch]: Default logging verbosity is set to INFO [ERROR] [launch]: Caught exception in launch (see debug for traceback): executed command failed. Command: /opt/ros/humble/bin/xacro /home/devtex/workspaces/ur_gazebo/install/ur_simulation_gazebo/share/ur_simulation_gazebo/urdf/ur_gazebo.urdf.xacro safety_limits:=true safety_pos_margin:=0.15 safety_k_position:=20 name:=ur ur_type:=ur5e prefix:="" simulation_controllers:=/home/devtex/workspaces/ur_gazebo/install/ur_simulation_gazebo/share/ur_simulation_gazebo/config/ur_controllers.yaml Captured stderr output: error: No such file or directory: /home/devtex/workspaces/ur_gazebo/install/ur_description/share/ur_description/urdf/inc/ur_joint_control.xacro [Errno 2] No such file or directory: '/home/devtex/workspaces/ur_gazebo/install/ur_description/share/ur_description/urdf/inc/ur_joint_control.xacro' when processing file: /home/devtex/workspaces/ur_gazebo/install/ur_simulation_gazebo/share/ur_simulation_gazebo/urdf/ur_gazebo.ros2_control.xacro included from: /home/devtex/workspaces/ur_gazebo/install/ur_simulation_gazebo/share/ur_simulation_gazebo/urdf/ur_gazebo.urdf.xacro

liamcarlos commented 6 months ago

Hey @T-BonesLek, I had problems building on humble too. Here's what they left out of the documentation that makes it impossible to build in humble if you're just following the documentation:

First of all, the ros2 branch is just the ros2 rolling branch.. there are separate branches for iron and humble. So for humble you would git clone with this command in your src folder:

git clone git@github.com:UniversalRobots/Universal_Robots_ROS2_Gazebo_Simulation.git -b humble

Secondly, the repos file for each individual ros2 branch i.e. Universal_Robots_ROS2_Gazebo_Simulation.<ros-distro>.repos downloads repositories from source which is unnecessary. There should only be one folder in your src folder and that is ur_simulation_gazebo. The rest can be downloaded with apt so if you didn't have them already (you probably have a few) that command would be:

sudo apt install ros-humble-ur* ros-humble-gazebo-ros2-control ros-humble-moveit* ros-humble-ros2-control ros-humble-ros2-controllers

The asterisk next to packages means download every package that begins with that name just so you don't miss any. That command replaces the vcs whatever and rosdep blah blah blah commands because they would just use the original repo file, Universal_Robots_ROS2_Gazebo_Simulation.humble.repos, so that they don't get downloaded into your src folder and built with colcon.

Lastly, they say to use colcon build --symlink-install --mixin rel-with-deb-info compile-commands ccache to build, but I'm pretty sure you don't need all those extra arguments on there.. I would try just building with a plain old colcon build but if you want the whole enchilada, here's how you add all that on there (assuming you have colcon from sudo apt install ros-dev-tools):

  1. Download mixin with sudo apt install python3-colcon-mixin
  2. Register the repository with colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
  3. Fetch the latest from said repo with colcon mixin update default
  4. Install ccache with sudo apt install ccache
  5. Update symlinks with sudo /usr/sbin/update-ccache-symlinks
  6. Prepend ccache into $PATH with echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
  7. Source bashrc to run a lil test to make sure everything went okay with source ~/.bashrc && echo $PATH

The output should have "/usr/lib/ccache..." at the front of it, and you should be set to go! Probably went into more detail than I had to, but all that detail was lacking in the documentation soooo it is what it is. Let me know how that goes if you're still trying to build with humble.

T-BonesLek commented 6 months ago

It's functioning flawlessly following your instructions! I'm hopeful that extending it for my project will be straightforward. Your assistance is greatly valued @liamcarlos !

liamcarlos commented 6 months ago

@T-BonesLek Awesome! Glad I helped!