ROSBuzz_MISTLab/buzz_scripts/testRRT.bzz

46 lines
920 B
Plaintext

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"
function action() {
statef=action
uav_storegoal(45.5088103899,-73.1540826153,2.5)
set_goto(idle)
}
# Executed once at init time.
function init() {
uav_initstig()
uav_initswarm()
TARGET_ALTITUDE = 2.5 # m
# statef=turnedoff
# BVMSTATE = "TURNEDOFF"
statef = takeoff
BVMSTATE = "TAKEOFF"
}
# Executed at each time step.
function step() {
uav_rccmd()
statef()
log("Current state: ", BVMSTATE)
# log("Obstacles: ")
# reduce(proximity,
# function(key, value, acc) {
# log(key, " - ", value.angle, value.value)
# return acc
# }, math.vec2.new(0, 0))
}
# Executed once when the robot (or the simulator) is reset.
function reset() {
}
# Executed once at the end of experiment.
function destroy() {
}