docs: add 'optical_flow/enabled' parameter usage snippets + minor fixes

This commit is contained in:
Oleg Kalachev
2022-05-27 06:25:56 +03:00
parent 8cef6be840
commit afa81e8ee2
2 changed files with 50 additions and 8 deletions

View File

@@ -358,15 +358,36 @@ Enable and disable [ArUco markers recognition](aruco_marker.md) dynamically (for
import rospy
import dynamic_reconfigure.client
client = dynamic_reconfigure.client.Client('aruco_detect')
rospy.init_node('flight')
aruco_client = dynamic_reconfigure.client.Client('aruco_detect')
# Turn markers recognition off
client.update_configuration({'enabled': False})
aruco_client.update_configuration({'enabled': False})
rospy.sleep(5)
# Turn markers recognition on
client.update_configuration({'enabled': True})
aruco_client.update_configuration({'enabled': True})
```
### # {#optical-flow-enabled}
Enable and disable [Optical Flow](optical_flow.md) dynamically:
```python
import rospy
import dynamic_reconfigure.client
rospy.init_node('flight')
flow_client = dynamic_reconfigure.client.Client('optical_flow')
# Turn Optical Flow off
flow_client.update_configuration({'enabled': False})
rospy.sleep(5)
# Turn Optical Flow on
flow_client.update_configuration({'enabled': True})
```
### # {#wait-global-position}

View File

@@ -369,15 +369,36 @@ calibrate_gyro()
import rospy
import dynamic_reconfigure.client
client = dynamic_reconfigure.client.Client('aruco_detect')
rospy.init_node('flight')
aruco_client = dynamic_reconfigure.client.Client('aruco_detect')
# Включить распознавание маркеров
client.update_configuration({'enabled': False})
# Выключить распознавание маркеров
aruco_client.update_configuration({'enabled': False})
rospy.sleep(5)
# Выключить распознавание маркеров
client.update_configuration({'enabled': True})
# Включить распознавание маркеров
aruco_client.update_configuration({'enabled': True})
```
### # {#optical-flow-enabled}
Динамически включать и отключать [Optical Flow](optical_flow.md):
```python
import rospy
import dynamic_reconfigure.client
rospy.init_node('flight')
flow_client = dynamic_reconfigure.client.Client('optical_flow')
# Выключить Optical Flow
flow_client.update_configuration({'enabled': False})
rospy.sleep(5)
# Включить Optical Flow
flow_client.update_configuration({'enabled': True})
```
### # {#wait-global-position}