Esempio n. 1
0
def makeRobotSystem(view):
    factory = robotsystem.RobotSystemFactory()
    options = factory.getDisabledOptions()
    factory.setDependentOptions(options,
                                usePlannerPublisher=True,
                                useTeleop=True)
    return factory.construct(view=view, options=options)
Esempio n. 2
0
def makeRobotSystem(view):

    '''
    args = dict()

    urdfFile = drcargs.getDirectorConfig()['urdfConfig']['ik']
    colorMode = drcargs.getDirectorConfig()['colorMode']

    robotStateModel, robotStateJointController = roboturdf.loadRobotModel('robot model', view, urdfFile=urdfFile, colorMode=colorMode)

    robotStateModel.setProperty('Color Mode', 'Textures')

    handFactory = roboturdf.HandFactory(robotStateModel)
    handModels = []

    for side in ['left', 'right']:
        if side in handFactory.defaultHandTypes:
            handModels.append(handFactory.getLoader(side))

    ikPlanner = ikplanner.IKPlanner(None, robotStateModel, robotStateJointController, handModels)

    manipPlanner = None #robotplanlistener.ManipulationPlanDriver(ikPlanner)

    return FieldContainer(
      robotStateModel=robotStateModel,
      robotStateJointController=robotStateJointController,
      directorConfig=drcargs.getDirectorConfig(),
      ikPlanner=ikPlanner,
      manipPlanner=manipPlanner,
      footstepsDriver=None,
      )
    '''

    factory = robotsystem.RobotSystemFactory()

    options = factory.getDisabledOptions()
    options.useDirectorConfig = True
    options.useRobotState = True
    options.usePlanning = True
    options.usePlayback = True
    options.useAffordances = True
    options.usePlannerPublisher = True
    options.useTeleop = True

    robotSystem = factory.construct(view=view, options=options)
    return robotSystem
    print constraintsJsonStr

    print '--------------decoding--------------------'
    constraints = ce.decodeConstraints(constraintsJsonStr)
    pprint.pprint(constraints)

    print '--------------reconstructing--------------'
    constraints = reconstructConstraints(constraints)

    print '--------------matlab commands---------------'
    for c in constraints:
        c.printCommands()



app = ConsoleApp()
view = app.createView()


factory = robotsystem.RobotSystemFactory()
options = factory.getDisabledOptions()
factory.setDependentOptions(options, usePlannerPublisher=True)
robotSystem = factory.construct(view=view, options=options)


app.setupGlobals(globals())
globals().update(dict(robotSystem))


testPlanConstraints()