Commander: avoid automatic type deduction where neither the type is obvious nor it helps with readability

This commit is contained in:
Matthias Grob
2024-11-12 14:55:36 +01:00
committed by Daniel Agar
parent 990811098b
commit 651552c9b8
4 changed files with 11 additions and 10 deletions
+4 -4
View File
@@ -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) {