Skip to content

Instantly share code, notes, and snippets.

@ksheersaagr
Created February 28, 2020 10:49
Show Gist options
  • Save ksheersaagr/502916ae834abc7cd68063d54c61fe09 to your computer and use it in GitHub Desktop.
Save ksheersaagr/502916ae834abc7cd68063d54c61fe09 to your computer and use it in GitHub Desktop.
# measurements for mu and motions, U
measurements = [5., 6., 7., 9., 10.]
motions = [1., 1., 2., 1., 1.]
# initial parameters
measurement_sig = 4.
motion_sig = 2.
mu = 0.
sig = 10000. #0000000001
## TODO: Loop through all measurements/motions
## Print out and display the resulting Gaussian
# your code here
for i in range(len(measurements)):
# measurement update, with uncertainty
mu, sig = update(mu, sig, measurements[i], measurement_sig)
print('Update: [{}, {}]'.format(mu, sig))
# motion update, with uncertainty
mu, sig = predict(mu, sig, motions[i], motion_sig)
print('Predict: [{}, {}]'.format(mu, sig))
# print the final, resultant mu, sig
print('\n')
print('Final result: [{}, {}]'.format(mu, sig))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment