From afa81e8ee2021033ee385d0e369a5219143af744 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Fri, 27 May 2022 06:25:56 +0300 Subject: [PATCH] docs: add 'optical_flow/enabled' parameter usage snippets + minor fixes --- docs/en/snippets.md | 27 ++++++++++++++++++++++++--- docs/ru/snippets.md | 31 ++++++++++++++++++++++++++----- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/docs/en/snippets.md b/docs/en/snippets.md index 8af8ca29..1d0c3a41 100644 --- a/docs/en/snippets.md +++ b/docs/en/snippets.md @@ -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} diff --git a/docs/ru/snippets.md b/docs/ru/snippets.md index de2eee9b..7a9f2271 100644 --- a/docs/ru/snippets.md +++ b/docs/ru/snippets.md @@ -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}