VEX IQ Python API
|
Config Drivetrain: motors and wheels that move a robot. More...
Public Member Functions | |
def | __init__ (self, left_motor, right_motor, wheel_travel_mm=200, track_mm=176) |
def | wheel_travel (self, wheel_travel_mm) |
Wheel travel (circumference) in mm. More... | |
def | wheel_track (self, distance_mm) |
Distance between left and right wheels in mm. More... | |
def | drive (self, power, distance_mm=None) |
Begin driving in a straight line. More... | |
def | drive_until (self, power, distance_mm) |
Drive in a straight line until the distance is reached. More... | |
def | turn (self, power, angle_deg=None) |
Begin turning by a given angle, positive to turn left, negative to turn right. More... | |
def | turn_until (self, power, angle_deg) |
Turn by a given angle, positive to turn left, negative to turn right. More... | |
def | arcade (self, drive_power, turn_power) |
Arcade drive given two axes of a controller. More... | |
def | off (self) |
Turn off both motors. More... | |
def | brake (self) |
Brake both motors. More... | |
def | hold (self) |
Hold both motors. More... | |
def | reached_target (self) |
True if both motors reached their target (turn or drive finished). More... | |
def | stall_timeout (self, duration_sec=None) |
Get or set the stall detection timeout (in seconds) More... | |
def | stalled (self) |
True if one motor has stalled, and the other either reached target or stalled (as specified by stall_timeout()) More... | |
def | reached_target_or_stalled (self) |
True if both motors reached their target or stalled (as specified by stall_timeout()) More... | |
Config Drivetrain: motors and wheels that move a robot.
left_motor | Motor driving the left wheel |
right_motor | Motor driving the right wheel |
travel_mm | Wheel travel (circumference) in mm, default 200mm |
track_mm | Distance between left and right wheels in mm, default 176mm |
def drivetrain.Drivetrain.__init__ | ( | self, | |
left_motor, | |||
right_motor, | |||
wheel_travel_mm = 200 , |
|||
track_mm = 176 |
|||
) |
def drivetrain.Drivetrain.wheel_travel | ( | self, | |
wheel_travel_mm | |||
) |
Wheel travel (circumference) in mm.
def drivetrain.Drivetrain.wheel_track | ( | self, | |
distance_mm | |||
) |
Distance between left and right wheels in mm.
def drivetrain.Drivetrain.drive | ( | self, | |
power, | |||
distance_mm = None |
|||
) |
Begin driving in a straight line.
power | -100.0...100.0 (percent power). |
distance_mm | distance in mm, negative to go backwards. |
def drivetrain.Drivetrain.drive_until | ( | self, | |
power, | |||
distance_mm | |||
) |
Drive in a straight line until the distance is reached.
power | -100.0...100.0 (percent power). |
distance_mm | distance in mm, negative to go backwards. |
def drivetrain.Drivetrain.turn | ( | self, | |
power, | |||
angle_deg = None |
|||
) |
Begin turning by a given angle, positive to turn left, negative to turn right.
power | -100.0...100.0 (percent power). |
angle_deg | angle in degrees, positive to turn left, negative to turn right. |
def drivetrain.Drivetrain.turn_until | ( | self, | |
power, | |||
angle_deg | |||
) |
Turn by a given angle, positive to turn left, negative to turn right.
power | -100.0...100.0 (percent power). |
angle_deg | angle in degrees, positive to turn left, negative to turn right. |
def drivetrain.Drivetrain.arcade | ( | self, | |
drive_power, | |||
turn_power | |||
) |
Arcade drive given two axes of a controller.
def drivetrain.Drivetrain.off | ( | self | ) |
Turn off both motors.
def drivetrain.Drivetrain.brake | ( | self | ) |
Brake both motors.
def drivetrain.Drivetrain.hold | ( | self | ) |
Hold both motors.
def drivetrain.Drivetrain.reached_target | ( | self | ) |
True if both motors reached their target (turn or drive finished).
def drivetrain.Drivetrain.stall_timeout | ( | self, | |
duration_sec = None |
|||
) |
Get or set the stall detection timeout (in seconds)
def drivetrain.Drivetrain.stalled | ( | self | ) |
True if one motor has stalled, and the other either reached target or stalled (as specified by stall_timeout())
def drivetrain.Drivetrain.reached_target_or_stalled | ( | self | ) |
True if both motors reached their target or stalled (as specified by stall_timeout())