-
Notifications
You must be signed in to change notification settings - Fork 0
/
quad____mp.py
59 lines (43 loc) · 1.36 KB
/
quad____mp.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#HW1 for RBE 595/CS 525 Motion Planning
#code based on the simplemanipulation.py example
from __future__ import division
from __future__ import with_statement # for python 2.5
import time
import openravepy as rave
import argparse
import parser
#import navigation
#import test
if not __openravepy_build_doc__:
from openravepy import *
from numpy import *
def waitrobot(robot):
"""busy wait for robot completion"""
while not robot.GetController().IsDone():
time.sleep(0.01)
def parse_args():
ap = argparse.ArgumentParser()
ap.add_argument('--verbose', action='store_true')
ap.add_argument('--test', action='store_true')
ap.add_argument('--params', default='params/quadrotor.yaml')
return ap.parse_args()
@rave.with_destroy
def run():
args = parse_args()
params = parser.Yaml(file_name=args.params)
env = rave.Environment()
env.SetViewer('qtcoin')
env.Reset()
# load a scene from ProjectRoom environment XML file
env.Load(params.scene)
env.UpdatePublishedBodies()
time.sleep(0.1)
# 1) get the 1st robot that is inside the loaded scene
# 2) assign it to the variable named 'robot'
robot = env.GetRobots()[0]
raw_input("Press enter to exit...")
if __name__ == "__main__":
rave.RaveSetDebugLevel(rave.DebugLevel.Verbose)
run()