• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python util.build_SIL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中util.build_SIL函数的典型用法代码示例。如果您正苦于以下问题:Python build_SIL函数的具体用法?Python build_SIL怎么用?Python build_SIL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了build_SIL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: fly_CopterAVC

def fly_CopterAVC(viewerip=None, map=False):
    '''fly ArduCopter in SIL for AVC2013 mission
    '''
    global homeloc

    if TARGET != 'sitl':
        util.build_SIL('ArduCopter', target=TARGET)

    home = "%f,%f,%u,%u" % (AVCHOME.lat, AVCHOME.lng, AVCHOME.alt, AVCHOME.heading)
    sil = util.start_SIL('ArduCopter', wipe=True, model='heli', home=home, speedup=speedup_default)
    mavproxy = util.start_MAVProxy_SIL('ArduCopter', options='--sitl=127.0.0.1:5501 --out=127.0.0.1:19550')
    mavproxy.expect('Received [0-9]+ parameters')

    # setup test parameters
    mavproxy.send("param load %s/Helicopter.parm\n" % testdir)
    mavproxy.expect('Loaded [0-9]+ parameters')

    # reboot with new parameters
    util.pexpect_close(mavproxy)
    util.pexpect_close(sil)

    sil = util.start_SIL('ArduCopter', model='heli', home=home, speedup=speedup_default)
    options = '--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --streamrate=5'
    if viewerip:
        options += ' --out=%s:14550' % viewerip
    if map:
        options += ' --map'
    mavproxy = util.start_MAVProxy_SIL('ArduCopter', options=options)
    mavproxy.expect('Telemetry log: (\S+)')
    logfile = mavproxy.match.group(1)
    print("LOGFILE %s" % logfile)

    buildlog = util.reltopdir("../buildlogs/CopterAVC-test.tlog")
    print("buildlog=%s" % buildlog)
    if os.path.exists(buildlog):
        os.unlink(buildlog)
    try:
        os.link(logfile, buildlog)
    except Exception:
        pass

    # the received parameters can come before or after the ready to fly message
    mavproxy.expect(['Received [0-9]+ parameters', 'Ready to FLY'])
    mavproxy.expect(['Received [0-9]+ parameters', 'Ready to FLY'])

    util.expect_setup_callback(mavproxy, expect_callback)

    expect_list_clear()
    expect_list_extend([sil, mavproxy])

    if map:
        mavproxy.send('map icon 40.072467969730496 -105.2314389590174\n')
        mavproxy.send('map icon 40.072600990533829 -105.23146100342274\n')        

    # get a mavlink connection going
    try:
        mav = mavutil.mavlink_connection('127.0.0.1:19550', robust_parsing=True)
    except Exception, msg:
        print("Failed to start mavlink connection on 127.0.0.1:19550" % msg)
        raise
开发者ID:CHRADI,项目名称:ardupilot,代码行数:60,代码来源:arducopter.py


示例2: run_step

def run_step(step):
    '''run one step'''
    if step == "prerequesites":
        return test_prerequesites()

    if step == 'build.ArduPlane':
        return util.build_SIL('ArduPlane')

    if step == 'build.APMrover2':
        return util.build_SIL('APMrover2')

    if step == 'build.ArduCopter':
        return util.build_SIL('ArduCopter')

    if step == 'build2560.ArduCopter':
        return util.build_AVR('ArduCopter', board='mega2560')

    if step == 'build2560.ArduPlane':
        return util.build_AVR('ArduPlane', board='mega2560')

    if step == 'build2560.APMrover2':
        return util.build_AVR('APMrover2', board='mega2560')

    if step == 'defaults.ArduPlane':
        return get_default_params('ArduPlane')

    if step == 'defaults.ArduCopter':
        return get_default_params('ArduCopter')

    if step == 'defaults.APMrover2':
        return get_default_params('APMrover2')

    if step == 'fly.ArduCopter':
        return arducopter.fly_ArduCopter(viewerip=opts.viewerip, map=opts.map)

    if step == 'fly.CopterAVC':
        return arducopter.fly_CopterAVC(viewerip=opts.viewerip, map=opts.map)

    if step == 'fly.ArduPlane':
        return arduplane.fly_ArduPlane(viewerip=opts.viewerip, map=opts.map)

    if step == 'drive.APMrover2':
        return apmrover2.drive_APMrover2(viewerip=opts.viewerip, map=opts.map, console=opts.console)

    if step == 'build.All':
        return build_all()

    if step == 'build.Binaries':
        return build_binaries()

    if step == 'build.Examples':
        return build_examples()

    if step == 'build.Parameters':
        return build_parameters()

    if step == 'convertgpx':
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:robolamp,项目名称:rAutotest,代码行数:60,代码来源:autotest-opt.py


