2017-06-19 17:15:18 -03:00
|
|
|
include "update.bzz"
|
|
|
|
include "barrier.bzz" # don't use a stigmergy id=11 with this header.
|
|
|
|
include "uavstates.bzz" # require an 'action' function to be defined here.
|
|
|
|
include "vstigenv.bzz"
|
2017-02-19 18:02:00 -04:00
|
|
|
|
2017-06-19 17:15:18 -03:00
|
|
|
function action() {
|
|
|
|
statef=action
|
2017-12-19 19:36:10 -04:00
|
|
|
uav_storegoal(45.5088103899,-73.1540826153,25.0)
|
|
|
|
set_goto(idle)
|
2017-02-19 18:02:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Executed once at init time.
|
|
|
|
function init() {
|
2017-08-25 18:05:40 -03:00
|
|
|
uav_initstig()
|
2017-12-19 19:36:10 -04:00
|
|
|
uav_initswarm()
|
|
|
|
#statef=turnedoff
|
|
|
|
#UAVSTATE = "TURNEDOFF"
|
|
|
|
statef = takeoff
|
2017-12-20 15:33:23 -04:00
|
|
|
BVMSTATE = "TAKEOFF"
|
2017-02-19 18:02:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Executed at each time step.
|
|
|
|
function step() {
|
2017-06-19 17:15:18 -03:00
|
|
|
uav_rccmd()
|
2017-08-25 18:05:40 -03:00
|
|
|
|
|
|
|
statef()
|
|
|
|
|
2017-12-20 15:33:23 -04:00
|
|
|
log("Current state: ", BVMSTATE)
|
2017-02-19 18:02:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Executed once when the robot (or the simulator) is reset.
|
|
|
|
function reset() {
|
|
|
|
}
|
|
|
|
|
|
|
|
# Executed once at the end of experiment.
|
|
|
|
function destroy() {
|
|
|
|
}
|