Example #1
0
def test_dmu380_sim():
    '''
    test Sim with DMU380 algorithm.
    '''
    print("This demo only runs on Ubuntu x64.")
    #### choose a built-in IMU model, typical for IMU380
    imu_err = 'mid-accuracy'
    # do not generate GPS and magnetometer data
    imu = imu_model.IMU(accuracy=imu_err, axis=9, gps=False)

    #### Algorithm
    # DMU380 algorithm
    from demo_algorithms import dmu380_sim
    cfg_file = os.path.abspath(
        './/demo_algorithms//dmu380_sim_lib//ekfSim_tilt.cfg')
    algo = dmu380_sim.DMU380Sim(cfg_file)

    #### start simulation
    sim = imu_sim.Sim([fs, 0.0, fs],
                      imu,
                      motion_def_path + "//motion_def-Komatsu_loaded_-5_0.csv",
                      ref_frame=1,
                      mode=None,
                      env=None,
                      algorithm=algo)
    sim.run(10)
    # generate simulation results, summary, and save data to files
    sim.results()  # do not save data
    # plot data
    sim.plot(['att_euler'])
Example #2
0
def test_dmu380_sim():
    '''
    test Sim with DMU380 algorithm.
    '''
    print("This demo only runs on Ubuntu x64.")
    #### choose a built-in IMU model, typical for IMU380
    imu_err = {
        'gyro_b': np.array([1.0, -1.0, 0.5]) * 1.0,
        'gyro_arw': np.array([0.25, 0.25, 0.25]) * 1.0,
        'gyro_b_stability': np.array([3.5, 3.5, 3.5]) * 1.0,
        'gyro_b_corr': np.array([100.0, 100.0, 100.0]),
        'accel_b': np.array([50.0e-3, 50.0e-3, 50.0e-3]),
        'accel_vrw': np.array([0.03119, 0.03009, 0.04779]) * 1.0,
        'accel_b_stability': np.array([4.29e-5, 5.72e-5, 8.02e-5]) * 1.0,
        'accel_b_corr': np.array([200.0, 200.0, 200.0]),
        'mag_std': np.array([0.2, 0.2, 0.2]) * 1.0
    }
    # do not generate GPS and magnetometer data
    imu = imu_model.IMU(accuracy=imu_err, axis=9, gps=False)

    #### Algorithm
    # DMU380 algorithm
    from demo_algorithms import dmu380_sim
    cfg_file = os.path.abspath(
        './/demo_algorithms//dmu380_sim_lib//ekfSim_tilt.cfg')
    algo = dmu380_sim.DMU380Sim(cfg_file)

    #### start simulation
    sim = ins_sim.Sim(
        [fs, 0.0, fs],
        #   motion_def_path+"//motion_def-static.csv",
        "//mnt//share//jd_figure8.csv",
        ref_frame=1,
        imu=imu,
        mode=None,
        env=None,  #'[0.1 0.01 0.11]g-random',
        algorithm=algo)
    sim.run(1)
    # generate simulation results, summary, and save data to files
    sim.results('aa')  # do not save data
    # plot data
    sim.plot(['att_euler', 'ref_pos'], opt={'ref_pos': 'projection'})