mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
simple_offboard: reset stored setpoint on auto_arm only if needed to be armed
CopterExpress/clover_vm#13
This commit is contained in:
@@ -800,7 +800,8 @@ bool serve(enum setpoint_type_t sp_type, float x, float y, float z, float vx, fl
|
||||
nav_from_sp_flag = false;
|
||||
}
|
||||
|
||||
if (auto_arm || setpoint_type == VELOCITY || setpoint_type == ATTITUDE || setpoint_type == RATES) {
|
||||
bool to_auto_arm = auto_arm && (state.mode != "OFFBOARD" || !state.armed);
|
||||
if (to_auto_arm || setpoint_type == VELOCITY || setpoint_type == ATTITUDE || setpoint_type == RATES) {
|
||||
// invalidate position setpoint
|
||||
setpoint_position.header.frame_id = "";
|
||||
setpoint_altitude.header.frame_id = "";
|
||||
|
||||
Reference in New Issue
Block a user