mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 21:19:35 +00:00
docs: add snippet to wait for global position
This commit is contained in:
@@ -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)
|
||||
```
|
||||
|
||||
@@ -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)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user