示例3: run_step

def run_step(step):
    '''run one step'''

    # remove old logs
    util.run_cmd('/bin/rm -f logs/*.BIN logs/LASTLOG.TXT')

    if step == "prerequisites":
        return test_prerequisites()

    if step == 'build.ArduPlane':
        return util.build_SIL('ArduPlane')

    if step == 'build.APMrover2':
        return util.build_SIL('APMrover2')

    if step == 'build.ArduCopter':
        return util.build_SIL('ArduCopter')

    if step == 'defaults.ArduPlane':
        return get_default_params('ArduPlane')

    if step == 'defaults.ArduCopter':
        return get_default_params('ArduCopter')

    if step == 'defaults.APMrover2':
        return get_default_params('APMrover2')

    if step == 'fly.ArduCopter':
        return arducopter.fly_ArduCopter(viewerip=opts.viewerip, map=opts.map)

    if step == 'fly.CopterAVC':
        return arducopter.fly_CopterAVC(viewerip=opts.viewerip, map=opts.map)

    if step == 'fly.ArduPlane':
        return arduplane.fly_ArduPlane(viewerip=opts.viewerip, map=opts.map)

    if step == 'drive.APMrover2':
        return apmrover2.drive_APMrover2(viewerip=opts.viewerip, map=opts.map)

    if step == 'build.All':
        return build_all()

    if step == 'build.Binaries':
        return build_binaries()

    if step == 'build.DevRelease':
        return build_devrelease()

    if step == 'build.Examples':
        return build_examples()

    if step == 'build.Parameters':
        return build_parameters()

    if step == 'convertgpx':
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:cfluking,项目名称:ardupilot,代码行数:58,代码来源:autotest.py


示例4: run_step

def run_step(step):

    # Process any flags to be passed into build
    myFlags=None
    if opts.incremental == True:
        myFlags = { 'incremental': True }

    '''run one step'''
    if step == "prerequesites":
        return test_prerequesites()

    if step == 'build.ArduPlane':
        return util.build_SIL('ArduPlane', flags=myFlags)

    if step == 'build.ArduCopter':
        return util.build_SIL('ArduCopter', flags=myFlags )

    if step == 'build2560.ArduCopter':
        return util.build_AVR('ArduCopter', board='mega2560')

    if step == 'build2560.ArduPlane':
        return util.build_AVR('ArduPlane', board='mega2560')

    if step == 'defaults.ArduPlane':
        return get_default_params('ArduPlane')

    if step == 'defaults.ArduCopter':
        return get_default_params('ArduCopter')

    if step == 'fly.ArduCopter':
        return arducopter.fly_ArduCopter(viewerip=opts.viewerip, map=opts.map)

    if step == 'fly.CopterAVC':
        return arducopter.fly_CopterAVC(viewerip=opts.viewerip, map=opts.map)

    if step == 'fly.ArduPlane':
        return arduplane.fly_ArduPlane(viewerip=opts.viewerip, map=opts.map)

    if step == 'build.All':
        return build_all()

    if step == 'build.Binaries':
        return build_binaries()

    if step == 'build.Examples':
        return build_examples()

    if step == 'build.Parameters':
        return build_parameters()

    if step == 'convertgpx':
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:nwind21,项目名称:ardupilot,代码行数:54,代码来源:autotest_n21.py


示例5: run_step

