当前位置: 首页>>代码示例>>Python>>正文


Python ConsoleApp.start方法代码示例

本文整理汇总了Python中ddapp.consoleapp.ConsoleApp.start方法的典型用法代码示例。如果您正苦于以下问题:Python ConsoleApp.start方法的具体用法?Python ConsoleApp.start怎么用?Python ConsoleApp.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ddapp.consoleapp.ConsoleApp的用法示例。


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

示例1: main

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
def main():
    global app, view, nav_data

    nav_data = np.array([[0, 0, 0]])

    lcmUtils.addSubscriber(".*_NAV$", node_nav_t, handleNavData)

    app = ConsoleApp()

    app.setupGlobals(globals())
    app.showPythonConsole()

    view = app.createView()
    view.show()

    global d
    d = DebugData()
    d.addLine([0,0,0], [1,0,0], color=[0,1,0])
    d.addSphere((0,0,0), radius=0.02, color=[1,0,0])

    #vis.showPolyData(d.getPolyData(), 'my debug geometry', colorByName='RGB255')

    startSwarmVisualization()

    app.start()
开发者ID:nicrip,项目名称:moos-ivp-swarm,代码行数:27,代码来源:swarm_visualize.py

示例2: main

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
def main():
    app = ConsoleApp()
    camVis = CameraVisualizer()
    camVis.createUI()
    camVis.showUI()    
    
    app.start()
开发者ID:mlab-upenn,项目名称:arch-apex,代码行数:9,代码来源:cameraViewer.py

示例3: main

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
def main():

    app = ConsoleApp()

    view = app.createView(useGrid=False)
    imageManager = cameraview.ImageManager()
    cameraView = cameraview.CameraView(imageManager, view)

    view.show()
    app.start()
开发者ID:mlab-upenn,项目名称:arch-apex,代码行数:12,代码来源:testCameraView.py

示例4: robotMain

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
def robotMain(useDrivingGains=False, useController=True):

    print 'waiting for robot state...'
    commandStream.waitForRobotState()
    print 'starting.'
    commandStream.timer.targetFps = 1000

    if useController==True:
        commandStream.useController()
    else:
        commandStream.publishChannel = 'ATLAS_COMMAND'

    if useDrivingGains:
        commandStream.applyDrivingDefaults()

    commandStream.startStreaming()
    positionListener = PositionGoalListener()
    planListener = CommittedRobotPlanListener()
    ConsoleApp.start()
开发者ID:mlab-upenn,项目名称:arch-apex,代码行数:21,代码来源:testAtlasCommand.py

示例5: main

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
def main():

    app = ConsoleApp()

    view = app.createView(useGrid=False)
    view.orientationMarkerWidget().Off()
    view.backgroundRenderer().SetBackground([0,0,0])
    view.backgroundRenderer().SetBackground2([0,0,0])


    cameraChannel = parseChannelArgument()
    imageManager = cameraview.ImageManager()
    imageManager.queue.addCameraStream(cameraChannel)
    imageManager.addImage(cameraChannel)


    cameraView = cameraview.CameraImageView(imageManager, cameraChannel, view=view)
    cameraView.eventFilterEnabled = False
    view.renderWindow().GetInteractor().SetInteractorStyle(vtk.vtkInteractorStyleImage())


    view.show()
    app.start()
开发者ID:mlab-upenn,项目名称:arch-apex,代码行数:25,代码来源:testImageView.py

示例6: ConsoleApp

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
from ddapp.consoleapp import ConsoleApp
from ddapp.debugVis import DebugData
import ddapp.visualization as vis

# initialize application components
app = ConsoleApp()
view = app.createView()
view.showMaximized()

# create a sphere primitive
d = DebugData()
d.addSphere(center=(0,0,0), radius=0.5)

# show the sphere in the visualization window
sphere = vis.showPolyData(d.getPolyData(), 'sphere')
sphere.setProperty('Color', [0,1,0])

# start the application
app.start()
开发者ID:caomw,项目名称:director,代码行数:21,代码来源:drawShapes.py

示例7: globals

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
app.setupGlobals(globals())

view = app.createView()
robotsystem.create(view, globals())


playbackPanel = playbackpanel.PlaybackPanel(planPlayback, playbackRobotModel, playbackJointController,
                                  robotStateModel, robotStateJointController, manipPlanner)

teleopPanel = teleoppanel.TeleopPanel(robotStateModel, robotStateJointController, teleopRobotModel, teleopJointController,
                 ikPlanner, manipPlanner, affordanceManager, playbackPanel.setPlan, playbackPanel.hidePlan)

manipPlanner.connectPlanReceived(playbackPanel.setPlan)


ikServer.connectStartupCompleted(onIkStartup)
startIkServer()


w = QtGui.QWidget()
l = QtGui.QGridLayout(w)
l.addWidget(view, 0, 0)
l.addWidget(playbackPanel.widget, 1, 0)
l.addWidget(teleopPanel.widget, 0, 1, 2, 1)
l.setMargin(0)
l.setSpacing(0)
w.show()
w.resize(1600, 900)

