Skip to content

The set home command should be sent as COMMAND_INT so the altitude reference frame can be specified #2871

Description

@rafaellehmkuhl

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions