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

Adds the ability to set the update rate of the simulation #264

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

arjo129
Copy link
Member

@arjo129 arjo129 commented Oct 8, 2024

New feature implementation

Implemented feature

This commit adds the ability to set the update rate of simulation to be faster than real time via the update_rate option.

For instance if you want a 5x real time factor simulation running via CLI simply add the flags:

ros2 launch rmf_demos_gz office.launch.xml update_rate:=500

Note by default this sets gazebo's internal step size. Usually we have 100 steps per second of simulation, hence if we want 5x RTF we need to set update_rate:=500. Also note there is a bug in gazebo which also results in the ecm inspector showing the wrong "RTF" if I use the -z flag.

This commit adds the ability to set the update rate of simulation to be
faster than real time via the `update_rate` option.

For instance if you want a 5x real time factor simulation running via
CLI simply add the flags:

```
ros2 launch rmf_demos_gz office.launch.xml update_rate:=5000
```
Note by default this sets gazebo's internal step size. Usually we have
1000 steps per second of simulation, hence if we want 5x RTF we need to
set update_rate:=5000.

Signed-off-by: Arjo Chakravarty <arjoc@google.com>
Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

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

imo update_rate sounds very ambiguous since it's not clear what this is referring to along with the units. There is room to think it updates the rate of the fleet adapter updates for example. How about sim_update_rate?

@luca-della-vedova
Copy link
Member

The default step size for rmf simulations is 0.01 though, not 0.001, does the command line argument also set the step size to 0.001 behind the scenes or would this make the simulation run at 10x RTF by default?

Signed-off-by: Arjo Chakravarty <arjoc@google.com>
@arjo129
Copy link
Member Author

arjo129 commented Oct 10, 2024

The default step size for rmf simulations is 0.01 though, not 0.001, does the command line argument also set the step size to 0.001 behind the scenes or would this make the simulation run at 10x RTF by default?

You are right this is my mistake, I've changed the defaults.

@arjo129 arjo129 requested a review from Yadunund October 10, 2024 02:53
@arjo129 arjo129 enabled auto-merge (squash) October 10, 2024 07:36
@arjo129 arjo129 merged commit 7229891 into main Oct 11, 2024
3 checks passed
@arjo129 arjo129 deleted the arjo/feat/set_update_rate_via_cli branch October 11, 2024 18:16
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.

3 participants