def run_step(step):
    '''run one step'''
    if step == "prerequesites":
        return test_prerequesites()

    if step == 'build.ArduPlane':
        return util.build_SIL('ArduPlane')

    if step == 'build.ArduCopter':
        return util.build_SIL('ArduCopter')

    if step == 'build1280.ArduCopter':
        return util.build_AVR('ArduCopter', board='mega')

    if step == 'build2560.ArduCopter':
        return util.build_AVR('ArduCopter', board='mega2560')

    if step == 'build1280.ArduPlane':
        return util.build_AVR('ArduPlane', board='mega')

    if step == 'build2560.ArduPlane':
        return util.build_AVR('ArduPlane', board='mega2560')

    if step == 'defaults.ArduPlane':
        return get_default_params('ArduPlane')

    if step == 'defaults.ArduCopter':
        return get_default_params('ArduCopter')

    if step == 'logs.ArduPlane':
        return dump_logs('ArduPlane')

    if step == 'logs.ArduCopter':
        return dump_logs('ArduCopter')

    if step == 'fly.ArduCopter':
        return arducopter.fly_ArduCopter(viewerip=opts.viewerip)

    if step == 'fly.ArduPlane':
        if not opts.experimental:
            print("DISABLED: use --experimental to enable fly.ArduPlane")
            return True
        return arduplane.fly_ArduPlane(viewerip=opts.viewerip)

    if step == 'convertgpx':
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:BernieLiu,项目名称:ardupilotone,代码行数:48,代码来源:autotest.py


示例6: run_step

def run_step(step):
    '''run one step'''
    if step == "prerequesites":
        return test_prerequesites()

    if step == 'build.ArduPlane':
        return util.build_SIL('ArduPlane')

    if step == 'build.ArduCopter':
        return util.build_SIL('ArduCopter')

    if step == 'build1280.ArduCopter':
        return util.build_AVR('ArduCopter', board='mega')

    if step == 'build2560.ArduCopter':
        return util.build_AVR('ArduCopter', board='mega2560')

    if step == 'build1280.ArduPlane':
        return util.build_AVR('ArduPlane', board='mega')

    if step == 'build2560.ArduPlane':
        return util.build_AVR('ArduPlane', board='mega2560')

    if step == 'defaults.ArduPlane':
        return get_default_params('ArduPlane')

    if step == 'defaults.ArduCopter':
        return get_default_params('ArduCopter')

    if step == 'logs.ArduPlane':
        return dump_logs('ArduPlane')

    if step == 'logs.ArduCopter':
        return dump_logs('ArduCopter')

    if step == 'fly.ArduCopter':
        return arducopter.fly_ArduCopter(viewerip=opts.viewerip)

    if step == 'fly.ArduPlane':
        return arduplane.fly_ArduPlane(viewerip=opts.viewerip)

    if step == 'build.All':
        return build_all()

    if step == 'convertgpx':
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:mmcguinn,项目名称:UML-S12-UAV,代码行数:48,代码来源:autotest.py


示例7: fly_ArduCopter

def fly_ArduCopter(viewerip=None, map=False):
    '''fly ArduCopter in SIL

    you can pass viewerip as an IP address to optionally send fg and
    mavproxy packets too for local viewing of the flight in real time
    '''
    global homeloc

    if TARGET != 'sitl':
        util.build_SIL('ArduCopter', target=TARGET)

    home = "%f,%f,%u,%u" % (HOME.lat, HOME.lng, HOME.alt, HOME.heading)
    sil = util.start_SIL('ArduCopter', wipe=True, model='+', home=home, speedup=speedup_default)
    mavproxy = util.start_MAVProxy_SIL('ArduCopter', options='--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter')
    mavproxy.expect('Received [0-9]+ parameters')

    # setup test parameters
    mavproxy.send("param load %s/copter_params.parm\n" % testdir)
    mavproxy.expect('Loaded [0-9]+ parameters')

    # reboot with new parameters
    util.pexpect_close(mavproxy)
    util.pexpect_close(sil)

    sil = util.start_SIL('ArduCopter', model='+', home=home, speedup=speedup_default)
    options = '--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter --streamrate=5'
    if viewerip:
        options += ' --out=%s:14550' % viewerip
    if map:
        options += ' --map'
    mavproxy = util.start_MAVProxy_SIL('ArduCopter', options=options)
    mavproxy.expect('Telemetry log: (\S+)')
    logfile = mavproxy.match.group(1)
    print("LOGFILE %s" % logfile)

    buildlog = util.reltopdir("../buildlogs/ArduCopter-test.tlog")
    print("buildlog=%s" % buildlog)
    copyTLog = False
    if os.path.exists(buildlog):
        os.unlink(buildlog)
    try:
        os.link(logfile, buildlog)
    except Exception:
        print( "WARN: Failed to create symlink: " + logfile + " => " + buildlog + ", Will copy tlog manually to target location" )
        copyTLog = True

    # the received parameters can come before or after the ready to fly message
    mavproxy.expect(['Received [0-9]+ parameters', 'Ready to FLY'])
    mavproxy.expect(['Received [0-9]+ parameters', 'Ready to FLY'])

    util.expect_setup_callback(mavproxy, expect_callback)

    expect_list_clear()
    expect_list_extend([sil, mavproxy])

    # get a mavlink connection going
    try:
        mav = mavutil.mavlink_connection('127.0.0.1:19550', robust_parsing=True)
    except Exception, msg:
        print("Failed to start mavlink connection on 127.0.0.1:19550" % msg)
        raise
