Ejemplo n.º 1
0
def launch_shell(args, logger, app_shutdown_token):
    """
    Launches an interactive python or IPython command line
    interface.
    As ODrives are connected they are made available as
    "odrv0", "odrv1", ...
    """

    interactive_variables = {
        'start_liveplotter': start_liveplotter,
        'dump_errors': dump_errors,
        'oscilloscope_dump': oscilloscope_dump,
        'BulkCapture': BulkCapture,
        'step_and_plot': step_and_plot,
        'calculate_thermistor_coeffs': calculate_thermistor_coeffs,
        'set_motor_thermistor_coeffs': set_motor_thermistor_coeffs,
        'run_motor_characterize_input': run_motor_characterize_input #ERG
    }

    # Expose all enums from odrive.enums
    interactive_variables.update({k: v for (k, v) in odrive.enums.__dict__.items() if not k.startswith("_")})

    fibre.launch_shell(args,
                       interactive_variables,
                       print_banner, print_help,
                       logger, app_shutdown_token,
                       branding_short="odrv", branding_long="ODrive")
Ejemplo n.º 2
0
def launch_shell(args, logger, app_shutdown_token):
    """
    Launches an interactive python or IPython command line
    interface.
    As ODrives are connected they are made available as
    "odrv0", "odrv1", ...
    """

    interactive_variables = {
        'start_liveplotter': start_liveplotter,
        'dump_errors': dump_errors,
        'oscilloscope_dump': oscilloscope_dump
    }

    # Expose all enums from odrive.enums
    interactive_variables.update({
        k: v
        for (k, v) in odrive.enums.__dict__.items() if not k.startswith("_")
    })

    fibre.launch_shell(args,
                       interactive_variables,
                       print_banner,
                       print_help,
                       logger,
                       app_shutdown_token,
                       branding_short="odrv",
                       branding_long="ODrive")
Ejemplo n.º 3
0
def launch_shell(args, logger):
    """
    Launches an interactive python or IPython command line
    interface.
    As ODrives are connected they are made available as
    "odrv0", "odrv1", ...
    """

    interactive_variables = {
        'start_liveplotter': start_liveplotter,
        'dump_errors': dump_errors,
        'benchmark': benchmark,
        'oscilloscope_dump': oscilloscope_dump,
        'dump_interrupts': dump_interrupts,
        'dump_threads': dump_threads,
        'dump_dma': dump_dma,
        'dump_timing': dump_timing,
        'BulkCapture': BulkCapture,
        'step_and_plot': step_and_plot,
        'calculate_thermistor_coeffs': calculate_thermistor_coeffs,
        'set_motor_thermistor_coeffs': set_motor_thermistor_coeffs
    }

    # Expose all enums from odrive.enums
    interactive_variables.update({
        k: v
        for (k, v) in odrive.enums.__dict__.items() if not k.startswith("_")
    })

    async def mount(obj):
        serial_number_str = await odrive.utils.get_serial_number_str(obj)
        if ((not args.serial_number is None)
                and (serial_number_str != args.serial_number)):
            return None  # reject this object
        if hasattr(obj, '_otp_valid_property'
                   ) and not await obj._otp_valid_property.read():
            logger.warn(
                "Device {}: Not a genuine ODrive! Some features may not work as expected."
                .format(serial_number_str))
            return ("device " + serial_number_str, "dev")
        return ("ODrive " + serial_number_str, "odrv")

    fibre.launch_shell(args, mount, interactive_variables, print_banner,
                       print_help, logger)
Ejemplo n.º 4
0
def launch_shell(args, logger, app_shutdown_token):
    """
    Launches an interactive python or IPython command line
    interface.
    As ODrives are connected they are made available as
    "odrv0", "odrv1", ...
    """

    interactive_variables = {
        'start_liveplotter': start_liveplotter,
        'dump_errors': dump_errors
    }

    # Expose all enums from odrive.enums
    interactive_variables.update({k: v for (k, v) in odrive.enums.__dict__.items() if not k.startswith("_")})

    fibre.launch_shell(args,
                       interactive_variables,
                       print_banner, print_help,
                       logger, app_shutdown_token,
                       branding_short="odrv", branding_long="ODrive")