app.start(enableAutomaticQuit=False)
开发者ID:mlab-upenn,项目名称:arch-apex,代码行数:32,代码来源:testTeleopPanel.py

示例8: main

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
def main():

    atlasdriver.init()
    panel = atlasdriverpanel.AtlasDriverPanel(atlasdriver.driver)
    panel.widget.show()
    ConsoleApp.start()
开发者ID:mlab-upenn,项目名称:arch-apex,代码行数:8,代码来源:testAtlasDriver.py

示例9: Simulator

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
class Simulator(object):
    def __init__(
        self,
        percentObsDensity=20,
        endTime=40,
        randomizeControl=False,
        nonRandomWorld=False,
        circleRadius=0.7,
        worldScale=1.0,
        supervisedTrainingTime=500,
        autoInitialize=True,
        verbose=True,
        sarsaType="discrete",
    ):
        self.verbose = verbose
        self.randomizeControl = randomizeControl
        self.startSimTime = time.time()
        self.collisionThreshold = 1.3
        self.randomSeed = 5
        self.Sarsa_numInnerBins = 4
        self.Sarsa_numOuterBins = 4
        self.Sensor_rayLength = 8
        self.sarsaType = sarsaType

        self.percentObsDensity = percentObsDensity
        self.supervisedTrainingTime = 10
        self.learningRandomTime = 10
        self.learningEvalTime = 10
        self.defaultControllerTime = 10
        self.nonRandomWorld = nonRandomWorld
        self.circleRadius = circleRadius
        self.worldScale = worldScale
        # create the visualizer object
        self.app = ConsoleApp()
        # view = app.createView(useGrid=False)
        self.view = self.app.createView(useGrid=False)

        self.initializeOptions()
        self.initializeColorMap()
        if autoInitialize:
            self.initialize()

    def initializeOptions(self):
        self.options = dict()

        self.options["Reward"] = dict()
        self.options["Reward"]["actionCost"] = 0.1
        self.options["Reward"]["collisionPenalty"] = 100.0
        self.options["Reward"]["raycastCost"] = 20.0

        self.options["SARSA"] = dict()
        self.options["SARSA"]["type"] = "discrete"
        self.options["SARSA"]["lam"] = 0.7
        self.options["SARSA"]["alphaStepSize"] = 0.2
        self.options["SARSA"]["useQLearningUpdate"] = False
        self.options["SARSA"]["epsilonGreedy"] = 0.2
        self.options["SARSA"]["burnInTime"] = 500
        self.options["SARSA"]["epsilonGreedyExponent"] = 0.3
        self.options["SARSA"]["exponentialDiscountFactor"] = 0.05  # so gamma = e^(-rho*dt)
        self.options["SARSA"]["numInnerBins"] = 5
        self.options["SARSA"]["numOuterBins"] = 4
        self.options["SARSA"]["binCutoff"] = 0.5

        self.options["World"] = dict()
        self.options["World"]["obstaclesInnerFraction"] = 0.85
        self.options["World"]["randomSeed"] = 40
        self.options["World"]["percentObsDensity"] = 7.5
        self.options["World"]["nonRandomWorld"] = True
        self.options["World"]["circleRadius"] = 1.75
        self.options["World"]["scale"] = 1.0

        self.options["Sensor"] = dict()
        self.options["Sensor"]["rayLength"] = 10
        self.options["Sensor"]["numRays"] = 20

        self.options["Car"] = dict()
        self.options["Car"]["velocity"] = 12

        self.options["dt"] = 0.05

        self.options["runTime"] = dict()
        self.options["runTime"]["supervisedTrainingTime"] = 10
        self.options["runTime"]["learningRandomTime"] = 10
        self.options["runTime"]["learningEvalTime"] = 10
        self.options["runTime"]["defaultControllerTime"] = 10

    def setDefaultOptions(self):

        defaultOptions = dict()

        defaultOptions["Reward"] = dict()
        defaultOptions["Reward"]["actionCost"] = 0.1
        defaultOptions["Reward"]["collisionPenalty"] = 100.0
        defaultOptions["Reward"]["raycastCost"] = 20.0

        defaultOptions["SARSA"] = dict()
        defaultOptions["SARSA"]["type"] = "discrete"
        defaultOptions["SARSA"]["lam"] = 0.7
        defaultOptions["SARSA"]["alphaStepSize"] = 0.2
        defaultOptions["SARSA"]["useQLearningUpdate"] = False
#.........这里部分代码省略.........
开发者ID:peteflorence,项目名称:Machine-Learning-6.867-homework,代码行数:103,代码来源:simulator.py

示例10: debugMain

# 需要导入模块: from ddapp.consoleapp import ConsoleApp [as 别名]
# 或者: from ddapp.consoleapp.ConsoleApp import start [as 别名]
def debugMain():

    listener = DebugAtlasCommandListener()
    ConsoleApp.start()
开发者ID:mlab-upenn,项目名称:arch-apex,代码行数:6,代码来源:testAtlasCommand.py


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