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

Error in startup script in lockstep simulation with floating point PX4_SIM_SPEED_FACTOR #12400

Closed
fabianschilling opened this issue Jul 3, 2019 · 1 comment

Comments

@fabianschilling
Copy link

Using a floating point PX4_SIM_SPEED_FACTOR as described in the Devguide (https://dev.px4.io/master/en/simulation/#simulation_speed) results in the following error:

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
etc/init.d-posix/rcS: 165: etc/init.d-posix/rcS: Illegal number: 0.5
ERROR [px4] Startup script returned with return value: 512

The error is caused by performing calculations with built-in shell math (which only supports integer arithmetic) in lines 165, 169, and 173 in ROMFS/px4fmu_common/init.d-posix/rcS.

To reproduce, issue: PX4_SIM_SPEED_FACTOR=0.5 make posix gazebo . Setting PX4_SIM_SPEED_FACTOR to integer values results in the expected behavior.

A simple solution would be to use bc for both integer and floating point calculations in the rcS file.

@julianoes
Copy link
Contributor

Thanks for the issue and fix!

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

No branches or pull requests

2 participants