Skip to content

Commit

Permalink
Plane: support MavLink HEADING_TYPE_DEFAULT in MAV_CMD_GUIDED_CHANGE_…
Browse files Browse the repository at this point in the history
…HEADING
  • Loading branch information
timtuxworth committed Jul 1, 2024
1 parent 4ed1b6b commit 02c981d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ArduPlane/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,12 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavl

float new_target_heading = radians(wrap_180(packet.param2));

// Default value = no heading track
if ( int(packet.param1) == HEADING_TYPE_DEFAULT) {
plane.guided_state.target_heading_type = GUIDED_HEADING_NONE;
return MAV_RESULT_ACCEPTED;
// course over ground
if ( int(packet.param1) == HEADING_TYPE_COURSE_OVER_GROUND) { // compare as nearest int
} else if ( int(packet.param1) == HEADING_TYPE_COURSE_OVER_GROUND) { // compare as nearest int
plane.guided_state.target_heading_type = GUIDED_HEADING_COG;
plane.prev_WP_loc = plane.current_loc;
// normal vehicle heading
Expand Down

0 comments on commit 02c981d

Please sign in to comment.