开发者ID:CHRADI,项目名称:ardupilot,代码行数:61,代码来源:arducopter.py


示例8: fly_CopterAVC

def fly_CopterAVC(viewerip=None, map=False):
    '''fly ArduCopter in SIL for AVC2013 mission
    '''
    global homeloc

    if TARGET != 'sitl':
        util.build_SIL('ArduCopter', target=TARGET)

    sim_cmd = util.reltopdir('Tools/autotest/pysim/sim_multicopter.py') + ' --frame=%s --rate=400 --home=%f,%f,%u,%u' % (
        FRAME, AVCHOME.lat, AVCHOME.lng, AVCHOME.alt, AVCHOME.heading)
    if viewerip:
        sim_cmd += ' --fgout=%s:5503' % viewerip

    sil = util.start_SIL('ArduCopter', wipe=True)
    mavproxy = util.start_MAVProxy_SIL('ArduCopter', options='--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter')
    mavproxy.expect('Received [0-9]+ parameters')

    # setup test parameters
    mavproxy.send('param set SYSID_THISMAV %u\n' % random.randint(100, 200))
    mavproxy.send("param load %s/CopterAVC.parm\n" % testdir)
    mavproxy.expect('Loaded [0-9]+ parameters')

    # reboot with new parameters
    util.pexpect_close(mavproxy)
    util.pexpect_close(sil)

    sil = util.start_SIL('ArduCopter', height=HOME.alt)
    sim = pexpect.spawn(sim_cmd, logfile=sys.stdout, timeout=10)
    sim.delaybeforesend = 0
    util.pexpect_autoclose(sim)
    options = '--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter --streamrate=5'
    if viewerip:
        options += ' --out=%s:14550' % viewerip
    if map:
        options += ' --map'
    mavproxy = util.start_MAVProxy_SIL('ArduCopter', options=options)
    mavproxy.expect('Logging to (\S+)')
    logfile = mavproxy.match.group(1)
    print("LOGFILE %s" % logfile)

    buildlog = util.reltopdir("../buildlogs/CopterAVC-test.tlog")
    print("buildlog=%s" % buildlog)
    if os.path.exists(buildlog):
        os.unlink(buildlog)
    os.link(logfile, buildlog)

    # the received parameters can come before or after the ready to fly message
    mavproxy.expect(['Received [0-9]+ parameters', 'Ready to FLY'])
    mavproxy.expect(['Received [0-9]+ parameters', 'Ready to FLY'])

    util.expect_setup_callback(mavproxy, expect_callback)

    expect_list_clear()
    expect_list_extend([sim, sil, mavproxy])

    if map:
        mavproxy.send('map icon 40.072467969730496 -105.2314389590174\n')
        mavproxy.send('map icon 40.072600990533829 -105.23146100342274\n')        

    # get a mavlink connection going
    try:
        mav = mavutil.mavlink_connection('127.0.0.1:19550', robust_parsing=True)
    except Exception, msg:
        print("Failed to start mavlink connection on 127.0.0.1:19550" % msg)
        raise
开发者ID:jschall,项目名称:ardupilot,代码行数:65,代码来源:arducopter.py


示例9: fly_ArduCopter

