-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_ExternalAHRS: added ANU CINS state estimator #24747
base: master
Are you sure you want to change the base?
Conversation
240992a
to
411b987
Compare
451699b
to
6dbce7b
Compare
c9e1e57
to
0b2dc4e
Compare
553a0b3
to
183357d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stack-frame-too-big on CubeOrange
@@ -0,0 +1,173 @@ | |||
#include "AP_Math.h" | |||
#include "LieGroups.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Links to papers required!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we upload them to the repo so if hosting goes down, we still have access?
183357d
to
bb3bc4c
Compare
6f9ff1b
to
168d6ca
Compare
c8d0b6a
to
31f9d8f
Compare
58d5de6
to
516069c
Compare
@peterbarker stack size issues fixed |
aba5014
to
38a09b8
Compare
when using --enable-FEATURE also enable dependent feattures for 1 level
state.XHat = Gal3F::identity(); | ||
state.ZHat = SIM23::identity(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we'd do state.XHat.identity()
state.acc_bias_gain_mat.rot.zero(); | ||
state.acc_bias_gain_mat.vel.zero(); | ||
state.acc_bias_gain_mat.pos.zero(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all implicitly zero; if this was a reset
we'd need these.
// see if we have new GPS data | ||
const auto &gps = dal.gps(); | ||
if (gps.status() >= AP_DAL_GPS::GPS_OK_FIX_3D) { | ||
const uint32_t last_gps_fix_ms = gps.last_message_time_ms(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mismatch between this and the gps.location()
line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should run this through the code formatter before putting it in.
@@ -167,6 +167,12 @@ def srcpath(path): | |||
disable_option = "disable_" + enable_option[len("enable-"):] | |||
if getattr(cfg.options, enable_option, False): | |||
env.CXXFLAGS += ['-D%s=1' % opt.define] | |||
if opt.dependency: | |||
for d in opt.dependency.split(','): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lift method from build_options.py?
Feature('AHRS', 'EKF3_WINDEST', 'EK3_FEATURE_DRAG_FUSION', 'Enable Wind estimation for EKF3', 0, 'EKF3'), | ||
Feature('AHRS', 'EKF3_OPTFLOW', 'EK3_FEATURE_OPTFLOW_FUSION', 'Enable OpticalFlow fusion for EKF3', 0, 'EKF3,OPTICALFLOW'), | ||
Feature('AHRS', 'BARO_WIND_COMP', 'HAL_BARO_WIND_COMP_ENABLED', 'Enable Baro wind compensation', 0, None), | ||
Feature('AHRS', 'EKF3_EXTNAV', 'EK3_FEATURE_EXTERNAL_NAV', 'Enable External Navigation for EKF3', 0, 'EKF3'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case problems
@@ -0,0 +1,801 @@ | |||
/* | |||
CINS state estimator for AP_AHRS, developed by Mr Patrick Wiltshire and Dr Pieter Van Goor | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyright/license required?
CINS state estimator for AP_AHRS, developed by Mr Patrick Wiltshire and Dr Pieter Van Goor | ||
*/ | ||
|
||
#include "AP_CINS.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "AP_CINS.h" | |
#include "AP_CINS_config.h" |
#include <GCS_MAVLink/GCS.h> | ||
|
||
// gains tested for 5Hz GPS | ||
#define CINS_GAIN_GPSPOS_ATT (1.0E-5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just inline these into the parameter definitions?
// The key point is that Omega changes R which changes Omega. | ||
// We use a first order expansion to capture this effect here. | ||
|
||
const Vector3F omega1 = - Matrix3F::skew_symmetric(v1) * v2 * gain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const Vector3F omega1 = - Matrix3F::skew_symmetric(v1) * v2 * gain; | |
const auto skewed_v1 = Matrix3F::skew_symmetric(v1); | |
const Vector3F omega1 = - skewed_v1 * v2 * gain; |
and use this elsewhere.
similarly for skewed omega1
const Vector3F omega2 = - Matrix3F::skew_symmetric(v1) * Matrix3F::skew_symmetric(omega1) * v2 * gain; | ||
const Vector3F omega3 = - Matrix3F::skew_symmetric(v1) * Matrix3F::skew_symmetric(omega2) * v2 * gain | ||
- Matrix3F::skew_symmetric(v1) * Matrix3F::skew_symmetric(omega1) * Matrix3F::skew_symmetric(omega1) * v2 * gain; | ||
return omega1 + omega2*dt + omega3*0.5*dt*dt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return omega1 + omega2*dt + omega3*0.5*dt*dt; | |
return omega1 + omega2*dt + omega3*0.5*sq(dt); |
ftype magTest; | ||
} variances; | ||
|
||
} state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why we have a state
structure
|
||
// accessors for AP_AHRS | ||
bool healthy(void) const override { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do better than this?!
return true; | ||
} | ||
bool pre_arm_check(char *failure_msg, uint8_t failure_msg_len) const override { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we have never had a GPS measurement?
This is the ANU CINS estimator worked on by @patwilt and @pvangoor
This is still experimental but is giving promising results in test flights
remaining issues: