MAV_CMD

저작권: 쿼드(QUAD) 드론연구소 https://www.youtube.com/@quad-robotics

개요

MAV_CMD 메세지는 자동 비행 모드에서 기체에 줄 수 있는 제어명령 목록 입니다.

MAV_CMD는 크게 COMMAND_INT COMMAND_LONG 타입이 있으며, 드론에 어떠한 명령을 보낼때 사용합니다.

COMMAND_INT 는 GPS 좌표 또는 고도 정보가 포함된 명령을 보낼 때 사용해야 합니다. 이는 위치 및 고도 값에 대해 정확한 좌표 프레임을 지정할 수 있기 때문입니다.

COMMAND_INT

Field Name
Type
Values
Description

target_system

uint8_t

System ID

target_component

uint8_t

Component ID (0 : 모든 컴포넌트)

frame

uint8_t

좌표계

command

uint16_t

Command ID, see MAV_CMD enum

current

uint8_t

Not used (set 0)

autocontinue

uint8_t

Not used (set 0)

param1

float

PARAM1

param2

float

PARAM2

param3

float

PARAM3

param4

float

PARAM4

param5

int32_t

Local: x position in meters * 1e4, Global: 위도 * 10^7

param6

int32_t

Local: y position in meters * 1e4, Global: 경도 * 10^7

param7

float

z position: Global: 고도 m (좌표계에 따라 절대고도, 상대고도)

COMMAND_LONG은 매개변수 5와 6에서 부동소수점 값을 보내는 데 사용해야 합니다. 이러한 값은 COMMAND_INT에서 보내면 정수로 잘립니다.

COMMAND_LONG

Field Name
Type
Values
Description

target_system

uint8_t

System ID

target_component

uint8_t

Component ID (0 : 모든 컴포넌트)

command

uint16_t

Command ID, see MAV_CMD enum

confirmation

uint8_t

0: First transmission of this command. 1-255: Confirmation transmissions

param1

float

Parameter 1 (for the specific command).

param2

float

Parameter 2 (for the specific command).

param3

float

Parameter 3 (for the specific command).

param4

float

Parameter 4 (for the specific command).

param5

float

Parameter 5 (for the specific command).

param6

float

Parameter 6 (for the specific command).

param7

float

Parameter 7 (for the specific command).

COMMAND_INT 시퀀스

요청은 COMMAND_INT 내에 인코딩된 지상국에서 전송됩니다 . 드론은 요청을 처리하고 결과를 나타내는 COMMAND_ACK 로 신속하게 응답합니다. 결과(MAV_RESULT)는 명령이 승인되었거나( COMMAND_ACK.result=MAV_RESULT_ACCEPTED), 승인되어 진행 중이거나(MAV_RESULT_IN_PROGRESS) 일부 이유 코드와 함께 거부 됩니다. "MAV_RESULT_ACCEPTED"은 명령이 유효하고 플라이트 스택이 명령이 완료되었음을 의미하는 것이 아니라 그에 대한 조치를 시도함을 의미합니다. 대부분의 명령은 "MAV_RESULT_ACCEPTED"을 반환합니다.

COMMAND_ACK.result_param2는명령별 enum에 명령 거부 이유에 대한 추가 정보를 포함할 수도 있습니다.

ACK를 받지 못한 경우 GCS는 COMMAND_INT를다시 보냅니다.

COMMAND_LONG 시퀀스

명령이 드롭되면 발신자는 confirmation 필드를 증가해야 합니다.

장기 실행 명령

일부 명령은 오래 실행 되며 즉시 완료할 수 없습니다. 드론은 COMMMAND_ACK 메시지를 COMMAND_ACK.result=MAV_RESULT_IN_PROGRESS 전송하여 진행률COMMMAND_ACK.progress을 보고하고 진행률을 ([0-100] 퍼센트 완료, 진행률이 제공되지 않은 경우 255) 백분율로 표시합니다. 작업이 완료되면 드론은 작업의 최종 결과 ( MAV_RESULT_ACCEPTED, MAV_RESULT_FAILED, MAV_RESULT_CANCELLED)를 포함하는 COMMMAND_ACK로종료해야 합니다.

장기 실행 작업은 COMMAND_CANCEL 메시지를 전송하여 취소할 수 있습니다 . 드론은 작업을 취소하고 COMMAND_ACK(COMMAND_ACK.result=MAV_RESULT_CANCELLED)를 보내 시퀀스를 완료해야 합니다.

  • 취소가 되지 않으면 드론은 완료될 때까지 진행률 업데이트를 계속 보낼 수 있습니다.

  • 시퀀스가 이미 완료되었거나 유휴 상태이면 취소 명령을 무시 합니다.

진행률 메시지MAV_RESULT_IN_PROGRESS가 내보내지는 속도는 시스템에 따라 다릅니다.

진행 또는 완료 업데이트를 기다리는 동안 시간 초과가 트리거되면 GCS는 시퀀스를 종료(유휴 상태로 돌아가기)하고 적절한 경우 사용자에게 알려야 합니다.

특정 장기 실행 명령 의 한 인스턴스만 한 번에 실행할 수 있습니다. 장기 실행 작업을 다시 시작하려면 먼저 기존 명령을 취소해야 합니다!

이 프로토콜은 수신 플라이트 스택의 상태 시스템에서 지원하는 경우 서로 다른 장기 실행 명령을 병렬로 실행할 수 있습니다.

결과 확인

COMMAND_ACK ( #77 )

Field Name
Type
Units
Values
Description

command

uint16_t

Command ID (of acknowledged command).

result

uint8_t

Result of command.

progress **

uint8_t

%

The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown.

result_param2 **

int32_t

Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate "unused" or "unknown").

target_system **

uint8_t

System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement.

target_component **

uint8_t

Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement.

Last updated