def fly_ArduCopter(viewerip=None):
    '''fly ArduCopter in SIL

    you can pass viewerip as an IP address to optionally send fg and
    mavproxy packets too for local viewing of the flight in real time
    '''
    global homeloc

    if TARGET != 'sitl':
        util.build_SIL('ArduCopter', target=TARGET)

    sim_cmd = util.reltopdir('Tools/autotest/pysim/sim_multicopter.py') + ' --frame=%s --rate=400 --home=%f,%f,%u,%u' % (
        FRAME, HOME.lat, HOME.lng, HOME.alt, HOME.heading)
    sim_cmd += ' --wind=6,45,.3'
    if viewerip:
        sim_cmd += ' --fgout=%s:5503' % viewerip

    sil = util.start_SIL('ArduCopter', wipe=True)
    mavproxy = util.start_MAVProxy_SIL('ArduCopter', options='--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter')
    mavproxy.expect('Received [0-9]+ parameters')

    # setup test parameters
    mavproxy.send('param set SYSID_THISMAV %u\n' % random.randint(100, 200))
    mavproxy.send("param load %s/ArduCopter.parm\n" % testdir)
    mavproxy.expect('Loaded [0-9]+ parameters')

    # reboot with new parameters
    util.pexpect_close(mavproxy)
    util.pexpect_close(sil)

    sil = util.start_SIL('ArduCopter', height=HOME.alt)
    sim = pexpect.spawn(sim_cmd, logfile=sys.stdout, timeout=10)
    sim.delaybeforesend = 0
    util.pexpect_autoclose(sim)
    options = '--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter --streamrate=5'
    if viewerip:
        options += ' --out=%s:14550' % viewerip
    mavproxy = util.start_MAVProxy_SIL('ArduCopter', options=options)
    mavproxy.expect('Logging to (\S+)')
    logfile = mavproxy.match.group(1)
    print("LOGFILE %s" % logfile)

    buildlog = util.reltopdir("../buildlogs/ArduCopter-test.mavlog")
    print("buildlog=%s" % buildlog)
    if os.path.exists(buildlog):
        os.unlink(buildlog)
    os.link(logfile, buildlog)

    # the received parameters can come before or after the ready to fly message
    mavproxy.expect(['Received [0-9]+ parameters', 'Ready to FLY'])
    mavproxy.expect(['Received [0-9]+ parameters', 'Ready to FLY'])

    util.expect_setup_callback(mavproxy, expect_callback)

    expect_list_clear()
    expect_list_extend([sim, sil, mavproxy])

    # get a mavlink connection going
    try:
        mav = mavutil.mavlink_connection('127.0.0.1:19550', robust_parsing=True)
    except Exception, msg:
        print("Failed to start mavlink connection on 127.0.0.1:19550" % msg)
        raise
开发者ID:dbaldwin,项目名称:ardupilot,代码行数:63,代码来源:arducopter.py


示例10: run_step

def run_step(step):
    '''run one step'''

    # remove old logs
    util.run_cmd('/bin/rm -f logs/*.BIN logs/LASTLOG.TXT')

    if step == "prerequisites":
        return test_prerequisites()

    if step == 'build.ArduPlane':
        return util.build_SIL('bin/arduplane', j=opts.j, debug=opts.debug)

    if step == 'build.APMrover2':
        return util.build_SIL('bin/ardurover', j=opts.j, debug=opts.debug)

    if step == 'build.ArduCopter':
        return util.build_SIL('bin/arducopter-quad', j=opts.j, debug=opts.debug)

    if step == 'build.AntennaTracker':
        return util.build_SIL('bin/antennatracker', j=opts.j, debug=opts.debug)

    if step == 'build.Helicopter':
        return util.build_SIL('bin/arducopter-heli', j=opts.j, debug=opts.debug)

    binary = binary_path(step, debug=opts.debug)

    if step == 'defaults.ArduPlane':
        return get_default_params('ArduPlane', binary)

    if step == 'defaults.ArduCopter':
        return get_default_params('ArduCopter', binary)

    if step == 'defaults.APMrover2':
        return get_default_params('APMrover2', binary)

    if step == 'fly.ArduCopter':
        return arducopter.fly_ArduCopter(binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb)

    if step == 'fly.CopterAVC':
        return arducopter.fly_CopterAVC(binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb)

    if step == 'fly.ArduPlane':
        return arduplane.fly_ArduPlane(binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb)

    if step == 'fly.QuadPlane':
        return quadplane.fly_QuadPlane(binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb)

    if step == 'drive.APMrover2':
        return apmrover2.drive_APMrover2(binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb)

    if step == 'build.All':
        return build_all()

    if step == 'build.Binaries':
        return build_binaries()

    if step == 'build.DevRelease':
        return build_devrelease()

    if step == 'build.Examples':
        return build_examples()

    if step == 'build.Parameters':
        return build_parameters()

    if step == 'convertgpx':
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:A-Manzoori,项目名称:ardupilot,代码行数:69,代码来源:autotest.py


