Competencia#
Inicializando la clase de competencia#
El control de competencia se crea utilizando el siguiente constructor:
Competition(driver, autonomous)
Este constructor utiliza dos parámetros:
Parámetro |
Descripción |
---|---|
|
Una función previamente definida llamada hilo cuando comienza el período de control del controlador. |
|
Una función previamente definida llamada hilo cuando comienza el periodo de control autónomo. |
# Define a function "driver".
def driver()
brain.screen.print("Driver called")
# Define a function "autonomous".
def autonomous()
brain.screen.print("Autonomous called")
# Construct a Competition Control object "competition"
# with the Competition class.
competition = Competition(driver, autonomous)
This competition
object will be used in all subsequent examples throughout this API documentation when referring to Competition class methods.
Métodos de clase#
is_enabled()#
The is_enabled()
method checks if the state of the robot is enabled or disabled.
Returns: True
if the competition mode is enabled. False
if it is disabled.
is_driver_control()#
The is_driver_control()
method checks if the state of the robot is driver control.
Returns: True
if the robot is in driver control mode. False
if it is not in driver control mode.
is_autonomous()#
The is_autonomous()
method checks if the state of the robot is autonomous.
Returns: True
if the robot is in autonomous mode. False
if it is not in autonomous.
is_competition_switch()#
The is_competition_switch()
method checks if the competition switch is connected.
Returns: True
if the competition switch is connected. False
if it is not connected.
is_field_control()#
The is_field_control()
method checks if the field control is connected.
Returns: True
if the field control is connected. False
if it is not connected.