fixed rosbag name and auto-takeoff for optimization

This commit is contained in:
David 2018-05-16 15:32:48 -04:00
parent c12b29538a
commit 309f33fff1
1 changed files with 11 additions and 0 deletions

11
buzz_scripts/testLJ.bzz Normal file → Executable file
View File

@ -24,6 +24,7 @@ function init() {
# Starting state: TURNEDOFF to wait for user input.
BVMSTATE = "TURNEDOFF"
TAKEOFF_COUNTER = 20
}
# Executed at each time step.
@ -50,6 +51,16 @@ function step() {
statef()
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.