示例11: fly_ArduCopter

def fly_ArduCopter(viewerip=None, map=False):
    """fly ArduCopter in SIL

    you can pass viewerip as an IP address to optionally send fg and
    mavproxy packets too for local viewing of the flight in real time
    """
    global homeloc

    if TARGET != "sitl":
        util.build_SIL("ArduCopter", target=TARGET)

    sim_cmd = util.reltopdir(
        "Tools/autotest/pysim/sim_multicopter.py"
    ) + " --frame=%s --rate=400 --home=%f,%f,%u,%u" % (FRAME, HOME.lat, HOME.lng, HOME.alt, HOME.heading)
    sim_cmd += " --wind=6,45,.3"
    if viewerip:
        sim_cmd += " --fgout=%s:5503" % viewerip

    sil = util.start_SIL("ArduCopter", wipe=True)
    mavproxy = util.start_MAVProxy_SIL("ArduCopter", options="--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter")
    mavproxy.expect("Received [0-9]+ parameters")

    # setup test parameters
    mavproxy.send("param load %s/copter_params.parm\n" % testdir)
    mavproxy.expect("Loaded [0-9]+ parameters")

    # reboot with new parameters
    util.pexpect_close(mavproxy)
    util.pexpect_close(sil)

    sil = util.start_SIL("ArduCopter", height=HOME.alt)
    sim = pexpect.spawn(sim_cmd, logfile=sys.stdout, timeout=10)
    sim.delaybeforesend = 0
    util.pexpect_autoclose(sim)
    options = "--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter --streamrate=5"
    if viewerip:
        options += " --out=%s:14550" % viewerip
    if map:
        options += " --map"
    mavproxy = util.start_MAVProxy_SIL("ArduCopter", options=options)
    mavproxy.expect("Logging to (\S+)")
    logfile = mavproxy.match.group(1)
    print("LOGFILE %s" % logfile)

    buildlog = util.reltopdir("../buildlogs/ArduCopter-test.tlog")
    print("buildlog=%s" % buildlog)
    copyTLog = False
    if os.path.exists(buildlog):
        os.unlink(buildlog)
    try:
        os.link(logfile, buildlog)
    except Exception:
        print(
            "WARN: Failed to create symlink: "
            + logfile
            + " => "
            + buildlog
            + ", Will copy tlog manually to target location"
        )
        copyTLog = True

    # the received parameters can come before or after the ready to fly message
    mavproxy.expect(["Received [0-9]+ parameters", "Ready to FLY"])
    mavproxy.expect(["Received [0-9]+ parameters", "Ready to FLY"])

    util.expect_setup_callback(mavproxy, expect_callback)

    expect_list_clear()
    expect_list_extend([sim, sil, mavproxy])

    # get a mavlink connection going
    try:
        mav = mavutil.mavlink_connection("127.0.0.1:19550", robust_parsing=True)
    except Exception, msg:
        print("Failed to start mavlink connection on 127.0.0.1:19550" % msg)
        raise
开发者ID:MarkMote,项目名称:ardupilot,代码行数:76,代码来源:arducopter.py


示例12: run_step

def run_step(step):
    """run one step"""

    # remove old logs
    util.run_cmd("/bin/rm -f logs/*.BIN logs/LASTLOG.TXT")

    if step == "prerequisites":
        return test_prerequisites()

    if step == "build.ArduPlane":
        return util.build_SIL("ArduPlane")

    if step == "build.APMrover2":
        return util.build_SIL("APMrover2")

    if step == "build.ArduCopter":
        return util.build_SIL("ArduCopter")

    if step == "build2560.ArduCopter":
        return util.build_AVR("ArduCopter", board="mega2560")

    if step == "build2560.ArduPlane":
        return util.build_AVR("ArduPlane", board="mega2560")

    if step == "build2560.APMrover2":
        return util.build_AVR("APMrover2", board="mega2560")

    if step == "defaults.ArduPlane":
        return get_default_params("ArduPlane")

    if step == "defaults.ArduCopter":
        return get_default_params("ArduCopter")

    if step == "defaults.APMrover2":
        return get_default_params("APMrover2")

    if step == "fly.ArduCopter":
        return arducopter.fly_ArduCopter(viewerip=opts.viewerip, map=opts.map)

    if step == "fly.CopterAVC":
        return arducopter.fly_CopterAVC(viewerip=opts.viewerip, map=opts.map)

    if step == "fly.ArduPlane":
        return arduplane.fly_ArduPlane(viewerip=opts.viewerip, map=opts.map)

    if step == "drive.APMrover2":
        return apmrover2.drive_APMrover2(viewerip=opts.viewerip, map=opts.map)

    if step == "build.All":
        return build_all()

    if step == "build.Binaries":
        return build_binaries()

    if step == "build.DevRelease":
        return build_devrelease()

    if step == "build.Examples":
        return build_examples()

    if step == "build.Parameters":
        return build_parameters()

    if step == "convertgpx":
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:travmason,项目名称:ardupilot-mpng,代码行数:67,代码来源:autotest.py


