# How to get real-time SITL in gazebo with multi-vehicle?

**URL:** <https://discuss.px4.io/t/how-to-get-real-time-sitl-in-gazebo-with-multi-vehicle/6240>\
**Category:** Uncategorized\
**Created:** [April 1, 2018, 8:46am UTC](https://discuss.px4.io/t/how-to-get-real-time-sitl-in-gazebo-with-multi-vehicle/6240 "2018-04-01T08:46:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mzahana](https://discuss.px4.io/user_avatar/discuss.px4.io/mzahana/32/3790_2.png) [@Mzahana](https://discuss.px4.io/u/Mzahana)\
**Post date:** [April 1, 2018, 8:46am UTC](https://discuss.px4.io/t/how-to-get-real-time-sitl-in-gazebo-with-multi-vehicle/6240/1 "2018-04-01T08:46:22Z")

</div>

Hi.

I am doing multi-vehicle simulation in Gazebo. All works fine except that the ‘Real Time Factor’ in Gazebo is less than one, and it decreases when I add more vehicles. The following picture shows a simulation snapshot of 6 drones (I want to add more!). I am using `mavros` to interface to `PX4`.

 ![](https://discuss.px4.io/uploads/default/original/2X/6/69f758818d15ee3f448b7f1ca9d52bb8ffbb32c2.png)

**Here are the issues**

- As you can see, the real time factor is less than 1
- in the terminal where I run the SITLs of all vehicles, I get a flood of `ERROR [mavlink] [timesync] Hard setting offset.`

I guess I have a good machine with 56 cores and 126G RAM.

Here is the sys monitor during the simulation:

 ![](https://discuss.px4.io/uploads/default/original/2X/0/037fc9aab48687c2db768a8de830971bcd0fb301.png)

**Question 1** Are these error message fine to ignore, or they indicate serious issues?  
**Question 2** How can I keep the real-time factor in Gazebo at **1** , if the machine specs are sufficient?

**More info**

- using Ubuntu 16 with ROS Kinetic
- using `master` branch of PX4 at commit `78a9658`; not latest!

Thanks.

---

<div class="post-metadata">

**Author:** ![urock](https://discuss.px4.io/letter_avatar_proxy/v4/letter/u/91b2a8/32.png) [@urock](https://discuss.px4.io/u/urock)\
**Post date:** [April 2, 2018, 5:01pm UTC](https://discuss.px4.io/t/how-to-get-real-time-sitl-in-gazebo-with-multi-vehicle/6240/2 "2018-04-02T17:01:22Z")

</div>

Hi,  
I would recommend to run px4 sitl process on dedicated CPU core. And also forbid OS to run other process on this core. I think you will have to modify ros launch files to have one command launch only px4 node. I don’t have full instructions but maybe this link would help

> <https://stackoverflow.com/questions/13583146/whole-one-core-dedicated-to-single-process>

Also you may want to turn off Gazebo GUI, which is as simple as setting gui = false parameter in ros launch file.
