PX4-SITL_gazebo-classic
PX4-SITL_gazebo-classic copied to clipboard
Multiple aircraft behave with PX4_SIM_SPEED_FACTOR
This problem originates from setting global real_time_update_rate without checking if it has been set before.
To fix this, we check if we've done the calculation before, then do the calculation to update, then then check to see if the updated real_time_update_rate is still valid.
To replicate this, clone down the PX4 repo (https://github.com/PX4/PX4-Autopilot), run make px4_sitl gazebo
, then run PX4_SIM_SPEED_FACTOR=4 Tools/gazebo_sitl_multiple_run.sh -n2
Issue here: https://github.com/PX4/PX4-SITL_gazebo/issues/879
I will try out these changes once I get back to my workstation later today.
Something I am concerned about, which I mentioned in one of the review comments, is that the actual speed of the simulator does not seem to be decided by the environment variable, but rather the result the environment variable has on real_time_update_rate
.
Let's consider: real_time_update_rate = 0.250
speed_factor_ = 4
With such, we expect
real_time_update_rate = 1
by the end of the operation. This is what Gazebo calls a 4x sim speed factor.
So, by setting real_time_update_rate = speed_factor_
would technically make it a 16x sim speed factor.
Any insights on this?
Sorry for delay... busy with work.
@SpBills Any updates?
@SpBills Friendly reminder of this open PR. Would you be interested in continuing the PR?
Sorry, I've started school back up and don't have the time to work on this anymore... :(
@SpBills Thanks for the update, in that case I will close the PR until you have time to work on it again