Module Expr Str ImportFrom alias alias alias alias Import alias identifier Import alias identifier Import alias identifier ImportFrom alias alias alias ImportFrom alias alias ImportFrom alias Import alias identifier ImportFrom alias ImportFrom alias alias alias Assign NameStore NameLoad ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults Num body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return TupleLoad BinOpAdd SubscriptLoad NameLoad Index Num BinOpMult Call NameLoad AttributeLoad NameLoad attr BinOpAdd SubscriptLoad NameLoad Index Num BinOpMult Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad BinOpSub NameLoad NameLoad BinOpAdd BinOpSub NameLoad NameLoad Num BinOpSub BinOpSub NameLoad NameLoad Num keyword NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMult AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpSub Num AttributeLoad NameLoad attr Assign NameStore BinOpMult AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpSub Num AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr NameLoad AugAssignAdd AttributeStore NameLoad attr NameLoad If CompareGt AttributeLoad NameLoad attr Num body AugAssignSub AttributeStore NameLoad attr Num AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr If CompareGt AttributeLoad NameLoad attr Num body AugAssignSub AttributeStore NameLoad attr Num AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpDiv Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpDiv BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr Num decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad keyword Num keyword Num Assign AttributeStore NameLoad attr Call NameLoad ListLoad Num Num AugAssignMult AttributeStore NameLoad attr Num AugAssignMult AttributeStore NameLoad attr BinOpPow NameLoad Num Assign AttributeStore NameLoad attr Call NameLoad ListLoad ListLoad Num NameLoad ListLoad Num Num keyword NameLoad Assign AttributeStore NameLoad attr Call NameLoad ListLoad ListLoad Num Num keyword NameLoad Assign AttributeStore NameLoad attr Call NameLoad keyword Num keyword NameLoad keyword Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad keyword Num keyword Num Assign AttributeStore NameLoad attr Call NameLoad ListLoad Num Num Num AugAssignMult AttributeStore NameLoad attr Num AugAssignMult AttributeStore NameLoad attr BinOpPow NameLoad Num Assign AttributeStore NameLoad attr Call NameLoad keyword Num keyword NameLoad keyword Num Assign AttributeStore NameLoad attr Call NameLoad ListLoad ListLoad Num NameLoad BinOpMult BinOpMult Num NameLoad NameLoad ListLoad Num Num NameLoad ListLoad Num Num Num keyword NameLoad Assign AttributeStore NameLoad attr Call NameLoad ListLoad ListLoad Num Num Num keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad keyword Num keyword Num keyword Num keyword Num Assign NameStore ListLoad Assign NameStore ListLoad For NameStore Call NameLoad Num body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad NameLoad attr Num Num For NameStore Call NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad Call NameLoad Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Num Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num NameLoad Num Num ListLoad Num Num Num Num ListLoad Num Num Num NameLoad ListLoad Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad BinOpDiv BinOpPow NameLoad Num Num Num ListLoad NameLoad Num ListLoad Num BinOpDiv BinOpPow NameLoad Num Num ListLoad Num NameLoad Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num Num attr Assign NameStore ListLoad Assign NameStore Num For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareGtE NameLoad Num body AugAssignAdd NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad Num For NameStore Call NameLoad Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad Num BinOpAdd SubscriptLoad NameLoad Index TupleLoad NameLoad Num BinOpMult Call NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad Num BinOpAdd SubscriptLoad NameLoad Index TupleLoad NameLoad Num BinOpMult Call NameLoad NameLoad TryExcept body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str keyword Str Slice Num Assign NameStore NameLoad handlers ExceptHandler body Pass Assign NameStore Call NameLoad Num Num Assign NameStore Call NameLoad Num Num Assign NameStore BinOpDiv BinOpPow NameLoad Num Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad ListLoad Num NameLoad NameLoad Num Num Num ListLoad Num Num NameLoad Num Num Num ListLoad Num Num Num Num Num Num ListLoad Num Num Num Num NameLoad NameLoad ListLoad Num Num Num Num Num NameLoad ListLoad Num Num Num Num Num Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr AttributeLoad Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num Num Num Num attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AugAssignMult AttributeStore NameLoad attr Num AugAssignMult AttributeStore NameLoad attr Num AugAssignMult AttributeStore NameLoad attr BinOpPow NameLoad Num AugAssignMult AttributeStore NameLoad attr BinOpPow NameLoad Num AugAssignMult AttributeStore NameLoad attr Num Assign NameStore BinOpMult Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num BinOpDiv Num Num ListLoad Num BinOpDiv Num Num Num ListLoad BinOpDiv Num Num Num Num Num Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Num Num Slice Num Num NameLoad Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Num Num Slice Num Num NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num Num Num Num ListLoad Num Num Num Num Num Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore ListLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num Assign NameStore Call NameLoad NameLoad TupleLoad Num Num NameLoad Assign TupleStore NameStore NameStore TupleLoad ListLoad ListLoad Assign TupleStore NameStore NameStore TupleLoad ListLoad ListLoad For TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Num body Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr ListLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword Str keyword Num Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Expr Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad NameLoad attr Str Expr Str decorator_list If CompareEq NameLoad Str body Assign NameStore NameLoad Expr Call NameLoad
N/A N/A Copyright 2015 Roger R Labbe Jr.

