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 rcS crash caused by floating point arithmetic to enable slower than real-time simulation #12401

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

fabianschilling
Copy link

Fixes issue #12400 where floating point lockstep realtime speed factors such as PX4_SIM_SPEED_FACTOR=0.5 would cause the rcS script to crash. This PR allows floating point (and therefore slower than real-time) lockstep simulation.

Preferred solution: use bc instead of built-in shell math to support both integer and floating point arithmetic.

An extensive list of possible alternative solutions can be found here: https://unix.stackexchange.com/a/40787.

@dagar dagar requested a review from julianoes July 3, 2019 14:34
@julianoes
Copy link
Contributor

I tried to fix this too a couple of days ago and I failed against the shell checker:
a0039b3

It looks like your solution works, thanks a lot!

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.

2 participants