Ejemplo n.º 1
0
    def addDefaultArgs(self, parser):

        parser.add_argument('-c', '--bot-config', '--config_file', dest='config_file',
                            metavar='filename', type=str, help='Robot cfg file')

        parser.add_argument('--matlab-host', metavar='hostname', type=str,
                            help='hostname to connect with external matlab server')

        directorConfig = parser.add_mutually_exclusive_group(required=False)
        directorConfig.add_argument('--director-config', '--director_config', dest='directorConfigFile',
                                    type=str, default='', metavar='filename',
                                    help='JSON file specifying which urdfs to use')

        if director.getDRCBaseIsSet():
            self.addDirectorConfigShortcuts(directorConfig)
            parser.set_defaults(directorConfigFile=self.getDefaultDirectorConfigFile(),
                                config_file=self.getDefaultBotConfigFile())

        parser.add_argument('data_files', type=str, nargs='*',
                            default=[], action='append', metavar='filename',
                            help='data files to load at startup')

        parser.add_argument('--data', type=str, nargs='+', dest='data_files',
                            default=[], action='append', metavar='filename',
                            help='data files to load at startup')

        parser.add_argument('--script', '--startup', type=str, nargs='+', dest='scripts',
                            default=[], action='append', metavar='filename',
                            help='python scripts to run at startup')
Ejemplo n.º 2
0
 def getHandUrdfFullPath(self):
     if director.getDRCBaseIsSet():
         urdfBase = os.path.join(
             getDRCBaseDir(),
             'software/models/common_components/hand_factory')
     else:
         urdfBase = drcargs.DirectorConfig.getDefaultInstance().dirname
     return os.path.join(urdfBase, self.handUrdf)
Ejemplo n.º 3
0
    def addDefaultArgs(self, parser):

        parser.add_argument('-c',
                            '--bot-config',
                            '--config_file',
                            dest='config_file',
                            metavar='filename',
                            type=str,
                            help='Robot cfg file')

        parser.add_argument(
            '--matlab-host',
            metavar='hostname',
            type=str,
            help='hostname to connect with external matlab server')

        directorConfig = parser.add_mutually_exclusive_group(required=False)
        directorConfig.add_argument(
            '--director-config',
            '--director_config',
            dest='directorConfigFile',
            type=str,
            default='',
            metavar='filename',
            help='JSON file specifying which urdfs to use')

        if director.getDRCBaseIsSet():
            self.addDirectorConfigShortcuts(directorConfig)
            parser.set_defaults(
                directorConfigFile=self.getDefaultDirectorConfigFile(),
                config_file=self.getDefaultBotConfigFile())

        parser.add_argument('data_files',
                            type=str,
                            nargs='*',
                            default=[],
                            action='append',
                            metavar='filename',
                            help='data files to load at startup')

        parser.add_argument('--data',
                            type=str,
                            nargs='+',
                            dest='data_files',
                            default=[],
                            action='append',
                            metavar='filename',
                            help='data files to load at startup')

        parser.add_argument('--script',
                            '--startup',
                            type=str,
                            nargs='+',
                            dest='scripts',
                            default=[],
                            action='append',
                            metavar='filename',
                            help='python scripts to run at startup')
Ejemplo n.º 4
0
def startup(globals):

    global _mainWindow
    _mainWindow = globals["_mainWindow"]

    if not director.getDRCBaseIsSet():
        showErrorMessage("director_drs package cannot be found")
        return

    _mainWindow.connect("resetCamera()", resetCamera)
    _mainWindow.connect("toggleStereoRender()", toggleStereoRender)
    _mainWindow.connect("toggleCameraTerrainMode()", toggleCameraTerrainMode)

    setupViewManager()
Ejemplo n.º 5
0
 def getHandUrdfFullPath(self):
     if director.getDRCBaseIsSet():
         urdfBase = os.path.join(getDRCBaseDir(), 'software/models/common_components/hand_factory')
     else:
         urdfBase = drcargs.DirectorConfig.getDefaultInstance().dirname
     return os.path.join(urdfBase, self.handUrdf)