def run_vio(build_dir, dataset_dir, dataset_name, results_dir,
    pipeline_output_dir, pipeline_type, extra_flagfile_path=''):
    """ Runs pipeline depending on the pipeline_type"""
    import subprocess
    return subprocess.call(
        '{}/stereoVIOEuroc                            --logtostderr=1 --colorlogtostderr=1 --log_prefix=0                            --dataset_path={}/{} --output_path={}                           --vio_params_path={}/params/{}/{}                            --tracker_params_path={}/params/{}/{}                            --flagfile={}/params/{}/{} --flagfile={}/params/{}/{}                            --flagfile={}/params/{}/{} --flagfile={}/params/{}/{}                            --flagfile={}/params/{}/{} --flagfile={}/params/{}/{}                            --log_output=True'
        .format(build_dir, dataset_dir, dataset_name, pipeline_output_dir,
        results_dir, pipeline_type, 'regularVioParameters.yaml',
        results_dir, pipeline_type, 'trackerParameters.yaml', results_dir,
        pipeline_type, 'flags/stereoVIOEuroc.flags', results_dir,
        pipeline_type, 'flags/Mesher.flags', results_dir, pipeline_type,
        'flags/VioBackEnd.flags', results_dir, pipeline_type,
        'flags/RegularVioBackEnd.flags', results_dir, pipeline_type,
        'flags/Visualizer3D.flags', results_dir, pipeline_type,
        extra_flagfile_path), shell=True)
