UniversalRobots / Universal_Robots_ROS2_Gazebo_Simulation

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

Problems with launching Gazebo simulation #49

Closed tera-bytes closed 8 months ago

tera-bytes commented 9 months ago

I'm working with Humble ROS2 and Gazebo 11 and followed all instructions in the README. After running colcon build --symlink-install --mixin rel-with-deb-info compile-commands ccache, I sourced my ros2 set up as well as the workspace setup and ran ros2 launch ur_simulation_gazebo ur_sim_control.launch.py. The build compiles all packages successfully but I do get a message at the end that says 3 packages had stderr output: controller_manager joint_trajectory_controller moveit_setup_srdf_plugins.These packages still finished during the build.

I get this error: ros2 launch ur_simulation_gazebo ur_sim_control.launch.py [INFO] [launch]: All log files can be found below /home/tahira/.ros/log/2023-12-28-22-38-48-759651-tahira-Cyborg-15-A13VE-1196532 [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/tre/ws/gaz/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/tre/ws/gaz/install/ur_simulation_gazebo/share/ur_simulation_gazebo/config/ur_controllers.yaml Captured stderr output: error: No such file or directory: /home/tre/ws/gaz/install/ur_description/share/ur_description/urdf/inc/ur_joint_control.xacro [Errno 2] No such file or directory: '/home/tre/ws/gaz/install/ur_description/share/ur_description/urdf/inc/ur_joint_control.xacro' when processing file: /home/tre/ws/gaz/install/ur_simulation_gazebo/share/ur_simulation_gazebo/urdf/ur_gazebo.ros2_control.xacro included from: /home/tre/ws/gaz/install/ur_simulation_gazebo/share/ur_simulation_gazebo/urdf/ur_gazebo.urdf.xacro . Is there anything wrong with either how I'm sourcing or build steps? When I go into the install folders for ros2 and for the workspace, I can see the ur_simulation_gazebo folder and launch files so they should exist. Any help will be much appreciated as I am new to Linux and ROS2. Thank you!

michalinadengusiak commented 8 months ago

I was encountering a similar problem when working with ROS2 Iron. During the building process I encountered several warnings, however all packages compiled successfully. The problem is that this file doesn't exist in the Universal_Robots_ROS2_Description repo for the Iron or Humble branch (for comparison this is the master branch that is used for the ROS2 Rolling version: Universal_Robots_ROS2_Description).

We are accessing this repo in this step: vcs import src --input src/Universal_Robots_ROS2_Gazebo_Simulation/Universal_Robots_ROS2_Gazebo_Simulation.<ros-distro>.repos

Therefore I just copied the files that aren't present in the Iron/Humble branch: ur_joint_control.xacro and ur_sensors.xacro into where they would have been in my workspace (src\ur_description\urdf\inc).

Then I built the package ur_description again again: colcon build --symlink-install --mixin rel-with-deb-info compile-commands ccache --packages-select ur_description.

I hope this helps!

michalinadengusiak commented 8 months ago

Yep, the same issue appeared on my side. What worked for me, was just adding the variable "force_abs_paths" into the ur_macro.xacro file. Again the same issue: this was present in the ur_macro.xacro file in the master (so for the rolling version) branch, but it was forgotten in the iron/humble branch.

This is how my ur_macro.xacro file looks like after the change: https://github.com/UniversalRobots/Universal_Robots_ROS2_Gazebo_Simulation/assets/37042279/34eb3fe3-b236-4f1b-b2c0-3fe42280e315

Kind regards, Michalina


https://michalinadengusiak.github.io/

On Fri, 12 Jan 2024 at 03:06, Tahira @.**@.>> wrote:

I was encountering a similar problem when working with ROS2 Iron. During the building process I encountered several warnings, however all packages compiled successfully. The problem is that this file doesn't exist in the Universal_Robots_ROS2_Descriptionhttps://github.com/UniversalRobots/Universal_Robots_ROS2_Description/tree/iron repo for the Iron or Humble branch (for comparison this is the master branch that is used for the ROS2 Rolling version: Universal_Robots_ROS2_Descriptionhttps://github.com/UniversalRobots/Universal_Robots_ROS2_Description/tree/master).

Thanks so much! This fixed the previous issue but now when I cd to the workspace, use source install/setup.bash, and run the ros2 launch command, I get this error:

[INFO] [launch]: All log files can be found below /home/tahira/.ros/log/2024-01-11-20-56-23-832400-tahira-Cyborg-15-A13VE-7573 [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/tahira/ws/gaz/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/tahira/ws/gaz/install/ur_simulation_gazebo/share/ur_simulation_gazebo/config/ur_controllers.yaml Captured stderr output: error: Invalid parameter "force_abs_paths" when instantiating macro: ur_robot (/home/tahira/ws/gaz/install/ur_description/share/ur_description/urdf/ur_macro.xacro) in file: /home/tahira/ws/gaz/install/ur_simulation_gazebo/share/ur_simulation_gazebo/urdf/ur_gazebo.urdf.xacro

Is there something wrong with the way I set it up or are there more files missing? I'm not sure how to troubleshoot this since the error is related to something already inside the pre-written xacro file. Any help would be highly appreciated!

— Reply to this email directly, view it on GitHubhttps://github.com/UniversalRobots/Universal_Robots_ROS2_Gazebo_Simulation/issues/49#issuecomment-1888300204, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI2TQZ4DIEL7FW6PXHTOKG3YOCLCLAVCNFSM6AAAAABBF7GUJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBYGMYDAMRQGQ. You are receiving this because you commented.