示例13: fly_CopterAVC

def fly_CopterAVC(viewerip=None, map=False):
    """fly ArduCopter in SIL for AVC2013 mission
    """
    global homeloc

    if TARGET != "sitl":
        util.build_SIL("ArduCopter", target=TARGET)

    sim_cmd = util.reltopdir("Tools/autotest/pysim/sim_multicopter.py") + " --frame=%s --home=%f,%f,%u,%u" % (
        FRAME,
        AVCHOME.lat,
        AVCHOME.lng,
        AVCHOME.alt,
        AVCHOME.heading,
    )
    if viewerip:
        sim_cmd += " --fgout=%s:5505" % viewerip
    sim = pexpect.spawn(sim_cmd, logfile=sys.stdout, timeout=10)
    sim.delaybeforesend = 0
    util.pexpect_autoclose(sim)

    sil = util.start_SIL("ArduCopter", wipe=True)
    mavproxy = util.start_MAVProxy_SIL("ArduCopter", options="--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter")
    mavproxy.expect("Received [0-9]+ parameters")

    # setup test parameters
    mavproxy.send("param load %s/copter_AVC2013_params.parm\n" % testdir)
    # mavproxy.send("param load %s/copter_params.parm\n" % testdir)
    mavproxy.expect("Loaded [0-9]+ parameters")

    # reboot with new parameters
    util.pexpect_close(mavproxy)
    util.pexpect_close(sil)

    sil = util.start_SIL("ArduCopter", height=HOME.alt)

    options = "--sitl=127.0.0.1:5501 --out=127.0.0.1:19550 --quadcopter --streamrate=5"
    if viewerip:
        options += " --out=%s:14550" % viewerip
    if map:
        options += " --map"
    mavproxy = util.start_MAVProxy_SIL("ArduCopter", options=options)
    mavproxy.expect("Logging to (\S+)")
    logfile = mavproxy.match.group(1)
    print("LOGFILE %s" % logfile)

    buildlog = util.reltopdir("../buildlogs/CopterAVC-test.tlog")
    print("buildlog=%s" % buildlog)
    if os.path.exists(buildlog):
        os.unlink(buildlog)
    try:
        os.link(logfile, buildlog)
    except Exception:
        pass

    # the received parameters can come before or after the ready to fly message
    mavproxy.expect(["Received [0-9]+ parameters", "Ready to FLY"])
    mavproxy.expect(["Received [0-9]+ parameters", "Ready to FLY"])

    util.expect_setup_callback(mavproxy, expect_callback)

    expect_list_clear()
    expect_list_extend([sim, sil, mavproxy])

    if map:
        mavproxy.send("map icon 40.072467969730496 -105.2314389590174\n")
        mavproxy.send("map icon 40.072600990533829 -105.23146100342274\n")

    # get a mavlink connection going
    try:
        mav = mavutil.mavlink_connection("127.0.0.1:19550", robust_parsing=True)
    except Exception, msg:
        print("Failed to start mavlink connection on 127.0.0.1:19550" % msg)
        raise
开发者ID:nwind21,项目名称:ardupilot,代码行数:74,代码来源:arducopter.py


示例14: run_step

