Physics Properties
In the World tab, select the physics item. A list of physics properties will be displayed in the list box below.
- The
enable physicscheck-box can be used to disable physics while allowing plugins and sensors to continue running. - The
real time update rateparameter specifies in Hz the number of physics updates that will be attempted per second. If this number is set to zero, it will run as fast as it can. Note that the product ofreal time update rateandmax step sizerepresents the targetreal time factor, or ratio of simulation time to real-time. - The
max step sizespecifies the time duration in seconds of each physics update step.
默認.world
<physics name="default_physics" default="true" type="ode">
<max_step_size>0.01</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
<ode>
<solver>
<type>quick</type>
<iters>50</iters>
<sor>1.2</sor>
</solver>
</ode>
</physics>
<max_step_size>: 這個參數指定了每個物理更新步驟的持續時間(秒)。
<real_time_factor>: 該參數以赫茲為單位指定每秒嘗試的物理更新次數。如果這個數字設為0,它就會盡可能快地運行
注意
<real_time_update_rate>和<max_step_size>的乘積表示<real_time_factor>,即模擬時間與實時的比率。
加速Gazebo仿真的.world
<physics type='ode'>
<max_step_size>0.01</max_step_size>
<!-- <real_time_factor>1</real_time_factor>
<real_time_update_rate>100</real_time_update_rate> -->
<gravity>0 0 -9.8</gravity>
</physics>
<real_time_factor>和<real_time_update_rate>注釋掉,你會發現gazebo的仿真時間比真實時間快了10倍.
