Gazebo | Ignition | Community
Ask Your Question

ros gazebo real time factor [closed]

asked 2017-12-09 22:20:12 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.


I want to use the real time simulate ,I know launch the world with ros by include a world .and I have set the physics as follow (empty_world.launch)

<sdf version="1.5"> <world name="default"> <include> <uri>model://sun</uri>

<!-- A ground plane -->
   ***<physics type='ode'>
  <gravity>0 0 -9.8</gravity>

</world> </sdf>

the question is that when Iaunch the world only ,the real time factor(RTF)can be 1,but when I spawn my own urdf or xacro robot ,the RTF while be changed .

I don't know how to handle it.

I use gazebo 7 ros kinetic the launch file as follow


<arg name="paused" default="true"/> <arg name="use_sim_time" default="false"/> (I try to set true and false didn't work) <arg name="gui" default="true"/> <arg name="headless" default="false"/> <arg name="debug" default="false"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch"> <arg name="debug" value="$(arg debug)"/> <arg name="gui" value="$(arg gui)"/>

<arg name="paused" value="$(arg paused)"/> <arg name="use_sim_time" value="$(arg use_sim_time)"/> <arg name="headless" value="$(arg headless)"/> </include> <node name="tf_footprint_base" pkg="tf" <="" p="">

type="static_transform_publisher" args="0 0 0 0 0 0 base_link base_footprint 40" />

<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-urdf -model test_platform -param robot_description"/> </launch>

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by linus111
close date 2017-12-14 01:33:20.224532

2 Answers

Sort by ยป oldest newest most voted

answered 2017-12-12 09:18:35 -0500

Raskkii gravatar image

Mind you that this snippet:

<physics type='ode'>
  <gravity>0 0 -9.8</gravity>

is also Gazebo's default setting. The reason your RTF still goes below 1 is because your machine cannot handle it. Step size and update rate are pretty set in stone after they've been set. Real time factor however will be lowered if the machine cannot handle computing with the given parameters.

If you'd like achieve a real time factor of 1, you can follow the advice of linus111 and lower max_step_size and/or realt_time_update_rate. Note that this might change how certain elements behave in the Gazebo world as far as physics is conerned.

edit flag offensive delete link more


You meant to say increase max_step_size, didn't you? Otherwise, I would be confused.

lursyy gravatar imagelursyy ( 2019-05-23 05:56:24 -0500 )edit

answered 2017-12-10 20:14:03 -0500

linus111 gravatar image

<max_step_size>0.01</max_step_size> <real_time_factor>1</real_time_factor> <real_time_update_rate>100</real_time_update_rate>


edit flag offensive delete link more

Question Tools



Asked: 2017-12-09 22:20:12 -0500

Seen: 15,595 times

Last updated: Dec 12 '17