m100 changes

This commit is contained in:
David St-Onge 2016-12-05 17:57:20 -05:00
parent 4b2f02facb
commit c0399f1221
9 changed files with 337 additions and 6 deletions

View File

@ -2,12 +2,12 @@
<launch>
<node name="rosbuzz_node" pkg="rosbuzz" type="rosbuzz_node" respawn="false" output="screen" >
<param name="bzzfile_name" value="../ROS_WS/src/ROSBuzz/src/test.bzz" />
<param name="bzzfile_name" value="../ROS_WS/src/ROSBuzz/src/test1.bzz" />
<param name="rcclient" value="true" />
<param name="rcservice_name" value="rc_cmd" />
<param name="fcclient_name" value="/djicmd" />
<param name="in_payload" value="outMavlink"/>
<param name="out_payload" value="outMavlink"/>
<param name="in_payload" value="/inMavlink"/>
<param name="out_payload" value="/outMavlink"/>
<param name="robot_id" value="1"/>
</node>

117
src/test.basm Normal file
View File

@ -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

BIN
src/test.bdbg Normal file

Binary file not shown.

BIN
src/test.bo Normal file

Binary file not shown.

31
src/test.bzz.save Normal file
View File

@ -0,0 +1,31 @@
# Executed once at init time.
function init() {
i=0
#uav_takeoff()
}
# Executed at each time step.
function step() {
#print("bzz print: remaining: ", battery.capacity)
#print("latitude : ",position.latitude," longitude: ",position.longitude," altitude : ", position.altitude)
#print("flight status: ",flight.status)
#if(i==10){uav_land()}
#i=i+1
neighbors.listen("key",
function(vid, value, rid) {
print("Got msg ", value, "from ", rid)
uav_takeoff()
})
}
# Executed once when the robot (or the simulator) is reset.
function reset() {
}
# Executed once at the end of experiment.
function destroy() {
}

175
src/test1.basm Normal file
View File

@ -0,0 +1,175 @@
!19
'init
'i
'a
'val
'step
'neighbors
'listen
'Take
'print
'Got (
',
') from robot #
'key
'uav_takeoff
'uav_land
'broadcast
'no
'reset
'destroy
pushs 0
pushcn @__label_1
gstore
pushs 4
pushcn @__label_2
gstore
pushs 17
pushcn @__label_13
gstore
pushs 18
pushcn @__label_14
gstore
nop
@__label_0
@__exitpoint
done
@__label_1
pushs 1 |3,2,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 0 |3,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gstore |3,5,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 2 |4,2,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 0 |4,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gstore |4,5,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 3 |5,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 0 |5,6,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gstore |5,7,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
ret0 |6,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_2
pushs 1 |11,6,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |11,6,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 0 |11,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
eq |11,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
jumpz @__label_3 |11,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 5 |12,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |12,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 6 |12,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
tget |12,16,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 7 |12,17,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushl @__label_5 |13,3,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 2 |16,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |16,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 5 |17,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |17,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 6 |17,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
tget |17,16,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 12 |17,17,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushl @__label_6 |18,3,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 2 |22,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |22,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 8 |23,5,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |23,5,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 3 |23,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |23,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 1 |23,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |23,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 3 |24,8,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |24,8,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 23 |24,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
eq |24,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 2 |24,21,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |24,21,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 0 |24,24,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
eq |24,25,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
and |24,26,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
jumpz @__label_7 |24,28,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 13 |25,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |25,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 0 |25,14,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |25,14,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 2 |26,2,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 1 |26,3,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gstore |26,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_7 |28,6,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 2 |28,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |28,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 10 |28,15,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
eq |28,17,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
jumpz @__label_9 |28,19,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 14 |28,27,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |28,27,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 0 |28,29,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |28,29,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_9 |29,6,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 2 |29,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |29,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 0 |29,15,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
neq |29,16,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
jumpz @__label_11 |29,19,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 2 |29,21,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 2 |29,24,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |29,24,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 1 |29,25,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
add |29,26,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gstore |29,26,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_11 |30,0,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
jump @__label_4 |31,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_3 |31,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 5 |32,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |32,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 15 |32,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
tget |32,19,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 12 |32,20,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 23 |32,27,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 2 |32,30,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |32,30,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 5 |33,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |33,9,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 15 |33,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
tget |33,19,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 7 |33,20,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 16 |33,28,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 2 |33,33,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |33,33,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_4 |34,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
ret0 |36,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_5
pushs 8 |14,11,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |14,11,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 9 |14,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
lload 1 |14,24,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 10 |14,26,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
lload 2 |14,36,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 11 |14,38,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
lload 3 |14,59,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 6 |14,60,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |14,60,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
ret0 |15,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_6
pushs 8 |19,11,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gload |19,11,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 9 |19,12,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
lload 1 |19,24,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 10 |19,26,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
lload 2 |19,36,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 11 |19,38,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
lload 3 |19,59,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushi 6 |19,60,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
callc |19,60,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
pushs 3 |20,10,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
lload 2 |20,23,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
gstore |20,23,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
ret0 |21,4,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_13
ret0 |40,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz
@__label_14
ret0 |44,1,/home/ubuntu/ROS_WS/src/ROSBuzz/src/test1.bzz

BIN
src/test1.bdbg Normal file

Binary file not shown.

BIN
src/test1.bo Normal file

Binary file not shown.

View File

@ -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() {
}