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

Ignition GUI plugin to toggle floor visibility. #72

Merged

Conversation

chianfern
Copy link
Contributor

@chianfern chianfern commented Mar 10, 2022

Signed-off-by: Tan Chian Fern chianfern@openrobotics.org

toggle_floors plugin

Adds a ignition::gui::Plugin to toggle visibility of floors and robots.
Requires rmf_traffic_editor #424. Closes #66.

Note: There's an unresolved issue with LoadConfig(). It reads the information in the world sdf correctly on first load, but not when the plugin is closed and reloaded.
Update: Resolved, plugin information is retrieved again when reloaded.

Signed-off-by: Tan Chian Fern <chianfern@openrobotics.org>
@codebot
Copy link
Contributor

codebot commented Mar 12, 2022

Tested on hotel demo and works as expected 👍

@luca-della-vedova luca-della-vedova marked this pull request as ready for review March 18, 2022 09:02
Signed-off-by: Tan Chian Fern <chianfern@openrobotics.org>
Signed-off-by: Tan Chian Fern <chianfern@openrobotics.org>
@luca-della-vedova
Copy link
Member

Thanks for the PR! Looking great so far.

I only encountered one edge case that happens when the plugin is used to toggle a floor, then closed and reopened, from what I see:

  • When plugin is closed, nothing changes (OK)
  • When it is reopened, it defaults to all floors selected (acceptable) but only the robots reappear in the floor that was previously deselected (not quite right).

I can see how this could be a tricky issue since you would need to preserve state across plugin object creation / destruction, I guess some solutions could be:

  • Reset to everything visible when closing the plugin
  • For finding a way to save the state and make sure that the plugin, when reloaded, defaults to the same floors being toggled
  • Making sure that when reopening, and having everything set as visible, it iterates through the models and sets them as visible.

I'm OK with anything really, as long as there is consistent behavior between what is set in the plugin and what is visible

Signed-off-by: Tan Chian Fern <chianfern@openrobotics.org>
@chianfern
Copy link
Contributor Author

  • Making sure that when reopening, and having everything set as visible, it iterates through the models and sets them as visible.

Thanks for the catch! Fixed.

Copy link
Member

@luca-della-vedova luca-della-vedova left a comment

Choose a reason for hiding this comment

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

Awesome thanks!

@luca-della-vedova luca-della-vedova merged commit e0ee7e6 into open-rmf:main Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toggle floor in ignition sim
3 participants