Skip to content

Commit e6582f9

Browse files
author
Rabia Aslam
committed
Made minor change to an example
1 parent d01f4ec commit e6582f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

getting_started/asyncio/system/disable_notifications_and_active_commands.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ async def main():
4646
)
4747
await rvr.sensor_control.start(interval=1000)
4848

49-
print('Initiate a drive command...')
49+
print('Set the control system timeout to 10s and initiate a drive command...')
50+
await rvr.set_custom_control_system_timeout(command_timeout=10000)
5051
await rvr.drive_with_yaw_normalized(
5152
linear_velocity=32, # Valid linear_velocity values are in the range [-127..+127]
5253
yaw_angle=0 # Valid yaw values are traditionally [-179..+180], but will continue wrapping outside of that range
@@ -62,6 +63,9 @@ async def main():
6263
# Delay to allow observation that notifications and active commands have been disabled
6364
await asyncio.sleep(5)
6465

66+
# Restore the default timeout (2 seconds)
67+
await rvr.restore_default_control_system_timeout()
68+
6569
await rvr.close()
6670

6771

@@ -77,6 +81,8 @@ async def main():
7781
loop.run_until_complete(
7882
asyncio.gather(
7983
rvr.disable_notifications_and_active_commands(),
84+
# Restore the default timeout (2 seconds)
85+
rvr.restore_default_control_system_timeout(),
8086
rvr.close()
8187
)
8288
)

0 commit comments

Comments
 (0)