mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
docs: add snippet on how to check if code is running inside simulation
This commit is contained in:
@@ -480,3 +480,11 @@ param_set(param_id='COM_FLTMODE1', value=ParamValue(integer=8))
|
|||||||
# Set parameter of type FLOAT:
|
# Set parameter of type FLOAT:
|
||||||
param_set(param_id='MPC_Z_P', value=ParamValue(real=1.5))
|
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)
|
||||||
|
```
|
||||||
|
|||||||
@@ -491,3 +491,11 @@ param_set(param_id='COM_FLTMODE1', value=ParamValue(integer=8))
|
|||||||
# Изменить параметр типа FLOAT:
|
# Изменить параметр типа FLOAT:
|
||||||
param_set(param_id='MPC_Z_P', value=ParamValue(real=1.5))
|
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)
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user