diff --git a/docs/en/snippets.md b/docs/en/snippets.md index af2e36c9..5ce93c97 100644 --- a/docs/en/snippets.md +++ b/docs/en/snippets.md @@ -480,3 +480,11 @@ param_set(param_id='COM_FLTMODE1', value=ParamValue(integer=8)) # Set parameter of type FLOAT: param_set(param_id='MPC_Z_P', value=ParamValue(real=1.5)) ``` + +### # {#is-simulation} + +Check, if the code is running inside a [Gazebo simulation](simulation.md): + +```python +is_simulation = rospy.get_param('/use_sim_time', False) +``` diff --git a/docs/ru/snippets.md b/docs/ru/snippets.md index 85af2531..0e5dc95d 100644 --- a/docs/ru/snippets.md +++ b/docs/ru/snippets.md @@ -491,3 +491,11 @@ param_set(param_id='COM_FLTMODE1', value=ParamValue(integer=8)) # Изменить параметр типа FLOAT: param_set(param_id='MPC_Z_P', value=ParamValue(real=1.5)) ``` + +### # {#is-simulation} + +Проверить, что код запущен в [симуляции Gazebo](simulation.md): + +```python +is_simulation = rospy.get_param('/use_sim_time', False) +```