mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 15:57:35 +08:00
navigator: set position setpoint timestamp
This commit is contained in:
@@ -590,6 +590,7 @@ MissionBlock::mission_item_to_position_setpoint(const mission_item_s &item, posi
|
||||
}
|
||||
|
||||
sp->valid = true;
|
||||
sp->timestamp = hrt_absolute_time();
|
||||
|
||||
return sp->valid;
|
||||
}
|
||||
|
||||
@@ -665,9 +665,11 @@ Navigator::run()
|
||||
|
||||
_pos_sp_triplet.current.type = position_setpoint_s::SETPOINT_TYPE_IDLE;
|
||||
_pos_sp_triplet.current.valid = true;
|
||||
_pos_sp_triplet.previous.valid = false;
|
||||
_pos_sp_triplet.next.valid = false;
|
||||
_pos_sp_triplet.current.timestamp = hrt_absolute_time();
|
||||
|
||||
_pos_sp_triplet.previous.valid = false;
|
||||
|
||||
_pos_sp_triplet.next.valid = false;
|
||||
}
|
||||
|
||||
/* if nothing is running, set position setpoint triplet invalid once */
|
||||
|
||||
@@ -93,6 +93,7 @@ PrecLand::on_activation()
|
||||
pos_sp_triplet->current.lon = _navigator->get_global_position()->lon;
|
||||
pos_sp_triplet->current.alt = _navigator->get_global_position()->alt;
|
||||
pos_sp_triplet->current.valid = true;
|
||||
pos_sp_triplet->current.timestamp = hrt_absolute_time();
|
||||
}
|
||||
|
||||
_sp_pev = matrix::Vector2f(0, 0);
|
||||
|
||||
Reference in New Issue
Block a user