Unable to run faster than real-time simulation

Hi everyone!
I’m trying to use PX4-autopilot with MAVSDK and Gazebo (without ROS), and multiple aircraft (using the script in /Tools) faster than real-time. According to the doc, I can do so by setting the environment variable PX4_SIM_SPEED_FACTOR at my desired speed factor. But when I launch PX4, I have this error message :

[Err] [gazebo_mavlink_interface.cpp:397] max_step_size of 0.004s does not match real_time_update_rate of 500, aborting.

And then, nothing happens ! I tried to modify the parameters in empty.world file, but it does not work… any idea (or even better, any solution :joy:) ?

Cheers !

@antoinep If you want the real_time_update_rate you desire to use, you need to change your max stepsize

Hi @Jaeyoung-Lim , thank you for your answer ! :grinning:

Unfortunately, when I modify the max_step_size parameter in empty.world accordingly to the simulation rate (0.001 for 4x simulation speed), I have this error.

[Err] [gazebo_mavlink_interface.cpp:397] max_step_size of 0.001s does not match real_time_update_rate of 250, aborting.

Then, if I change real_time_update_rate to 1000 (so 1000 Hertz if I understood correctly), I have now this error a little bit later in the starting procedure :

[Err] [gazebo_mavlink_interface.cpp:397] max_step_size of 0.001s does not match real_time_update_rate of 4000, aborting.

It seems that gazebo_mavlink_interface.cpp runs twice at start, and sometimes all the parameters are taken into account, sometimes not. Do I have to modify this max step_size in another folder or using another command ?

@antoinep Depends on which file you are modifying

Are you sure you are modifying the jinja template for both parameters?

1 Like

@Jaeyoung-Lim Thank you again for your answer !

Until now I have just modified the empty.world file in Tools/sitl_gazebo/worlds . So the problem is likely from here.

I didn’t found information on that in the PX4 documentation, could you please help me to locate the files I have to modify ? I’m using the empty world and two quadcopters, with the script gazebo_sitl_multiple_run.sh