From c0399f1221d3b45ddd9013484af6060dd94b8b4b Mon Sep 17 00:00:00 2001 From: David St-Onge Date: Mon, 5 Dec 2016 17:57:20 -0500 Subject: [PATCH] m100 changes --- launch/rosbuzz.launch | 6 +- src/test.basm | 117 ++++++++++++++++++++++++++++ src/test.bdbg | Bin 0 -> 4422 bytes src/test.bo | Bin 0 -> 381 bytes src/test.bzz.save | 31 ++++++++ src/test1.basm | 175 ++++++++++++++++++++++++++++++++++++++++++ src/test1.bdbg | Bin 0 -> 7973 bytes src/test1.bo | Bin 0 -> 572 bytes src/test1.bzz | 14 +++- 9 files changed, 337 insertions(+), 6 deletions(-) create mode 100644 src/test.basm create mode 100644 src/test.bdbg create mode 100644 src/test.bo create mode 100644 src/test.bzz.save create mode 100644 src/test1.basm create mode 100644 src/test1.bdbg create mode 100644 src/test1.bo diff --git a/launch/rosbuzz.launch b/launch/rosbuzz.launch index 222f4db..885615f 100644 --- a/launch/rosbuzz.launch +++ b/launch/rosbuzz.launch @@ -2,12 +2,12 @@ - + - - + + diff --git a/src/test.basm b/src/test.basm new file mode 100644 index 0000000..849b53d --- /dev/null +++ b/src/test.basm @@ -0,0 +1,117 @@ +!16 +'init +'i +'step +'neighbors +'listen +'Take +'print +'Got ( +', +') from robot # +'key +'broadcast +'yes +'no +'reset +'destroy + + pushs 0 + pushcn @__label_1 + gstore + pushs 2 + pushcn @__label_2 + gstore + pushs 14 + pushcn @__label_7 + gstore + pushs 15 + pushcn @__label_8 + gstore + nop + +@__label_0 + +@__exitpoint + done + +@__label_1 + pushs 1 |3,2,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushi 1 |3,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + gstore |3,5,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + ret0 |4,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + +@__label_2 + pushs 1 |9,6,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + gload |9,6,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushi 0 |9,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + eq |9,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + jumpz @__label_3 |9,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 3 |10,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + gload |10,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 4 |10,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + tget |10,16,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 5 |10,17,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushl @__label_5 |11,3,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushi 2 |14,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + callc |14,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 3 |15,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + gload |15,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 4 |15,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + tget |15,16,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 10 |15,17,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushl @__label_6 |16,3,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushi 2 |19,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + callc |19,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + jump @__label_4 |21,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz +@__label_3 |21,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 3 |22,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + gload |22,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 11 |22,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + tget |22,19,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 10 |22,20,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 12 |22,27,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushi 2 |22,33,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + callc |22,33,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 3 |23,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + gload |23,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 11 |23,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + tget |23,19,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 5 |23,20,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 13 |23,28,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushi 2 |23,33,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + callc |23,33,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz +@__label_4 |24,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + ret0 |26,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + +@__label_5 + pushs 6 |12,11,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + gload |12,11,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 7 |12,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + lload 1 |12,24,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 8 |12,26,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + lload 2 |12,36,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 9 |12,38,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + lload 3 |12,59,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushi 6 |12,60,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + callc |12,60,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + ret0 |13,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + +@__label_6 + pushs 6 |17,11,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + gload |17,11,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 7 |17,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + lload 1 |17,24,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 8 |17,26,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + lload 2 |17,36,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushs 9 |17,38,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + lload 3 |17,59,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + pushi 6 |17,60,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + callc |17,60,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + ret0 |18,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + +@__label_7 + ret0 |30,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz + +@__label_8 + ret0 |34,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test.bzz diff --git a/src/test.bdbg b/src/test.bdbg new file mode 100644 index 0000000000000000000000000000000000000000..2630c1f6412eaa29420aa3a4f41ddd8e61668f70 GIT binary patch literal 4422 zcmbuDy)T1N6vkim{n7epeM^&42E=QzAd!g0qN2fIAeAN}p^5e#y!;gw3l&Y|W zo;#OHFE6Iu{MKr5I_dd-FfU~Dg`te^-&0h*iL8bchADBKiEM)u9w^F=;ZZ2mKnx?o zMF*ttBp4bXg;BwfgcP0yLnEXxAsG4~g%^rq|D}+^lwcTx6kaJRY9dK27`k&YEf~fj zg*S?_V|XWpW|O-NVwkaZks^h#6~hNbw-^Pi!^{!`@8(*l4xiQx^VSSsf&uGM3xa_= zu5MTF5d)ve5LC%;;evO!j$ui-!0wA5!4QL7>{Ari0XtbM!Uc9;{0bMHkc$K1q8w5< zq$u`JhJvA6&8(;cc4r+?R_+TG5JQL~TqyY-H(T~u1TI1vn7QQc}*5ksq~ zAf}KLmBjAuQ{e*ZlVNKYXMzFiv=PC8xhRNAVlR+$a>2Q=)r<-kShtS}1*}(ZTi3xS zg(kDBx!dW^#SSUNjRH-Bp;Ne^7`wIDrNrGPH^y)&7??%pqMZ_Rf9NtSI)y92z`qi7 z3UR@ZfEca?1HUVE3_aEiH^jhiS$>J=7?Q-mFAtgqL#NP7VcgxAMW=8}S?&IR=(lDV K5DM%@=i(1t6K910 literal 0 HcmV?d00001 diff --git a/src/test.bo b/src/test.bo new file mode 100644 index 0000000000000000000000000000000000000000..83617d55f32072cc3d32b01c390beda23583e98d GIT binary patch literal 381 zcmb7;O>V+45QQI511;sJs~{CAQ}Hix54J40K+?FaMQbD5o2Zi?qNBOZxEchrG*qFvd=o$i2&o z_bfz|I>0)39dtyYL-ei$fzR8KF{HZasnVY4Z%w9s(Ss;z#1~S*P*t9!?0A`;bjKqHhYITl5%DRW$Y(-`UR)(R?Ot(uQAKu& z8{aijQIlHCsbWJsk&T3~bB0sJS4w1tR>(I(%+wGyl!&7Auq&2eqm+nO3;eK=|vrR(X1iv#=W=)L}OZA zd=za1!dgo_@%@2RPh#RTwGt}kqyliM6w*(H*hfpJ7b{UnOH9QuR5T`p{W?{2 zK}Bm!#apPbBP%Y8!>QsO=Gohj_!Z?k*0t^w`=S~uf_-rW2-~g1zNi7hb}Rd^@3iwM z5VpE_;`;zZFp-;-h*-!+QXv*{3o5K1#9b>JPvlrUky=tA9-xnt3h~7E1qka4@k7iV zO2m?JHh6v9ixcF9cu;B}72MlDHSY$qVsY&Oaj8>}dc1 literal 0 HcmV?d00001 diff --git a/src/test1.bo b/src/test1.bo new file mode 100644 index 0000000000000000000000000000000000000000..3709d18b819d9a95f7e76fa5396a4d789e2a241f GIT binary patch literal 572 zcmb7AOHRWu5S>Cp`4&AAA5g}Elez@3~aSU7Dw+**$pa0QpxIQxRm zRzyr-rdIGOmk*wtwrK*MOH)JTtgIhp>%mxXs#P9p)p}=FfI#2bCxs0A48H^mU;h2~)@|*<^v9Uwcct1Q@YYE0B_K2BsJ>)s2p~(TGa5z3q{ts)oLnx9ZN%9My COFlCI literal 0 HcmV?d00001 diff --git a/src/test1.bzz b/src/test1.bzz index fa34edb..476c852 100644 --- a/src/test1.bzz +++ b/src/test1.bzz @@ -1,6 +1,8 @@ # Executed once at init time. function init() { i = 0 +a = 0 +val = 0 } # Executed at each time step. @@ -15,12 +17,19 @@ neighbors.listen("Take", neighbors.listen("key", function(vid, value, rid) { print("Got (", vid, ",", value, ") from robot #", rid) + val = value } ) +print(val) +if ((val==23) and (a == 0)) { + uav_takeoff() + a=1 + } + if (a == 10) uav_land() + if (a != 0) a = a+1 } - else{ -neighbors.broadcast("key", "yes") +neighbors.broadcast("key", 23) neighbors.broadcast("Take", "no") } @@ -33,4 +42,3 @@ function reset() { # Executed once at the end of experiment. function destroy() { } -