Ανταγωνισμός#
Εισαγωγή#
Η κλάση Διαγωνισμού χρησιμοποιείται με το Σύστημα Ελέγχου Πεδίου κατά τη διάρκεια των Διαγωνισμών Ρομποτικής VEX χρησιμοποιώντας το σύστημα V5. Για περισσότερες πληροφορίες σχετικά με το Πρότυπο Διαγωνισμού που χρησιμοποιεί τις πληροφορίες σε αυτήν τη σελίδα και τον τρόπο εφαρμογής του στον διαγωνισμό, διαβάστε το Χρήση του Προτύπου Διαγωνισμού Python στον κώδικα VEX V5.
Παρακάτω είναι μια λίστα με τις διαθέσιμες μεθόδους:
Κατασκευαστής
Competition– Creates the Competition Control.
Αποκτητές
is_enabled– Checks if the competition is enabled or disabled.is_driver_control– Checks if the competition is in driver control mode.is_autonomous– Checks if the competition is in autonomous mode.is_competition_switch– Checks if the competition switch is connected.is_field_control– Checks if the Field Control System is connected.
Κατασκευαστής#
Competition#
Η συνάρτηση Competition δημιουργεί τον Έλεγχο Ανταγωνισμού. Στον κώδικα VEX V5, το προεπιλεγμένο όνομα συνάρτησης για τον έλεγχο του οδηγού είναι driver_control και για την αυτόνομη είναι autonomous.
Χρήση:
Competition(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.
Trueif the competition is enabled.Falseif the competition is disabled.
Χρήση:
competition.is_enabled()
Παράμετροι |
Περιγραφή |
|---|---|
Αυτή η μέθοδος δεν έχει παραμέτρους. |
is_driver_control#
is_driver_control checks if the state of the competition is driver control.
Trueif the competition is in driver control mode.Falseif 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.
Trueif the competition is in autonomous mode.Falseif the competition is not in autonomous mode.
Χρήση:
competition.is_autonomous()
Παράμετροι |
Περιγραφή |
|---|---|
Αυτή η μέθοδος δεν έχει παραμέτρους. |
is_competition_switch#
is_competition_switch checks if the competition switch is connected.
Trueif the competition switch is connected.Falseif it is not connected.
Χρήση:
competition.is_competition_switch()
Παράμετροι |
Περιγραφή |
|---|---|
Αυτή η μέθοδος δεν έχει παραμέτρους. |
is_field_control#
is_field_control checks if the field control system is connected.
Trueif the field control system is connected.Falseif it is not connected.
Χρήση:
competition.is_field_control()
Παράμετροι |
Περιγραφή |
|---|---|
Αυτή η μέθοδος δεν έχει παραμέτρους. |