Esempio n. 1
0
                    'name': 'Fixed-Wing',
                    'color': HTML_color_to_RGB(vtol_modes_table[2][1])
                },
                {
                    'name': 'Multicopter',
                    'color': HTML_color_to_RGB(vtol_modes_table[3][1])
                },
            ]
            curdoc().template_variables['vtol_modes'] = vtol_modes

            link_to_3d_page = '3d?log=' + log_id
            link_to_pid_analysis_page = '?plots=pid_analysis&log=' + log_id

            try:
                plots = generate_plots(ulog, px4_ulog, db_data, vehicle_data,
                                       link_to_3d_page,
                                       link_to_pid_analysis_page)

                title = 'Flight Review - ' + px4_ulog.get_mav_type()

            except Exception as error:
                # catch all errors to avoid showing a blank page. Note that if we
                # get here, there's a bug somewhere that needs to be fixed!
                traceback.print_exc()

                title, error_message, plots = show_exception_page()

    else:

        title = 'Error'
Esempio n. 2
0
    # read the description from DB
    log_description = ''
    try:
        con = sqlite3.connect(get_db_filename(), detect_types=sqlite3.PARSE_DECLTYPES)
        cur = con.cursor()
        cur.execute('select Description from Logs where Id = ?', [log_id])
        db_tuple = cur.fetchone()
        if db_tuple != None:
            log_description = db_tuple[0]
        cur.close()
        con.close()
    except:
        print("DB access failed:", sys.exc_info()[0], sys.exc_info()[1])


    plots = generate_plots(ulog, px4_ulog, flight_mode_changes, log_description)

    title = 'Flight Review - '+px4_ulog.get_mav_type()

else:

    title = 'Error'

    div = Div(text="<h3>"+error_message+"</h3>", width=int(plot_width*0.9))
    plots = [ widgetbox(div, width = int(plot_width*0.9)) ]


# layout
layout = column(plots, sizing_mode='scale_width')
curdoc().add_root(layout)
curdoc().title = title
Esempio n. 3
0
            },
            {
                'name': 'Fixed-Wing',
                'color': HTML_color_to_RGB(vtol_modes_table[2][1])
            },
            {
                'name': 'Multicopter',
                'color': HTML_color_to_RGB(vtol_modes_table[3][1])
            },
        ]
        curdoc().template_variables['vtol_modes'] = vtol_modes

        link_to_3d_page = '3d?log=' + log_id

        try:
            plots = generate_plots(ulog, px4_ulog, db_data, vehicle_data,
                                   link_to_3d_page)

            title = 'Flight Review - ' + px4_ulog.get_mav_type()

        except Exception as error:
            # catch all errors to avoid showing a blank page. Note that if we
            # get here, there's a bug somewhere that needs to be fixed!
            traceback.print_exc()

            title = 'Internal Error'

            error_message = (
                '<h3>Internal Server Error</h3>'
                '<p>Please open an issue on <a '
                'href="https://github.com/PX4/flight_review/issues" target="_blank">'
                'https://github.com/PX4/flight_review/issues</a> with a link '
Esempio n. 4
0
            {
                'name': 'Transition',
                'color': HTML_color_to_RGB(vtol_modes_table[1][1])
            },
            {
                'name': 'Fixed-Wing',
                'color': HTML_color_to_RGB(vtol_modes_table[2][1])
            },
            {
                'name': 'Multicopter',
                'color': HTML_color_to_RGB(vtol_modes_table[3][1])
            },
        ]
        curdoc().template_variables['vtol_modes'] = vtol_modes

        plots = generate_plots(ulog, px4_ulog, db_data, vehicle_data)

        title = 'Flight Review - ' + px4_ulog.get_mav_type()

    else:

        title = 'Error'

        div = Div(text="<h3>" + error_message + "</h3>",
                  width=int(plot_width * 0.9))
        plots = [widgetbox(div, width=int(plot_width * 0.9))]

    # layout
    layout = column(plots, sizing_mode='scale_width')
    curdoc().add_root(layout)
    curdoc().title = title
Esempio n. 5
0
    curdoc().template_variables['is_plot_page'] = True
    curdoc().template_variables['log_id'] = log_id
    flight_modes = [
        {'name': 'Manual', 'color': HTML_color_to_RGB(flight_modes_table[0][1])},
        {'name': 'Altitude Control', 'color': HTML_color_to_RGB(flight_modes_table[1][1])},
        {'name': 'Position Control', 'color': HTML_color_to_RGB(flight_modes_table[2][1])},
        {'name': 'Acro', 'color': HTML_color_to_RGB(flight_modes_table[6][1])},
        {'name': 'Stabilized', 'color': HTML_color_to_RGB(flight_modes_table[8][1])},
        {'name': 'Offboard', 'color': HTML_color_to_RGB(flight_modes_table[7][1])},
        {'name': 'Rattitude', 'color': HTML_color_to_RGB(flight_modes_table[9][1])},
        {'name': 'Auto (Mission, RTL, Follow, ...)',
         'color': HTML_color_to_RGB(flight_modes_table[3][1])}
        ]
    curdoc().template_variables['flight_modes'] = flight_modes

    plots = generate_plots(ulog, px4_ulog, flight_mode_changes, db_data,
                           vehicle_data)

    title = 'Flight Review - '+px4_ulog.get_mav_type()


else:

    title = 'Error'

    div = Div(text="<h3>"+error_message+"</h3>", width=int(plot_width*0.9))
    plots = [widgetbox(div, width=int(plot_width*0.9))]


# layout
layout = column(plots, sizing_mode='scale_width')
curdoc().add_root(layout)
Esempio n. 6
0
    flight_modes = []
    for flight_mode in hawk.mestate.mlog._flightmodes:
        (mode_name, t_start, t_end) = flight_mode
        flight_modes.append(
            (mode_name, (t_start - hawk.mestate.mlog.min_timestamp) * 1.0e6,
             (t_end - hawk.mestate.mlog.min_timestamp) * 1.0e6))

    plots = []

    from bokeh.models.widgets import TextInput
    from functools import partial

    #     text_input = TextInput(value="", title="Custom Plot Expression")
    #     text_input.on_change("value", partial(custom_plot_handler, hawk = hawk, colors = colors, flight_modes = flight_modes))
    #
    plots = generate_plots(hawk, graphs, colors, flight_modes, plots=plots)

    del hawk

    title = 'Analysis'
    layout = column(plots, name='mainLayout')
    curdoc().add_root(layout)

else:
    title = 'Error'

# layout
# layout = column([column([text_input], name='customLayout' )], name='mainLayout')#, sizing_mode='scale_width')

curdoc().title = title
print_timing("Plotting", start_time)