Skip to main content

reverse_avoid_collision()

Description#

Drives Zumi in reverse at a default speed of 40 for 1 second in the direction Zumi is currently facing. If either of the back IR sensor values go below the threshold, Zumi will stop even if the duration or timeout is not complete.

Syntax#

reverse_avoid_collision(speed=40, duration=1.0)
reverse_avoid_collision(speed=40, duration=1.0, desired_angle=None, left_th=150, right_th=150)

Parameters#

speed: Positive integer value for speed between 0 and 80
duration: Number of seconds Zumi will drive and check for collision
desired_angle: Heading or desired angle (Default to None which is Zumi's current heading)
left_th: threshold of the back left IR sensor
right_th: threshold of the back right IR sensor

Returns#

None

Example Code#
Python#
#Python code
from zumi.zumi import Zumi
zumi = Zumi()
zumi.reverse_avoid_collision(40,2)