merge with sim

This commit is contained in:
dave 2018-11-20 11:28:51 +01:00
commit 3173afda6e
4 changed files with 36 additions and 34 deletions

View File

@ -7,10 +7,10 @@ GPSlimit_CEPSUM = {.1={.lat=45.510400, .lng=-73.610421},
.3={.lat=45.510355, .lng=-73.608404}, .3={.lat=45.510355, .lng=-73.608404},
.4={.lat=45.509840, .lng=-73.610072}} .4={.lat=45.509840, .lng=-73.610072}}
GPSlimit_PANGEAE = {.1={.lat=29.02045, .lng=-13.71234}, GPSlimit_PANGEAE = {.1={.lat=29.067746, .lng=-13.663315},
.2={.lat=29.02131, .lng=-13.70961}, .2={.lat=29.068724, .lng=-13.662634},
.3={.lat=29.02061, .lng=-13.70933}, .3={.lat=29.068113, .lng=-13.661427},
.4={.lat=29.01966, .lng=-13.71203}} .4={.lat=29.067014, .lng=-13.661564}}
# Core naviguation function to travel to a GPS target location. # Core naviguation function to travel to a GPS target location.
function goto_gps(transf) { function goto_gps(transf) {

View File

@ -21,18 +21,18 @@ function rc_cmd_listen() {
} else { } else {
if(flight.rc_cmd==21) { if(flight.rc_cmd==21) {
flight.rc_cmd=0 flight.rc_cmd=0
#barrier_set(ROBOTS, "GOHOME", BVMSTATE, 21)
#barrier_ready(21)
BVMSTATE = "STOP" BVMSTATE = "STOP"
neighbors.broadcast("cmd", 21) neighbors.broadcast("cmd", 21)
} else if(flight.rc_cmd==20) { } else if(BVMSTATE!="BARRIERWAIT" and BVMSTATE!="LAUNCH") {
if(flight.rc_cmd==20) {
flight.rc_cmd=0 flight.rc_cmd=0
destroyGraph()
check_rc_wp()
AUTO_LAUNCH_STATE = "IDLE" AUTO_LAUNCH_STATE = "IDLE"
barrier_set(ROBOTS, "GOHOME", BVMSTATE, 20) barrier_set(ROBOTS, "GOHOME", BVMSTATE, 20)
barrier_ready(20) barrier_ready(20)
neighbors.broadcast("cmd", 20) neighbors.broadcast("cmd", 20)
} else if(BVMSTATE!="BARRIERWAIT" and BVMSTATE!="LAUNCH") { } else if (flight.rc_cmd==666){
if (flight.rc_cmd==666){
flight.rc_cmd=0 flight.rc_cmd=0
stattab_send() stattab_send()
} else if (flight.rc_cmd==900){ } else if (flight.rc_cmd==900){
@ -90,15 +90,17 @@ function nei_cmd_listen() {
reinit_time_sync() reinit_time_sync()
} }
} else { } else {
if(value==20) { if(value==21 ) {
AUTO_LAUNCH_STATE = "IDLE"
barrier_set(ROBOTS, "GOHOME", BVMSTATE, 20)
barrier_ready(20)
} else if(value==21 ) {
BVMSTATE = "STOP" BVMSTATE = "STOP"
#neighbors.broadcast("cmd", 777) #neighbors.broadcast("cmd", 777)
}else if(BVMSTATE!="BARRIERWAIT" and BVMSTATE!="LAUNCH") { }else if(BVMSTATE!="BARRIERWAIT" and BVMSTATE!="LAUNCH") {
if(value==900){ # Shapes if(value==20 and BVMSTATE!="GOHOME") {
AUTO_LAUNCH_STATE = "IDLE"
resetWP()
if(BVMSTATE!=AUTO_LAUNCH_STATE)
barrier_set(ROBOTS, "GOHOME", BVMSTATE, 20)
#barrier_ready(20)
} else if(value==900){ # Shapes
barrier_set(ROBOTS, "TASK_ALLOCATE", BVMSTATE, 900) barrier_set(ROBOTS, "TASK_ALLOCATE", BVMSTATE, 900)
#barrier_ready(900) #barrier_ready(900)
#neighbors.broadcast("cmd", 900) #neighbors.broadcast("cmd", 900)

View File

@ -1,10 +1,10 @@
1,-13.710661,29.020850,10.0,1 1,-13.662583,29.068509,10.0,1
2,-13.711061,29.020946,10.0,0 2,-13.661774,29.067843,10.0,0
3,-13.711605,29.020421,10.0,1 3,-13.661838,29.067285,10.0,1
4,-13.711925,29.020003,10.0,0 4,-13.662144,29.067923,10.0,0
5,-13.712166,29.020435,10.0,1 5,-13.662476,29.067670,10.0,1
6,-13.710498,29.020341,10.0,0 6,-13.663044,29.067843,10.0,0
7,-13.711506,29.019919,10.0,0 7,-13.661642,29.068001,10.0,0
8,-13.712048,29.020385,10.0,0 8,-13.662831,29.067993,10.0,0
9,-13.711514,29.020261,10.0,1 9,-13.662009,29.067586,10.0,1
10,-13.711621,29.020725,10.0,1 10,-13.662690,29.068369,10.0,1
1 1 -13.710661 -13.662583 29.020850 29.068509 10.0 1
2 2 -13.711061 -13.661774 29.020946 29.067843 10.0 0
3 3 -13.711605 -13.661838 29.020421 29.067285 10.0 1
4 4 -13.711925 -13.662144 29.020003 29.067923 10.0 0
5 5 -13.712166 -13.662476 29.020435 29.067670 10.0 1
6 6 -13.710498 -13.663044 29.020341 29.067843 10.0 0
7 7 -13.711506 -13.661642 29.019919 29.068001 10.0 0
8 8 -13.712048 -13.662831 29.020385 29.067993 10.0 0
9 9 -13.711514 -13.662009 29.020261 29.067586 10.0 1
10 10 -13.711621 -13.662690 29.020725 29.068369 10.0 1

View File

@ -17,9 +17,9 @@ takeoff_heights ={
.21 = 3.0, .21 = 3.0,
.22 = 3.0, .22 = 3.0,
.23 = 0.0, .23 = 0.0,
.24 = 38.0, .24 = 24.0,
.25 = 34.0, .25 = 18.0,
.26 = 25.0, .26 = 10.0,
.27 = 42.0, .27 = 28.0,
.28 = 29.0 .28 = 14.0
} }