mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 12:00:35 +08:00
Commander: avoid automatic type deduction where neither the type is obvious nor it helps with readability
This commit is contained in:
committed by
Daniel Agar
parent
990811098b
commit
651552c9b8
@@ -170,7 +170,7 @@ void HomePosition::fillGlobalHomePos(home_position_s &home, double lat, double l
|
||||
|
||||
void HomePosition::setInAirHomePosition()
|
||||
{
|
||||
auto &home = _home_position_pub.get();
|
||||
home_position_s &home = _home_position_pub.get();
|
||||
|
||||
if (home.manual_home || (home.valid_lpos && home.valid_hpos && home.valid_alt)) {
|
||||
return;
|
||||
@@ -251,13 +251,13 @@ void HomePosition::setInAirHomePosition()
|
||||
|
||||
bool HomePosition::setManually(double lat, double lon, float alt, float yaw)
|
||||
{
|
||||
const auto &vehicle_local_position = _local_position_sub.get();
|
||||
const vehicle_local_position_s &vehicle_local_position = _local_position_sub.get();
|
||||
|
||||
if (!vehicle_local_position.xy_global || !vehicle_local_position.z_global) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto &home = _home_position_pub.get();
|
||||
home_position_s &home = _home_position_pub.get();
|
||||
home.manual_home = true;
|
||||
|
||||
home.lat = lat;
|
||||
@@ -328,7 +328,7 @@ void HomePosition::update(bool set_automatically, bool check_if_changed)
|
||||
}
|
||||
|
||||
const vehicle_local_position_s &lpos = _local_position_sub.get();
|
||||
const auto &home = _home_position_pub.get();
|
||||
const home_position_s &home = _home_position_pub.get();
|
||||
|
||||
if (lpos.heading_reset_counter != _heading_reset_counter) {
|
||||
if (_valid && set_automatically) {
|
||||
|
||||
Reference in New Issue
Block a user