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

New phase for handling user updates of world state #1815

Open
arjo129 opened this issue Nov 28, 2022 · 1 comment
Open

New phase for handling user updates of world state #1815

arjo129 opened this issue Nov 28, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@arjo129
Copy link
Contributor

arjo129 commented Nov 28, 2022

Desired behavior

Currently gazebo has three states when running simulations. PreUpdate, Update and PostUpdate. In #1808, I ran into an issue where plugins have to calculate forces to be applied in the PreUpdate step and the user command system also spawns new vehicles in the PreUpdate phase. This leads to incorrect behavior sometimes as the order in which plugins in the same phase are run is not guaranteed. My current fix involves changing the logic of the plugin to make sure we minimize the effect of unexplained behavior. This however requires that System developers have deep understanding of gazebo. What I would like to propose is to have a UserEdit phase where users can interact with the world prior to having PreUpdate run. This way systems which modify the state of the world don't clash with systems which apply physical forces and new entities will always have forces applied to them before the first physical step takes place. So UserCommandSystem would always spawn objects during the UserEdit phase.

Alternatives considered

  • Keeping the status quo: The problem is we cannot guarantee physics behavior of items which have been moved by the user.
  • Have a way of specifying the exact or partial order in which each plugin should run thus improving determinism: The cons of this are it would require specialist knowledge of Gazebo and leaves correctness to the end user. It would also likely be harder to implement although it would greatly improve the debugging experience. This option is not mutually exclusive with the proposed approach of a UserEdit phase.
@scpeters
Copy link
Member

scpeters commented May 3, 2024

This leads to incorrect behavior sometimes as the order in which plugins in the same phase are run is not guaranteed.

There is a prototype in #2394 for controlling order of execution for system callbacks. It could be possible to address this by thoughtful adjustment of the system priority values

@arjo129 arjo129 linked a pull request May 8, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

2 participants