Beispiel #1
0
def main(globalsDict=None):

    if "--testing" not in sys.argv:
        drcargs.requireStrict()

    parser = drcargs.getGlobalArgParser().getParser()
    parser.add_argument(
        "--protocol", dest="visualizer_protocol", default="drake", type=str, help="Visualizer protocol (drake or json)"
    )
    args = drcargs.args()

    knownProtocols = ("drake", "json")
    if args.visualizer_protocol not in knownProtocols:
        print
        print "Unrecognized visualizer protocol:", args.visualizer_protocol
        print "Available protocols:", ", ".join(knownProtocols)
        print
        sys.exit(1)

    appName = "Drake Visualizer"
    app = mainwindowapp.MainWindowAppFactory().construct(
        globalsDict=globalsDict, windowTitle=appName, applicationName=appName
    )

    fact = mainwindowapp.MainWindowPanelFactory()
    options = fact.getDefaultOptions()
    options.useLCMGLRenderer = True

    if args.visualizer_protocol == "json":
        fact.setDependentOptions(options, useLCMVisualizer=True)
    elif args.visualizer_protocol == "drake":
        fact.setDependentOptions(options, useDrakeVisualizer=True)

    fact.construct(options, app=app.app, view=app.view)

    if globalsDict is not None:
        globalsDict.update(**dict(app))

    app.app.start()
Beispiel #2
0
from director import mainwindowapp
import corl.utils
from corl.rendertrainingimages import RenderTrainingImages
import os

if __name__ == '__main__':
    print os.getcwd()
    if os.path.isfile(os.path.join(os.getcwd(),
                                   "images/0000000001_labels.png")):
        print ""
        print "Already made labels? Skipping..."
        print "To re-extract, either move or delete ./images/"
        print ""
        quit()

    parser = drcargs.getGlobalArgParser().getParser()
    parser.add_argument(
        '--logFolder',
        type=str,
        dest='logFolder',
        help=
        'location of top level folder for this log, relative to CorlDev/data')
    parser.add_argument('-debugCorl', action='store_true')
    args = parser.parse_args()

    app = mainwindowapp.construct(disable_anti_alias=True)
    app.view.setParent(None)
    app.view.show()

    print "logFolder = ", args.logFolder