def run_step(step):
    """run one step"""

    # remove old logs
    util.run_cmd("/bin/rm -f logs/*.BIN logs/LASTLOG.TXT")

    if step == "prerequisites":
        return test_prerequisites()

    if step == "build.ArduPlane":
        return util.build_SIL("bin/arduplane", j=opts.j, debug=opts.debug)

    if step == "build.APMrover2":
        return util.build_SIL("bin/ardurover", j=opts.j, debug=opts.debug)

    if step == "build.ArduCopter":
        return util.build_SIL("bin/arducopter-quad", j=opts.j, debug=opts.debug)

    if step == "build.AntennaTracker":
        return util.build_SIL("bin/antennatracker", j=opts.j, debug=opts.debug)

    if step == "build.Helicopter":
        return util.build_SIL("bin/arducopter-heli", j=opts.j, debug=opts.debug)

    binary = binary_path(step, debug=opts.debug)

    if step == "defaults.ArduPlane":
        return get_default_params("ArduPlane", binary)

    if step == "defaults.ArduCopter":
        return get_default_params("ArduCopter", binary)

    if step == "defaults.APMrover2":
        return get_default_params("APMrover2", binary)

    if step == "fly.ArduCopter":
        return arducopter.fly_ArduCopter(
            binary, viewerip=opts.viewerip, use_map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb
        )

    if step == "fly.CopterAVC":
        return arducopter.fly_CopterAVC(
            binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb
        )

    if step == "fly.ArduPlane":
        return arduplane.fly_ArduPlane(
            binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb
        )

    if step == "fly.QuadPlane":
        return quadplane.fly_QuadPlane(
            binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb
        )

    if step == "drive.APMrover2":
        return apmrover2.drive_APMrover2(
            binary, viewerip=opts.viewerip, map=opts.map, valgrind=opts.valgrind, gdb=opts.gdb
        )

    if step == "build.All":
        return build_all()

    if step == "build.Binaries":
        return build_binaries()

    if step == "build.DevRelease":
        return build_devrelease()

    if step == "build.Examples":
        return build_examples()

    if step == "build.Parameters":
        return build_parameters()

    if step == "convertgpx":
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:senosahisnu,项目名称:ardupilot,代码行数:79,代码来源:autotest.py


示例15: run_step

def run_step(step):
    """run one step"""
    if step == "prerequesites":
        return test_prerequesites()

    if step == "build.ArduPlane":
        return util.build_SIL("ArduPlane")

    if step == "build.APMrover2":
        return util.build_SIL("APMrover2")

    if step == "build.ArduCopter":
        return util.build_SIL("ArduCopter")

    if step == "build2560.ArduCopter":
        return util.build_AVR("ArduCopter", board="mega2560")

    if step == "build2560.ArduPlane":
        return util.build_AVR("ArduPlane", board="mega2560")

    if step == "build2560.APMrover2":
        return util.build_AVR("APMrover2", board="mega2560")

    if step == "defaults.ArduPlane":
        return get_default_params("ArduPlane")

    if step == "defaults.ArduCopter":
        return get_default_params("ArduCopter")

    if step == "defaults.APMrover2":
        return get_default_params("APMrover2")

    if step == "logs.ArduPlane":
        return dump_logs("ArduPlane")

    if step == "logs.ArduCopter":
        return dump_logs("ArduCopter")

    if step == "logs.CopterAVC":
        return dump_logs("ArduCopter", "CopterAVC")

    if step == "logs.APMrover2":
        return dump_logs("APMrover2")

    if step == "fly.ArduCopter":
        return arducopter.fly_ArduCopter(viewerip=opts.viewerip, map=opts.map)

    if step == "fly.CopterAVC":
        return arducopter.fly_CopterAVC(viewerip=opts.viewerip, map=opts.map)

    if step == "fly.ArduPlane":
        return arduplane.fly_ArduPlane(viewerip=opts.viewerip, map=opts.map)

    if step == "drive.APMrover2":
        return apmrover2.drive_APMrover2(viewerip=opts.viewerip, map=opts.map)

    if step == "build.All":
        return build_all()

    if step == "build.Binaries":
        return build_binaries()

    if step == "build.Examples":
        return build_examples()

    if step == "build.Parameters":
        return build_parameters()

    if step == "convertgpx":
        return convert_gpx()

    raise RuntimeError("Unknown step %s" % step)
开发者ID:brnjones,项目名称:ardupilot,代码行数:72,代码来源:autotest.py



注:本文中的util.build_SIL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.build_context_script函数代码示例发布时间:2022-05-27
下一篇:
Python util.between函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap