Ανταγωνισμός#

Εισαγωγή#

Η κλάση Διαγωνισμού χρησιμοποιείται με το Σύστημα Ελέγχου Πεδίου κατά τη διάρκεια των Διαγωνισμών Ρομποτικής VEX χρησιμοποιώντας το σύστημα V5. Για περισσότερες πληροφορίες σχετικά με το Πρότυπο Διαγωνισμού που χρησιμοποιεί τις πληροφορίες σε αυτήν τη σελίδα και τον τρόπο εφαρμογής του στον διαγωνισμό, διαβάστε το Χρήση του Προτύπου Διαγωνισμού Python στον κώδικα VEX V5.

Παρακάτω είναι μια λίστα με τις διαθέσιμες μεθόδους:

Κατασκευαστής

Αποκτητές

Κατασκευαστής#

Competition#

Η συνάρτηση Competition δημιουργεί τον Έλεγχο Ανταγωνισμού. Στον κώδικα VEX V5, το προεπιλεγμένο όνομα συνάρτησης για τον έλεγχο του οδηγού είναι driver_control και για την αυτόνομη είναι autonomous.

Χρήση:

Competition(driver_control, autonomous)

Παράμετρος

Περιγραφή

driver_control

Μια προηγουμένως καθορισμένη συνάρτηση που καλείται ως νήμα όταν ξεκινά η περίοδος ελέγχου του οδηγού.

autonomous

Μια προηγουμένως καθορισμένη συνάρτηση που ονομάζεται νήμα όταν ξεκινά η περίοδος αυτόνομου ελέγχου.

# Define a function "driver_control".
def driver_control()
    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_control, autonomous)

Αποκτητές#

is_enabled#

is_enabled checks if the state of the competition is enabled or disabled.

  • True if the competition is enabled.

  • False if the competition is disabled.

Χρήση:

competition.is_enabled()

Παράμετροι

Περιγραφή

Αυτή η μέθοδος δεν έχει παραμέτρους.

is_driver_control#

is_driver_control checks if the state of the competition is driver control.

  • True if the competition is in driver control mode.

  • False if the competition is not in driver control mode.

Χρήση:

competition.is_driver_control()

Παράμετροι

Περιγραφή

Αυτή η μέθοδος δεν έχει παραμέτρους.

is_autonomous#

is_autonomous checks if the state of the competition is autonomous.

  • True if the competition is in autonomous mode.

  • False if the competition is not in autonomous mode.

Χρήση:

competition.is_autonomous()

Παράμετροι

Περιγραφή

Αυτή η μέθοδος δεν έχει παραμέτρους.

is_competition_switch#

is_competition_switch checks if the competition switch is connected.

  • True if the competition switch is connected.

  • False if it is not connected.

Χρήση:

competition.is_competition_switch()

Παράμετροι

Περιγραφή

Αυτή η μέθοδος δεν έχει παραμέτρους.

is_field_control#

is_field_control checks if the field control system is connected.

  • True if the field control system is connected.

  • False if it is not connected.

Χρήση:

competition.is_field_control()

Παράμετροι

Περιγραφή

Αυτή η μέθοδος δεν έχει παραμέτρους.