-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbig_pool_mission.py
executable file
·62 lines (52 loc) · 1.59 KB
/
big_pool_mission.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
60
61
62
#!/usr/bin/env python
import roslib
roslib.load_manifest('zoidberg_nav')
import rospy
import time
from navigation_client import Command
# setup the command module
rospy.init_node('navigation_client')
co = Command()
#time_gp = 25
#time_out1 = 30
#time_gp_extra = 5
target_heading1 = 151.
time_out1 = 60
target_depth1 = 1
# 45 degrees off initial heading
target_heading2 = 195.5
time_out2 = 110
target_depth2 = 2.07
target_heading3 = 141.
time_out3 = 30
target_depth3 = 2
try:
# start the mission
rospy.sleep(20.)
co.begin()
# mission specifications
# first leg
co.dh_change(target_depth1, target_heading1, 20)
# 1650 is a safe speed
co.set_rc_velocity(1650, 1500,
target_depth1, target_heading1,
time_out1)
#is_togate = co.gate_pass(1650, 1500,
#target_depth1, target_heading1,
#time_gp)
# if gate_pass exits cleanly, drive for a bit to pass through gate
#if is_togate:
#co.set_rc_velocity(1650, 1500,
#target_depth1,
#target_heading1,
#time_gp_extra)
# second leg
co.dh_change(target_depth2, target_heading2, 20)
co.set_rc_velocity(1650, 1500, target_depth2, target_heading2, time_out2)
co.dh_change(target_depth3, target_heading3, 20)
co.set_rc_velocity(1650, 1500, target_depth3, target_heading3, time_out3)
except rospy.ROSInterruptException:
rospy.loginfo("Program interrupted")
finally:
# make sure communication is terminated cleanly
co.finished()