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

View File

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

View File

@ -152,7 +152,7 @@ function uav_rccmd() {
function uav_neicmd() { function uav_neicmd() {
neighbors.listen("cmd", neighbors.listen("cmd",
function(vid, value, rid) { 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") { if(value==22 and UAVSTATE!="TAKEOFF" and UAVSTATE!="BARRIERWAIT") {
statef=takeoff statef=takeoff
UAVSTATE = "TAKEOFF" UAVSTATE = "TAKEOFF"