Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial launch file fails with missing package spaceros_gz_sim #558

Closed
AndyBlightLeeds opened this issue Jan 8, 2025 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@AndyBlightLeeds
Copy link

Environment

  • OS Version:
    Ubuntu 24.04 LTS
  • Source or binary build:
    Binary: Gazebo Sim, version 8.7.0 (Harmonic LTS)

Description

  • Expected behavior:
    I was working through the tutorial on this page: https://gazebosim.org/docs/harmonic/ros2_launch_gazebo/. When I ran the first Python launch file on this page, I got an error (see below). I expected to be able to start Gazebo and see some sort of working demo.

  • Actual behavior:
    When I ran the launch file, I got the following error:

$ ros2 launch ./gazebo.launch.py 
[INFO] [launch]: All log files can be found below /home/...
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught multiple exceptions when trying to load file of format [py]:
 - PackageNotFoundError: "package 'spaceros_gz_sim' not found, searching: ['/opt/ros/jazzy']"
 - InvalidFrontendLaunchFileError: The launch file may have a syntax error, or its format is unknown

This looks like I need to install another package called spaceros_gz_sim but there is nothing in the documentation that I could find that tells me what to install.

I checked the later versions of the tutorials (Ionic and Jetty) for any fixes but they both reference spaceros_gz_sim which I don't have.

Please provide a simpler launch file that works with no additional packages or add notes on what packages to install to make the launch file work correctly.

Steps to reproduce

  1. Install Gazebo Sim (I used Harmonic with ROS extensions).
  2. Navigate to the page: https://gazebosim.org/docs/harmonic/ros2_launch_gazebo/
  3. Copy and paste the first Python launch file code into a file gazebo.launch.py
  4. Launch the file using ros2 launch ./gazebo.launch.py
  5. The error message is seen.

Output

$ gz sim --version
Gazebo Sim, version 8.7.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.
$ ros2 launch ./gazebo.launch.py 
[INFO] [launch]: All log files can be found below /home/...
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught multiple exceptions when trying to load file of format [py]:
 - PackageNotFoundError: "package 'spaceros_gz_sim' not found, searching: ['/opt/ros/jazzy']"
 - InvalidFrontendLaunchFileError: The launch file may have a syntax error, or its format is unknown
@AndyBlightLeeds AndyBlightLeeds added the bug Something isn't working label Jan 8, 2025
@azeey
Copy link
Contributor

azeey commented Jan 8, 2025

Ah, I don't think we should have a dependency on spaceros_gz_sim in that tutorial. It was added in #482. @david-dorf would you mind updating the tutorial so that it works without a dependency on spaceros_gz_sim?

@AndyBlightLeeds AndyBlightLeeds changed the title Tutorial launch file fails woth missing package spaceros_gz_sim Tutorial launch file fails with missing package spaceros_gz_sim Jan 8, 2025
@AndyBlightLeeds
Copy link
Author

I have just checked the Python server tutorial on the same page and this fails like this:

$ ros2 launch src/gazebo_test/gazebo_server.launch.py 
[INFO] [launch]: All log files can be found below /home/...
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): launch configuration 'world_sdf_file' does not exist

Can this be fixed at the same time or do I need to create another issue?

@azeey
Copy link
Contributor

azeey commented Jan 8, 2025

I have just checked the Python server tutorial on the same page and this fails like this:

That's saying you need to pass the world_sdf_file argument when you run it from the command line.
Something like ros2 launch ros_gz_sim ros_gz_sim.launch.py world_sdf_file:=empty.sdf.
The example invocation is in https://gazebosim.org/docs/harmonic/ros2_launch_gazebo/#launching-with-ros-gz-bridge.

@david-dorf
Copy link
Contributor

Ah, I don't think we should have a dependency on spaceros_gz_sim in that tutorial. It was added in #482. @david-dorf would you mind updating the tutorial so that it works without a dependency on spaceros_gz_sim?

Sure, I'll update it to normal gz today, apologies for that

@david-dorf
Copy link
Contributor

Made a pr for a more generic example, but probably won't run on its own because it requires the user to replace the "example..." parts with their own (such as the world, package, bridged topics, etc.). Maybe there's an existing world that could be used instead though so it runs as a standalone as well?

@AndyBlightLeeds
Copy link
Author

@azeey Thanks for pointing out the way to set the world from the command line.

@david-dorf The pages have been updated already and after a bit of customisation of the example script, I was able to run the Gazebo with a ROS2 topic being published. I used the string empty.sdf for the world value, so this could be used in the example.

Thanks to both of you for your help, especially the speedy responses.

This issue can be closed now.

@azeey azeey closed this as completed Jan 9, 2025
@github-project-automation github-project-automation bot moved this from Inbox to Done in Core development Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants