DO_SET_HOME is currently sent as a COMMAND_LONG (src/libs/vehicle/mavlink/vehicle.ts:1202-1204):
async setHomeWaypoint(coordinates: [number, number], altitude: number): Promise<void> {
await this.sendCommandLong(MavCmd.MAV_CMD_DO_SET_HOME, 0, 0, 0, 0, coordinates[0], coordinates[1], altitude)
}
COMMAND_LONG carries latitude and longitude as floats and has no frame field, so the altitude reference is left implicit. COMMAND_INT carries the position as scaled integers (1e7) and includes a frame field, letting us state whether the altitude is AMSL, relative to home, or terrain-relative.
Note that the existing sendCommandInt helper hardcodes the frame (src/libs/vehicle/mavlink/vehicle.ts:273):
frame: { type: MavFrame.MAV_FRAME_GLOBAL },
so it needs an optional frame parameter, defaulting to MAV_FRAME_GLOBAL to leave the existing goTo caller (line 612) unchanged.
This is a prerequisite for the planned dialog that lets the user choose the reference frame and altitude when explicitly setting a home point.
DO_SET_HOMEis currently sent as aCOMMAND_LONG(src/libs/vehicle/mavlink/vehicle.ts:1202-1204):COMMAND_LONGcarries latitude and longitude as floats and has no frame field, so the altitude reference is left implicit.COMMAND_INTcarries the position as scaled integers (1e7) and includes aframefield, letting us state whether the altitude is AMSL, relative to home, or terrain-relative.Note that the existing
sendCommandInthelper hardcodes the frame (src/libs/vehicle/mavlink/vehicle.ts:273):so it needs an optional frame parameter, defaulting to
MAV_FRAME_GLOBALto leave the existinggoTocaller (line 612) unchanged.This is a prerequisite for the planned dialog that lets the user choose the reference frame and altitude when explicitly setting a home point.