field modifications 09/11

This commit is contained in:
David St-Onge 2017-09-11 18:01:56 -04:00
parent ded07aa5e8
commit 80fd376a8c
3 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ include "string.bzz"
include "vec2.bzz"
include "update.bzz"
include "vstigenv.bzz" # reserve stigmergy id=20 and 21 for this header.
#include "vstigenv.bzz" # reserve stigmergy id=20 and 21 for this header.
include "barrier.bzz" # reserve stigmergy id=80 (auto-increment up) for this header.
include "uavstates.bzz" # require an 'action' function to be defined here.
@ -14,7 +14,7 @@ include "graphs/shapes_Y.bzz"
ROBOT_RADIUS = 50
ROBOT_DIAMETER = 2.0*ROBOT_RADIUS
ROBOT_SAFETYDIST = 2.0*ROBOT_DIAMETER
ROOT_ID = 2
ROOT_ID = 13
# max velocity in cm/step
ROBOT_MAXVEL = 150.0
@ -704,9 +704,9 @@ function init() {
#
uav_initswarm()
#v_tag = stigmergy.create(m_lockstig)
uav_initstig()
#uav_initstig()
# go to diff. height since no collision avoidance implemented yet
TARGET_ALTITUDE = 2.5 + id * 1.5
TARGET_ALTITUDE = 4.5 #2.5 + id * 1.5
statef=turnedoff
UAVSTATE = "TURNEDOFF"
}
@ -720,7 +720,7 @@ function step() {
# get the swarm commands
uav_neicmd()
# update the vstig (status/net/batt)
uav_updatestig()
#uav_updatestig()
#update the graph
UpdateNodeInfo()

View File

@ -7,7 +7,7 @@
#
# Constants
#
BARRIER_TIMEOUT = 200 # in steps
BARRIER_TIMEOUT = 1200 # in steps
BARRIER_VSTIG = 80
timeW = 0
barrier = nil
@ -82,4 +82,4 @@ function getlowest(){
u=u-1
}
log("--> LOWEST ID:",Lid)
}
}

View File

@ -152,7 +152,7 @@ function uav_rccmd() {
function uav_neicmd() {
neighbors.listen("cmd",
function(vid, value, rid) {
print("Got (", vid, ",", value, ") from robot #", rid, "(", UAVSTATE, ")")
print("Got (", vid, ",", value, ") #", rid, "(", UAVSTATE, ")")
if(value==22 and UAVSTATE!="TAKEOFF" and UAVSTATE!="BARRIERWAIT") {
statef=takeoff
UAVSTATE = "TAKEOFF"