FilterPy library.
http://github.com/rlabbe/filterpy

Documentation at:
https://filterpy.readthedocs.org

Supporting book at:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python

This is licensed under an MIT license. See the readme.MD file
for more information.
 __future__ absolute_import division print_function unicode_literals N/A numpy.random random N/A numpy np N/A matplotlib.pyplot plt filterpy.kalman IMMEstimator KalmanFilter MMAEFilterBank numpy array asarray filterpy.common Q_discrete_white_noise N/A matplotlib.pyplot plt numpy.random randn math sin cos radians N/A DO_PLOT False NoisySensor N/A object N/A __init__ N/A N/A self noise_factor N/A 1 N/A N/A N/A self noise_factor noise_factor N/A sense N/A N/A self pos N/A N/A N/A N/A N/A N/A pos N/A 0 N/A N/A randn N/A self noise_factor N/A N/A pos N/A 1 N/A N/A randn N/A self noise_factor N/A N/A angle_between N/A N/A x y N/A N/A N/A N/A min N/A y x N/A N/A y x 360 N/A N/A y x 360 key abs N/A ManeuveringTarget N/A object N/A __init__ N/A N/A self x0 y0 v0 heading N/A N/A N/A N/A self x x0 N/A N/A self y y0 N/A N/A self vel v0 N/A N/A self hdg heading N/A N/A self cmd_vel v0 N/A N/A self cmd_hdg heading N/A N/A self vel_step 0 N/A N/A self hdg_step 0 N/A N/A self vel_delta 0 N/A N/A self hdg_delta 0 N/A update N/A N/A self N/A N/A N/A vx N/A N/A self vel N/A cos N/A radians N/A 90 N/A self hdg N/A vy N/A N/A self vel N/A sin N/A radians N/A 90 N/A self hdg N/A N/A self x vx N/A N/A self y vy N/A N/A N/A self hdg_step 0 N/A N/A N/A self hdg_step 1 N/A N/A self hdg N/A self hdg_delta N/A N/A N/A self vel_step 0 N/A N/A N/A self vel_step 1 N/A N/A self vel N/A self vel_delta N/A N/A N/A self x N/A self y N/A set_commanded_heading N/A N/A self hdg_degrees steps N/A N/A N/A N/A self cmd_hdg hdg_degrees N/A N/A self hdg_delta N/A N/A angle_between N/A self cmd_hdg N/A self hdg steps N/A N/A N/A abs N/A self hdg_delta 0 N/A N/A N/A self hdg_step steps N/A N/A N/A self hdg_step 0 N/A set_commanded_speed N/A N/A self speed steps N/A N/A N/A N/A self cmd_vel speed N/A N/A self vel_delta N/A N/A N/A self cmd_vel N/A self vel steps N/A N/A N/A abs N/A self vel_delta 0 N/A N/A N/A self vel_step steps N/A N/A N/A self vel_step 0 N/A N/A make_cv_filter N/A N/A dt noise_factor N/A N/A N/A cvfilter N/A KalmanFilter dim_x 2 dim_z 1 N/A N/A cvfilter x N/A array N/A 0.0 0.0 N/A N/A cvfilter P 3 N/A N/A cvfilter R N/A noise_factor 2 N/A N/A cvfilter F N/A array N/A N/A 1 dt N/A 0 1 dtype float N/A N/A cvfilter H N/A array N/A N/A 1 0 dtype float N/A N/A cvfilter Q N/A Q_discrete_white_noise dim 2 dt dt var 0.02 N/A cvfilter N/A make_ca_filter N/A N/A dt noise_factor N/A N/A N/A cafilter N/A KalmanFilter dim_x 3 dim_z 1 N/A N/A cafilter x N/A array N/A 0.0 0.0 0.0 N/A N/A cafilter P 3 N/A N/A cafilter R N/A noise_factor 2 N/A N/A cafilter Q N/A Q_discrete_white_noise dim 3 dt dt var 0.02 N/A N/A cafilter F N/A array N/A N/A 1 dt N/A N/A 0.5 dt dt N/A 0 1 dt N/A 0 0 1 dtype float N/A N/A cafilter H N/A array N/A N/A 1 0 0 dtype float N/A cafilter N/A generate_data N/A N/A steady_count noise_factor N/A N/A N/A t N/A ManeuveringTarget x0 0 y0 0 v0 0.3 heading 0 N/A xs N/A N/A ys N/A N/A i N/A range 30 N/A N/A N/A x y N/A N/A t update N/A N/A N/A xs append x N/A N/A N/A ys append y N/A N/A N/A t set_commanded_heading 310 25 N/A N/A N/A t set_commanded_speed 1 15 N/A i N/A range steady_count N/A N/A N/A x y N/A N/A t update N/A N/A N/A xs append x N/A N/A N/A ys append y N/A ns N/A NoisySensor noise_factor noise_factor N/A pos N/A array N/A list N/A zip xs ys N/A zs N/A array N/A N/A N/A ns sense p N/A p pos N/A N/A pos zs N/A test_imm N/A N/A N/A N/A N/A  this test is drawn from Crassidis [1], example 4.6.

    ** References**

    [1] Crassidis. "Optimal Estimation of Dynamic Systems", CRC Press,
    Second edition.
     N/A r 1.0 N/A dt 1.0 N/A phi_sim N/A N/A np array N/A N/A 1 dt 0 0 N/A 0 1 0 0 N/A 0 0 1 dt N/A 0 0 0 1 N/A gam N/A N/A np array N/A N/A N/A N/A dt 2 2 0 N/A dt 0 N/A 0 N/A N/A dt 2 2 N/A 0 dt N/A x N/A N/A N/A np array N/A N/A 2000 0 10000 -15.0 T N/A simxs N/A N/A N 600 N/A i N/A range N N/A N/A x N/A N/A np dot phi_sim x N/A N/A i 400 N/A N/A x N/A N/A np dot gam N/A N/A N/A np array N/A N/A 0.075 0.075 T N/A N/A N/A simxs append x N/A simxs N/A N/A np array simxs N/A zs N/A N/A np zeros N/A N 2 N/A i N/A range N/A len zs N/A N/A N/A zs N/A N/A i 0 N/A N/A simxs N/A N/A i 0 N/A N/A randn r N/A N/A zs N/A N/A i 1 N/A N/A simxs N/A N/A i 2 N/A N/A randn r N/A N/A N/A zs_tmp N/A N/A N/A np genfromtxt c:/users/rlabbe/dropbox/Crassidis/mycode/xx.csv delimiter , N/A -1 N/A zs zs_tmp N/A N/A N/A N/A N/A ca N/A KalmanFilter 6 2 N/A cano N/A KalmanFilter 6 2 N/A dt2 N/A N/A dt 2 2 N/A N/A ca F N/A N/A np array N/A N/A 1 dt dt2 0 0 0 N/A 0 1 dt 0 0 0 N/A 0 0 1 0 0 0 N/A 0 0 0 1 dt dt2 N/A 0 0 0 0 1 dt N/A 0 0 0 0 0 1 N/A N/A cano F N/A N/A N/A ca F copy N/A N/A ca x N/A N/A N/A np array N/A N/A 2000.0 0 0 10000 -15 0 T N/A N/A cano x N/A N/A N/A ca x copy N/A N/A ca P 1e-12 N/A N/A cano P 1e-12 N/A N/A ca R N/A r 2 N/A N/A cano R N/A r 2 N/A N/A cano Q 0 N/A q N/A N/A N/A np array N/A N/A 0.05 0.125 N/A 1 6 N/A 0.125 N/A 1 3 0.5 N/A N/A 1 6 0.5 1 0.001 N/A N/A N/A ca Q N/A N/A 0 3 N/A 0 3 q N/A N/A N/A ca Q N/A N/A 3 6 N/A 3 6 q N/A N/A ca H N/A N/A np array N/A N/A 1 0 0 0 0 0 N/A 0 0 0 1 0 0 N/A N/A cano H N/A N/A N/A ca H copy N/A filters N/A ca cano N/A trans N/A N/A np array N/A N/A 0.97 0.03 N/A 0.03 0.97 N/A bank N/A IMMEstimator filters N/A 0.5 0.5 trans N/A N/A xs probs N/A N/A N/A N/A N/A cvxs caxs N/A N/A N/A N/A N/A i z N/A enumerate N/A zs N/A 0 10 N/A N/A z N/A N/A N/A np array N/A z T N/A N/A N/A bank update z N/A N/A N/A xs append N/A N/A N/A bank x copy N/A N/A N/A cvxs append N/A N/A N/A ca x copy N/A N/A N/A caxs append N/A N/A N/A cano x copy N/A N/A N/A probs append N/A N/A N/A bank mu copy N/A DO_PLOT N/A N/A xs N/A N/A np array xs N/A cvxs N/A N/A np array cvxs N/A caxs N/A N/A np array caxs N/A probs N/A N/A np array probs N/A N/A N/A plt subplot 121 N/A N/A N/A plt plot N/A xs N/A N/A N/A 0 N/A xs N/A N/A N/A 3 k N/A N/A N/A plt scatter N/A zs N/A N/A N/A 0 N/A zs N/A N/A N/A 1 marker + alpha 0.2 N/A N/A N/A plt subplot 122 N/A N/A N/A plt plot N/A probs N/A N/A N/A 0 N/A N/A N/A plt plot N/A probs N/A N/A N/A 1 N/A N/A N/A plt ylim -1.5 1.5 N/A N/A N/A plt title probability ratio p(cv)/p(ca) N/A plt.figure()
        plt.plot(cvxs, label='CV')
        plt.plot(caxs, label='CA')
        plt.plot(xs[:, 0], label='GT')
        plt.legend()

        plt.figure()
        plt.plot(xs)
        plt.plot(xs[:, 0]) N/A N/A N/A __name__ __main__ N/A N/A DO_PLOT True N/A N/A test_imm