Gazebo | Ignition | Community
Ask Your Question
0

ros gazebo real time factor [closed]

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

this post is marked as community wiki

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

Hi,

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>

</include>
<!-- A ground plane -->
<include>
  <uri>model://ground_plane</uri>
</include>
   ***<physics type='ode'>
  <max_step_size>0.001</max_step_size>
  <real_time_factor>1</real_time_factor>
  <real_time_update_rate>1000</real_time_update_rate>
  <gravity>0 0 -9.8</gravity>
</physics>***

</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

<launch>

<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
2

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

Raskkii gravatar image

Mind you that this snippet:

<physics type='ode'>
  <max_step_size>0.001</max_step_size>
  <real_time_factor>1</real_time_factor>
  <real_time_update_rate>1000</real_time_update_rate>
  <gravity>0 0 -9.8</gravity>
</physics>

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

Comments

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 -0600 )edit
0

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

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>

change

edit flag offensive delete link more

Question Tools

2 followers

Stats

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

Seen: 15,678 times

Last updated: Dec 12 '17