mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 15:43:34 +08:00
Set kalman_demo to only publish when it has valid info.
This commit is contained in:
@@ -239,7 +239,10 @@ void KalmanNav::update()
|
|||||||
// publication
|
// publication
|
||||||
if (newTimeStamp - _pubTimeStamp > 1e6 / 50) { // 50 Hz
|
if (newTimeStamp - _pubTimeStamp > 1e6 / 50) { // 50 Hz
|
||||||
_pubTimeStamp = newTimeStamp;
|
_pubTimeStamp = newTimeStamp;
|
||||||
updatePublications();
|
|
||||||
|
if (_positionInitialized) _pos.update();
|
||||||
|
|
||||||
|
if (_attitudeInitialized) _att.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
// output
|
// output
|
||||||
@@ -589,6 +592,7 @@ int KalmanNav::correctAtt()
|
|||||||
}
|
}
|
||||||
|
|
||||||
psi += xCorrect(PSI);
|
psi += xCorrect(PSI);
|
||||||
|
|
||||||
// attitude also affects nav velocities
|
// attitude also affects nav velocities
|
||||||
if (_positionInitialized) {
|
if (_positionInitialized) {
|
||||||
vN += xCorrect(VN);
|
vN += xCorrect(VN);
|
||||||
|
|||||||
Reference in New Issue
Block a user