ROSBuzz_MISTLab/src/test1.bzz

37 lines
601 B
Plaintext
Raw Normal View History

# Executed once at init time.
function init() {
i = 0
}
# Executed at each time step.
function step() {
if (i == 0) {
neighbors.listen("Take",
function(vid, value, rid) {
print("Got (", vid, ",", value, ") from robot #", rid)
}
)
neighbors.listen("key",
function(vid, value, rid) {
print("Got (", vid, ",", value, ") from robot #", rid)
}
)
}
else{
neighbors.broadcast("key", "yes")
neighbors.broadcast("Take", "no")
}
}
# Executed once when the robot (or the simulator) is reset.
function reset() {
}
# Executed once at the end of experiment.
function destroy() {
}