My buzz code is this:
Code: Select all
#This is just the sample gradient buzz script from the wiki with some debug messages added
function init() {
if(id == 0) {
# Source robot
mydist = 0.
}
else {
# Other robots
mydist = 1000
# Listen to other robots' distances
neighbors.listen("dist_to_source",
function(value_id, value, robot_id) {
mydist = math.min( mydist, neighbors.get(robot_id).distance + value)
log("mydist = ", mydist)
})
}
}
function step() {
neighbors.broadcast("dist_to_source", mydist)
debug("d=", mydist)
}
function destroy() {
}
What happens instead is that init() gets called, and the initial values are set. Robot 0 gets a distance of 0, all the others are set to 1000. The debug call in step() writes the values above the robots in the simulator. The log() call in the neighbors.listen() never writes anything to the log, and the mydist values never change.
My current theory is that the messages are either not getting sent or not arriving, but I don't know why or how to debug this. I just started using ARGoS/Buzz before the holidays last year.
The robots do appear to be able to see each other, as turning rays on shows lines between them.