Merge branch 'sim' of git.mistlab.ca:dasto/drones into sim
This commit is contained in:
commit
d3214b9cf6
|
@ -24,6 +24,7 @@ function init() {
|
||||||
|
|
||||||
# Starting state: TURNEDOFF to wait for user input.
|
# Starting state: TURNEDOFF to wait for user input.
|
||||||
BVMSTATE = "TURNEDOFF"
|
BVMSTATE = "TURNEDOFF"
|
||||||
|
TAKEOFF_COUNTER = 20
|
||||||
}
|
}
|
||||||
|
|
||||||
# Executed at each time step.
|
# Executed at each time step.
|
||||||
|
@ -50,6 +51,16 @@ function step() {
|
||||||
statef()
|
statef()
|
||||||
|
|
||||||
log("Current state: ", BVMSTATE)
|
log("Current state: ", BVMSTATE)
|
||||||
|
|
||||||
|
# Auto-takeoff (delayed for simulator boot)
|
||||||
|
if(id == 0) {
|
||||||
|
if(TAKEOFF_COUNTER>0)
|
||||||
|
TAKEOFF_COUNTER = TAKEOFF_COUNTER - 1
|
||||||
|
else if(TAKEOFF_COUNTER == 0) {
|
||||||
|
BVMSTATE="LAUNCH"
|
||||||
|
TAKEOFF_COUNTER = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Executed once when the robot (or the simulator) is reset.
|
# Executed once when the robot (or the simulator) is reset.
|
||||||
|
|
Loading…
Reference in New Issue