docs: add snippet to wait for global position

This commit is contained in:
Oleg Kalachev
2021-08-24 20:43:26 +03:00
parent 2b88d21792
commit ec6f3089e3
2 changed files with 30 additions and 0 deletions

View File

@@ -384,3 +384,18 @@ rospy.sleep(5)
# Turn markers recognition on
client.update_configuration({'enabled': True})
```
### # {#wait-global-position}
Wait for global position to appear (finishing [GPS receiver](gps.md) initialization):
```python
import math
# ...
while not rospy.is_shutdown():
if math.isfinite(get_telemetry().lat):
break
rospy.sleep(0.2)
```

View File

@@ -402,3 +402,18 @@ rospy.sleep(5)
# Turn markers recognition on
client.update_configuration({'enabled': True})
```
### # {#wait-global-position}
Ожидать появления глобальной позиции (окончания инициализации [GPS-приемника](gps.md)):
```python
import math
# ...
while not rospy.is_shutdown():
if math.isfinite(get_telemetry().lat):
break
rospy.sleep(0.2)
```