__main__.py 2.26 KB
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
1
from argparse import ArgumentParser
Guilhem Saurel's avatar
Guilhem Saurel committed
2

Guilhem Saurel's avatar
Guilhem Saurel committed
3
from . import robots_loader
4

5
ROBOTS = [
Carlos Mastalli's avatar
Carlos Mastalli committed
6
    'anymal', 'anymal_kinova', 'hyq', 'solo', 'solo12', 'talos', 'talos_arm', 'talos_legs', 'kinova', 'tiago',
Guilhem Saurel's avatar
Guilhem Saurel committed
7
    'tiago_no_hand', 'icub', 'ur5', 'romeo'
8
]
9

Guilhem Saurel's avatar
Guilhem Saurel committed
10
11
12
13
14
parser = ArgumentParser()
parser.add_argument('robot', nargs='?', default=ROBOTS[0], choices=ROBOTS)

args = parser.parse_args()

15
16
17
18
19
if args.robot == 'anymal':
    anymal = robots_loader.loadANYmal()
    anymal.initViewer(loadModel=True)
    anymal.display(anymal.q0)

20
21
22
23
24
elif args.robot == 'anymal_kinova':
    anymal = robots_loader.loadANYmal(withArm='kinova')
    anymal.initViewer(loadModel=True)
    anymal.display(anymal.q0)

25
elif args.robot == 'hyq':
Guilhem Saurel's avatar
Guilhem Saurel committed
26
    hyq = robots_loader.loadHyQ()
Carlos Mastalli's avatar
Carlos Mastalli committed
27
    hyq.initViewer(loadModel=True)
28
29
    hyq.display(hyq.q0)

30
elif args.robot == 'solo':
Carlos Mastalli's avatar
Carlos Mastalli committed
31
32
33
34
    solo = robots_loader.loadSolo()
    solo.initViewer(loadModel=True)
    solo.display(solo.q0)

35
elif args.robot == 'solo12':
Carlos Mastalli's avatar
Carlos Mastalli committed
36
37
38
39
    solo = robots_loader.loadSolo(False)
    solo.initViewer(loadModel=True)
    solo.display(solo.q0)

Guilhem Saurel's avatar
Guilhem Saurel committed
40
elif args.robot == 'talos':
Guilhem Saurel's avatar
Guilhem Saurel committed
41
    talos = robots_loader.loadTalos()
Carlos Mastalli's avatar
Carlos Mastalli committed
42
    talos.initViewer(loadModel=True)
43
44
    talos.display(talos.q0)

Guilhem Saurel's avatar
Guilhem Saurel committed
45
elif args.robot == 'talos_arm':
Guilhem Saurel's avatar
Guilhem Saurel committed
46
    talos_arm = robots_loader.loadTalosArm()
Carlos Mastalli's avatar
Carlos Mastalli committed
47
    talos_arm.initViewer(loadModel=True)
48
49
    talos_arm.display(talos_arm.q0)

50
elif args.robot == 'talos_legs':
Guilhem Saurel's avatar
Guilhem Saurel committed
51
    talos_legs = robots_loader.loadTalosLegs()
52
53
54
    talos_legs.initViewer(loadModel=True)
    talos_legs.display(talos_legs.q0)

55
56
57
58
59
elif args.robot == 'kinova':
    kinova = robots_loader.loadKinova()
    kinova.initViewer(loadModel=True)
    kinova.display(kinova.q0)

Guilhem Saurel's avatar
Guilhem Saurel committed
60
elif args.robot == 'tiago':
Guilhem Saurel's avatar
Guilhem Saurel committed
61
    tiago = robots_loader.loadTiago()
Carlos Mastalli's avatar
Carlos Mastalli committed
62
    tiago.initViewer(loadModel=True)
63
64
    tiago.display(tiago.q0)

Guilhem Saurel's avatar
Guilhem Saurel committed
65
elif args.robot == 'tiago_no_hand':
Guilhem Saurel's avatar
Guilhem Saurel committed
66
    tiago_no_hand = robots_loader.loadTiagoNoHand()
Carlos Mastalli's avatar
Carlos Mastalli committed
67
    tiago_no_hand.initViewer(loadModel=True)
68
69
    tiago_no_hand.display(tiago_no_hand.q0)

Guilhem Saurel's avatar
Guilhem Saurel committed
70
elif args.robot == 'icub':
Guilhem Saurel's avatar
Guilhem Saurel committed
71
    icub = robots_loader.loadICub()
Carlos Mastalli's avatar
Carlos Mastalli committed
72
    icub.initViewer(loadModel=True)
73
    icub.display(icub.q0)
Guilhem Saurel's avatar
Guilhem Saurel committed
74
75
76
77
78

elif args.robot == 'ur5':
    ur5 = robots_loader.loadUR()
    ur5.initViewer(loadModel=True)
    ur5.display(ur5.q0)
Guilhem Saurel's avatar
Guilhem Saurel committed
79
80
81
82
83

elif args.robot == 'romeo':
    romeo = robots_loader.loadRomeo()
    romeo.initViewer(loadModel=True)
    romeo.display(romeo.q0)