121 lines
4.2 KiB
Plaintext
121 lines
4.2 KiB
Plaintext
Tree("Root") {
|
|
Decorator (LoopInFrame) {
|
|
Composite (Sequence) {
|
|
ManualTick.AlignDirection()
|
|
RunTree("FollowLeftWall")
|
|
//RunTree("Testing")
|
|
}
|
|
}
|
|
}
|
|
|
|
Tree("FollowLeftWall") {
|
|
Composite (Selector) {
|
|
Composite (Sequence) {
|
|
ManualTick.FpsCounter()
|
|
ManualTick.Fail()
|
|
}
|
|
|
|
/*Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(0,-1) // left
|
|
ManualTick.CheckDirectionFree(1,0) // front
|
|
ManualTick.CheckDirectionOccupied(1,-1) // front/left
|
|
ManualTick.CheckDirectionOccupied(-1,-1) // back/left
|
|
ManualTick.TurnLeft()
|
|
ManualTick.DebugLog("0")
|
|
}*/
|
|
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(0,-1) // left
|
|
ManualTick.CheckDirectionFree(1,0) // front
|
|
ManualTick.CheckDirectionOccupied(1,-1) // front/left
|
|
ManualTick.MoveDirection()
|
|
ManualTick.DebugLog("1")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(0,-1) // left
|
|
ManualTick.CheckDirectionOccupied(-1,-1) // back/left
|
|
ManualTick.TurnLeft()
|
|
ManualTick.DebugLog("2")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionOccupied(0,-1) // left
|
|
ManualTick.CheckDirectionFree(1,0) // front
|
|
ManualTick.MoveDirection()
|
|
ManualTick.DebugLog("3")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionOccupied(0,-1) // left
|
|
ManualTick.CheckDirectionOccupied(1,0) // front
|
|
ManualTick.TurnRight()
|
|
ManualTick.DebugLog("4")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionOccupied(1,0) // front
|
|
ManualTick.CheckDirectionFree(0,-1) // left
|
|
ManualTick.TurnRight()
|
|
ManualTick.DebugLog("5")
|
|
}
|
|
}
|
|
}
|
|
|
|
Tree("Testing") {
|
|
Composite (Sequence) {
|
|
ManualTick.TurnLeft()
|
|
Composite (Marathon) {
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(1,0) // forward
|
|
ManualTick.DebugLog("front is free")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(1,1) // front/right
|
|
ManualTick.DebugLog("front/right is free")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(0,1) // right
|
|
ManualTick.DebugLog("right is free")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(-1,1) // back/right
|
|
ManualTick.DebugLog("back/right is free")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(-1,0) // back
|
|
ManualTick.DebugLog("back is free")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(-1,-1) // back/left
|
|
ManualTick.DebugLog("back/left is free")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(0,-1) // left
|
|
ManualTick.DebugLog("left is free")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(1,-1) // front/left
|
|
ManualTick.DebugLog("front/left is free")
|
|
}
|
|
}
|
|
ManualTick.DebugLog("-----")
|
|
|
|
/*ManualTick.CheckDirectionFree(1,-1) // forward
|
|
ManualTick.CheckDirectionFree(OFFSET_DIR.left)
|
|
ManualTick.CheckDirectionFree(OFFSET_DIR.forward)
|
|
ManualTick.TurnLeft()
|
|
ManualTick.MoveDirection()*/
|
|
/*Composite (Sequence) {
|
|
ManualTick.CheckDirectionOccupied(OFFSET_DIR.left)
|
|
ManualTick.CheckDirectionOccupied(OFFSET_DIR.forward)
|
|
ManualTick.TurnRight()
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionOccupied(OFFSET_DIR.left)
|
|
ManualTick.CheckDirectionFree(OFFSET_DIR.forward)
|
|
ManualTick.MoveDirection()
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(OFFSET_DIR.left)
|
|
ManualTick.CheckDirectionOccupied(OFFSET_DIR.forward)
|
|
ManualTick.TurnRight()
|
|
}*/
|
|
}
|
|
} |