-
Notifications
You must be signed in to change notification settings - Fork 4
/
drone_functions.sh
59 lines (48 loc) · 1.71 KB
/
drone_functions.sh
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
function connect(){
#source ~/DRDO/run_all_pixhawk.sh
ssh root@uav1 "source jetson_px4.sh" &
ssh root@uav2 "source jetson_px4.sh" &
ssh root@uav3 "source jetson_px4.sh"
}
#/home/manik/Downloads/px4_clone/src
function arm(){
#source ~/DRDO/arm_drones.sh #complete
rosservice call /uav1/mavros/cmd/arming "value: true" &
rosservice call /uav2/mavros/cmd/arming "value: true" &
rosservice call /uav3/mavros/cmd/arming "value: true"
}
function takeoff(){
#source ~/DRDO/mission.sh #complete
rosservice call /uav1/mavros/set_mode "custom_mode: 'AUTO.MISSION'" &
rosservice call /uav2/mavros/set_mode "custom_mode: 'AUTO.MISSION'" &
rosservice call /uav3/mavros/set_mode "custom_mode: 'AUTO.MISSION'"
}
function return_home(){
#source ~/DRDO/mission.sh #complete
rosservice call /uav1/mavros/set_mode "custom_mode: 'AUTO.RTL'" &
rosservice call /uav2/mavros/set_mode "custom_mode: 'AUTO.RTL'" &
rosservice call /uav3/mavros/set_mode "custom_mode: 'AUTO.RTL'"
}
function disarm(){
#source ~/DRDO/disarm_drones.sh #complete
rosservice call /uav1/mavros/cmd/arming "value: false" &
rosservice call /uav2/mavros/cmd/arming "value: false" &
rosservice call /uav3/mavros/cmd/arming "value: false"
}
function detect_object(){
ssh aero@uav1 "source detect_object.sh" &
ssh aero@uav2 "source detect_object.sh" &
ssh aero@uav3 "source detect_object.sh"
}
function cluster_gps(){
source ~/DRDO/change_mode.sh
}
function plot_on_map(){
source ~/DRDO/change_mode.sh
}
function land(){
#source ~/DRDO/land.sh #complete
rosservice call /uav1/mavros/set_mode "custom_mode: 'AUTO.LAND'" &
rosservice call /uav2/mavros/set_mode "custom_mode: 'AUTO.LAND'" &
rosservice call /uav3/mavros/set_mode "custom_mode: 'AUTO.LAND'"
}