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

Fix gz_bridge gets wrong world name when GZ_VERBOSE=1 #21728

Conversation

TheotimeBalaguer
Copy link
Contributor

Solved Problem

In simulation, with env. var. GZ_VERBOSE=1 and a Gazebo world is already running, GZBridge fails to start because it gets the wrong name for the running world. This is because the grep command used retrieve only the first occurrence of "/world/.*/clock" and thus, it gets Topic: [@/theotime-Precision-5570:theotime@/world/multicopter/clock] instead of the real name of the topic /world/multicopter/clock.

Fixes #{21727}

Solution

  • Grep only the lines that start with /world/.*/clock, which is the case

Changelog Entry

no need

Alternatives

Gazebo's API has a "Name" endpoint for worlds, admittedly it could be cleaner to exploit that. The grep tech could create more issues in the future.

Test coverage

  • tested on my machine. Works with GZ_VERBOSE=0 and 1. The name of world is correctly found.

Context

N/A

@junwoo091400 junwoo091400 changed the title fix issue #21727 Fix gz_bridge gets wrong world name when GZ_VERBOSE=1 Jun 26, 2023
@beniaminopozzan beniaminopozzan linked an issue Jul 21, 2023 that may be closed by this pull request
Copy link
Member

@beniaminopozzan beniaminopozzan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @TheotimeBalaguer !

The grep tech could create more issues in the future.

True! But we can merge this for now!

@beniaminopozzan beniaminopozzan merged commit e195a3c into PX4:main Jul 21, 2023
81 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: gz_bridge gets wrong world name when GZ_VERBOSE=1
3 participants