Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

import sys 

from director import drcargs 

from director import mainwindowapp 

 

# todo: 

# this check is required because openhumanoids 

# does not yet have robotlocomotion/lcmtypes 

try: 

    import robotlocomotion as lcmrl 

    HAVE_LCMRL = True 

except ImportError: 

    HAVE_LCMRL = False 

 

 

def main(globalsDict=None): 

 

    if '--testing' not in sys.argv: 

        drcargs.requireStrict() 

 

    appName = 'Drake Visualizer' 

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

 

    fact = mainwindowapp.MainWindowPanelFactory() 

 

    options = fact.getDefaultOptions() 

    fact.setDependentOptions(options, 

        useTreeViewer=HAVE_LCMRL, 

        useDrakeVisualizer=True, 

        useLCMGLRenderer=True) 

 

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

 

    if globalsDict is not None: 

        for d in [app, fields]: 

            globalsDict.update(**dict(d)) 

 

    app.app.start() 

 

 

if __name__ == '__main__': 

    main(globals())