AP_Rally: add alt_frame to unused flag bits

This commit is contained in:
Iampete1 2023-10-25 01:59:20 +01:00 committed by Andrew Tridgell
parent d25d1c253e
commit cd621f0503
2 changed files with 11 additions and 8 deletions

View File

@ -129,13 +129,9 @@ Location AP_Rally::rally_location_to_location(const RallyLocation &rally_loc) co
rally_loc.lat,
rally_loc.lng,
rally_loc.alt * 100,
Location::AltFrame::ABOVE_HOME
(rally_loc.alt_frame_valid == 1) ? Location::AltFrame(rally_loc.alt_frame) : Location::AltFrame::ABOVE_HOME
};
// notionally the following call can fail, but we have no facility
// to return that fact here:
ret.change_alt_frame(Location::AltFrame::ABSOLUTE);
return ret;
}

View File

@ -30,9 +30,16 @@ struct PACKED RallyLocation {
int16_t alt; //transit altitude (and loiter altitude) in meters (absolute);
int16_t break_alt; //when autolanding, break out of loiter at this alt (meters)
uint16_t land_dir; //when the time comes to auto-land, try to land in this direction (centidegrees)
uint8_t flags; //bit 0 = seek favorable winds when choosing a landing poi
//bit 1 = do auto land after arriving
//all other bits are for future use.
union {
uint8_t flags;
struct {
uint8_t favorable_winds : 1; // bit 0 = seek favorable winds when choosing a landing poi
uint8_t do_auto_land : 1; // bit 1 = do auto land after arriving
uint8_t alt_frame_valid : 1; // bit 2 = true if following alt frame value should be used, else Location::AltFrame::ABOVE_HOME
uint8_t alt_frame : 2; // Altitude frame following Location::AltFrame enum
uint8_t unused : 3;
};
};
};
/// @class AP_Rally