mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 22:51:35 +08:00
lpe: fix incorrect setting of local_position.z_global
This commit is contained in:
committed by
Lorenz Meier
parent
8d89e5e40b
commit
b5be990109
@@ -31,6 +31,7 @@ void BlockLocalPositionEstimator::baroInit()
|
||||
|
||||
if (!_altOriginInitialized) {
|
||||
_altOriginInitialized = true;
|
||||
_altOriginGlobal = false;
|
||||
_altOrigin = _baroAltOrigin;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ void BlockLocalPositionEstimator::gpsInit()
|
||||
// possible baro offset in global altitude at init
|
||||
_altOrigin = _gpsAltOrigin;
|
||||
_altOriginInitialized = true;
|
||||
_altOriginGlobal = true;
|
||||
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "[lpe] global origin init (gps) : lat %6.2f lon %6.2f alt %5.1f m",
|
||||
gpsLatOrigin, gpsLonOrigin, double(_gpsAltOrigin));
|
||||
|
||||
@@ -34,6 +34,7 @@ void BlockLocalPositionEstimator::mocapInit()
|
||||
|
||||
if (!_altOriginInitialized) {
|
||||
_altOriginInitialized = true;
|
||||
_altOriginGlobal = false;
|
||||
_altOrigin = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ void BlockLocalPositionEstimator::visionInit()
|
||||
|
||||
if (!_altOriginInitialized) {
|
||||
_altOriginInitialized = true;
|
||||
_altOriginGlobal = true;
|
||||
_altOrigin = _sub_vision_pos.get().z_global ? _sub_vision_pos.get().ref_alt : 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user