forked from mmatl/urdfpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (37 loc) · 1.02 KB
/
main.py
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 argparse
from urdfpy import Robot
def main(path:str, animate:bool=True, nogui:bool=False):
robot = Robot.load(path)
if not nogui:
if animate:
# robot.animate()
pass
else:
# robot.show()
pass
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
'path',
type=str,
help='Path to URDF file that describes the robot'
)
parser.add_argument(
'-a',
action='store_true',
help='Visualize robot articulation'
)
parser.add_argument(
'-c',
action='store_true',
help='Use collision geometry'
)
noGui = parser.add_argument(
'--nogui',
action='store_true',
help='skip the GUI renderring, for machines with no display'
)
args = parser.parse_args()
if args.nogui and args.a:
raise argparse.ArgumentError(noGui, "no gui cannot be set when -a (animation) is given")
main(args.path, args.a, args.nogui)