diff --git a/docs/en/snippets.md b/docs/en/snippets.md index 6c8d2127..49d4e986 100644 --- a/docs/en/snippets.md +++ b/docs/en/snippets.md @@ -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) +``` diff --git a/docs/ru/snippets.md b/docs/ru/snippets.md index e7219bf7..5d60cffa 100644 --- a/docs/ru/snippets.md +++ b/docs/ru/snippets.md @@ -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) +```