경쟁#

소개#

Competition 클래스는 V5 시스템을 사용하는 VEX 로봇 대회에서 필드 제어 시스템과 함께 사용됩니다. 이 페이지의 정보를 사용하는 대회 템플릿과 대회에 적용되는 방법에 대한 자세한 내용은 VEXcode V5에서 Python 대회 템플릿 사용을 참조하십시오.

다음은 사용 가능한 방법 목록입니다.

건설자

게터

  • is_enabled – 경쟁이 활성화되었는지 비활성화되었는지 확인합니다.

  • is_driver_control – 경쟁이 드라이버 제어 모드인지 확인합니다.

  • is_autonomous – 경쟁이 자율 모드인지 확인합니다.

  • is_competition_switch – 경쟁 스위치가 연결되어 있는지 확인합니다.

  • is_field_control – 필드 제어 시스템이 연결되어 있는지 확인합니다.

건설자#

Competition#

Competition은 경쟁 제어 기능을 생성합니다. VEXcode 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 경쟁의 상태가 활성화되었는지 비활성화되었는지 확인합니다.

  • True 경쟁이 활성화된 경우.

  • False 경쟁이 비활성화된 경우.

용법:

competition.is_enabled()

매개변수

설명

이 메서드에는 매개변수가 없습니다.

is_driver_control#

is_driver_control 경쟁 상황이 드라이버 제어인지 확인합니다.

  • True 경쟁이 드라이버 제어 모드인 경우.

  • False 경쟁이 운전자 제어 모드가 아닌 경우.

용법:

competition.is_driver_control()

매개변수

설명

이 메서드에는 매개변수가 없습니다.

is_autonomous#

is_autonomous 경쟁 상태가 자율적인지 확인합니다.

  • True 경쟁 차량이 자율 주행 모드인 경우.

  • False 경쟁이 자율 주행 모드가 아닌 경우.

용법:

competition.is_autonomous()

매개변수

설명

이 메서드에는 매개변수가 없습니다.

is_competition_switch#

is_competition_switch 경쟁 스위치가 연결되어 있는지 확인합니다.

  • True 경쟁 스위치가 연결된 경우.

  • False 연결되어 있지 않은 경우입니다.

용법:

competition.is_competition_switch()

매개변수

설명

이 메서드에는 매개변수가 없습니다.

is_field_control#

is_field_control 필드 제어 시스템이 연결되어 있는지 확인합니다.

  • True 현장 제어 시스템이 연결된 경우입니다.

  • False 연결되어 있지 않은 경우입니다.

용법:

competition.is_field_control()

매개변수

설명

이 메서드에는 매개변수가 없습니다.