{
 "format": "uvira.forge.blocks",
 "version": 1,
 "workspace": {
  "blocks": {
   "languageVersion": 0,
   "blocks": [
    {
     "type": "forge_program",
     "id": "b113",
     "fields": {
      "NAME": "look_around",
      "PERIOD": "20"
     },
     "inputs": {
      "INIT": {
       "block": {
        "type": "variables_set",
        "id": "b2",
        "fields": {
         "VAR": {
          "id": "var_n0"
         }
        },
        "inputs": {
         "VALUE": {
          "block": {
           "type": "forge_vehicle_value",
           "id": "b1",
           "fields": {
            "WHAT": "north"
           }
          }
         }
        },
        "next": {
         "block": {
          "type": "variables_set",
          "id": "b4",
          "fields": {
           "VAR": {
            "id": "var_e0"
           }
          },
          "inputs": {
           "VALUE": {
            "block": {
             "type": "forge_vehicle_value",
             "id": "b3",
             "fields": {
              "WHAT": "east"
             }
            }
           }
          },
          "next": {
           "block": {
            "type": "variables_set",
            "id": "b6",
            "fields": {
             "VAR": {
              "id": "var_h0"
             }
            },
            "inputs": {
             "VALUE": {
              "block": {
               "type": "forge_vehicle_value",
               "id": "b5",
               "fields": {
                "WHAT": "heading"
               }
              }
             }
            },
            "next": {
             "block": {
              "type": "variables_set",
              "id": "b13",
              "fields": {
               "VAR": {
                "id": "var_fn"
               }
              },
              "inputs": {
               "VALUE": {
                "block": {
                 "type": "math_arithmetic",
                 "id": "b12",
                 "fields": {
                  "OP": "ADD"
                 },
                 "inputs": {
                  "A": {
                   "block": {
                    "type": "variables_get",
                    "id": "b7",
                    "fields": {
                     "VAR": {
                      "id": "var_n0"
                     }
                    }
                   }
                  },
                  "B": {
                   "block": {
                    "type": "math_arithmetic",
                    "id": "b10",
                    "fields": {
                     "OP": "MULTIPLY"
                    },
                    "inputs": {
                     "A": {
                      "block": {
                       "type": "math_number",
                       "id": "b11",
                       "fields": {
                        "NUM": 30
                       }
                      }
                     },
                     "B": {
                      "block": {
                       "type": "math_trig",
                       "id": "b9",
                       "fields": {
                        "OP": "COS"
                       },
                       "inputs": {
                        "NUM": {
                         "block": {
                          "type": "variables_get",
                          "id": "b8",
                          "fields": {
                           "VAR": {
                            "id": "var_h0"
                           }
                          }
                         }
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              },
              "next": {
               "block": {
                "type": "variables_set",
                "id": "b20",
                "fields": {
                 "VAR": {
                  "id": "var_fe"
                 }
                },
                "inputs": {
                 "VALUE": {
                  "block": {
                   "type": "math_arithmetic",
                   "id": "b19",
                   "fields": {
                    "OP": "ADD"
                   },
                   "inputs": {
                    "A": {
                     "block": {
                      "type": "variables_get",
                      "id": "b14",
                      "fields": {
                       "VAR": {
                        "id": "var_e0"
                       }
                      }
                     }
                    },
                    "B": {
                     "block": {
                      "type": "math_arithmetic",
                      "id": "b17",
                      "fields": {
                       "OP": "MULTIPLY"
                      },
                      "inputs": {
                       "A": {
                        "block": {
                         "type": "math_number",
                         "id": "b18",
                         "fields": {
                          "NUM": 30
                         }
                        }
                       },
                       "B": {
                        "block": {
                         "type": "math_trig",
                         "id": "b16",
                         "fields": {
                          "OP": "SIN"
                         },
                         "inputs": {
                          "NUM": {
                           "block": {
                            "type": "variables_get",
                            "id": "b15",
                            "fields": {
                             "VAR": {
                              "id": "var_h0"
                             }
                            }
                           }
                          }
                         }
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      },
      "STATES": {
       "block": {
        "type": "forge_state",
        "id": "b38",
        "fields": {
         "NAME": "up"
        },
        "inputs": {
         "TICK": {
          "block": {
           "type": "forge_cmd_guided",
           "id": "b24",
           "fields": {
            "yaw_valid": true,
            "DISARM_WHEN_LANDED": false
           },
           "inputs": {
            "pos_n": {
             "block": {
              "type": "variables_get",
              "id": "b21",
              "fields": {
               "VAR": {
                "id": "var_n0"
               }
              }
             }
            },
            "pos_e": {
             "block": {
              "type": "variables_get",
              "id": "b22",
              "fields": {
               "VAR": {
                "id": "var_e0"
               }
              }
             }
            },
            "alt": {
             "block": {
              "type": "math_number",
              "id": "b25",
              "fields": {
               "NUM": 10
              }
             }
            },
            "yaw": {
             "block": {
              "type": "variables_get",
              "id": "b23",
              "fields": {
               "VAR": {
                "id": "var_h0"
               }
              }
             }
            },
            "speed_max": {
             "block": {
              "type": "math_number",
              "id": "b26",
              "fields": {
               "NUM": 3
              }
             }
            }
           },
           "next": {
            "block": {
             "type": "forge_debug",
             "id": "b27",
             "fields": {
              "INDEX": "0"
             },
             "inputs": {
              "VALUE": {
               "block": {
                "type": "math_number",
                "id": "b28",
                "fields": {
                 "NUM": 0
                }
               }
              }
             },
             "next": {
              "block": {
               "type": "controls_if",
               "id": "b37",
               "inputs": {
                "IF0": {
                 "block": {
                  "type": "logic_operation",
                  "id": "b35",
                  "fields": {
                   "OP": "AND"
                  },
                  "inputs": {
                   "A": {
                    "block": {
                     "type": "logic_compare",
                     "id": "b30",
                     "fields": {
                      "OP": "GT"
                     },
                     "inputs": {
                      "A": {
                       "block": {
                        "type": "forge_vehicle_value",
                        "id": "b29",
                        "fields": {
                         "WHAT": "alt"
                        }
                       }
                      },
                      "B": {
                       "block": {
                        "type": "math_number",
                        "id": "b31",
                        "fields": {
                         "NUM": 9.7
                        }
                       }
                      }
                     }
                    }
                   },
                   "B": {
                    "block": {
                     "type": "logic_compare",
                     "id": "b33",
                     "fields": {
                      "OP": "LT"
                     },
                     "inputs": {
                      "A": {
                       "block": {
                        "type": "forge_vehicle_value",
                        "id": "b32",
                        "fields": {
                         "WHAT": "alt"
                        }
                       }
                      },
                      "B": {
                       "block": {
                        "type": "math_number",
                        "id": "b34",
                        "fields": {
                         "NUM": 10.3
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                },
                "DO0": {
                 "block": {
                  "type": "forge_goto",
                  "id": "b36",
                  "fields": {
                   "NAME": "out"
                  }
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        },
        "next": {
         "block": {
          "type": "forge_state",
          "id": "b62",
          "fields": {
           "NAME": "out"
          },
          "inputs": {
           "TICK": {
            "block": {
             "type": "forge_cmd_guided",
             "id": "b42",
             "fields": {
              "yaw_valid": true,
              "DISARM_WHEN_LANDED": false
             },
             "inputs": {
              "pos_n": {
               "block": {
                "type": "variables_get",
                "id": "b39",
                "fields": {
                 "VAR": {
                  "id": "var_fn"
                 }
                }
               }
              },
              "pos_e": {
               "block": {
                "type": "variables_get",
                "id": "b40",
                "fields": {
                 "VAR": {
                  "id": "var_fe"
                 }
                }
               }
              },
              "alt": {
               "block": {
                "type": "math_number",
                "id": "b43",
                "fields": {
                 "NUM": 10
                }
               }
              },
              "yaw": {
               "block": {
                "type": "variables_get",
                "id": "b41",
                "fields": {
                 "VAR": {
                  "id": "var_h0"
                 }
                }
               }
              },
              "speed_max": {
               "block": {
                "type": "math_number",
                "id": "b44",
                "fields": {
                 "NUM": 5
                }
               }
              }
             },
             "next": {
              "block": {
               "type": "variables_set",
               "id": "b48",
               "fields": {
                "VAR": {
                 "id": "var_d"
                }
               },
               "inputs": {
                "VALUE": {
                 "block": {
                  "type": "forge_distance_to",
                  "id": "b47",
                  "inputs": {
                   "N": {
                    "block": {
                     "type": "variables_get",
                     "id": "b45",
                     "fields": {
                      "VAR": {
                       "id": "var_fn"
                      }
                     }
                    }
                   },
                   "E": {
                    "block": {
                     "type": "variables_get",
                     "id": "b46",
                     "fields": {
                      "VAR": {
                       "id": "var_fe"
                      }
                     }
                    }
                   }
                  }
                 }
                }
               },
               "next": {
                "block": {
                 "type": "forge_debug",
                 "id": "b49",
                 "fields": {
                  "INDEX": "0"
                 },
                 "inputs": {
                  "VALUE": {
                   "block": {
                    "type": "math_number",
                    "id": "b50",
                    "fields": {
                     "NUM": 1
                    }
                   }
                  }
                 },
                 "next": {
                  "block": {
                   "type": "forge_debug",
                   "id": "b52",
                   "fields": {
                    "INDEX": "1"
                   },
                   "inputs": {
                    "VALUE": {
                     "block": {
                      "type": "variables_get",
                      "id": "b51",
                      "fields": {
                       "VAR": {
                        "id": "var_d"
                       }
                      }
                     }
                    }
                   },
                   "next": {
                    "block": {
                     "type": "controls_if",
                     "id": "b61",
                     "inputs": {
                      "IF0": {
                       "block": {
                        "type": "logic_operation",
                        "id": "b59",
                        "fields": {
                         "OP": "AND"
                        },
                        "inputs": {
                         "A": {
                          "block": {
                           "type": "logic_compare",
                           "id": "b54",
                           "fields": {
                            "OP": "LT"
                           },
                           "inputs": {
                            "A": {
                             "block": {
                              "type": "variables_get",
                              "id": "b53",
                              "fields": {
                               "VAR": {
                                "id": "var_d"
                               }
                              }
                             }
                            },
                            "B": {
                             "block": {
                              "type": "math_number",
                              "id": "b55",
                              "fields": {
                               "NUM": 0.5
                              }
                             }
                            }
                           }
                          }
                         },
                         "B": {
                          "block": {
                           "type": "logic_compare",
                           "id": "b57",
                           "fields": {
                            "OP": "LT"
                           },
                           "inputs": {
                            "A": {
                             "block": {
                              "type": "forge_vehicle_value",
                              "id": "b56",
                              "fields": {
                               "WHAT": "ground_speed"
                              }
                             }
                            },
                            "B": {
                             "block": {
                              "type": "math_number",
                              "id": "b58",
                              "fields": {
                               "NUM": 0.5
                              }
                             }
                            }
                           }
                          }
                         }
                        }
                       }
                      },
                      "DO0": {
                       "block": {
                        "type": "forge_goto",
                        "id": "b60",
                        "fields": {
                         "NAME": "look"
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          },
          "next": {
           "block": {
            "type": "forge_state",
            "id": "b80",
            "fields": {
             "NAME": "look"
            },
            "inputs": {
             "TICK": {
              "block": {
               "type": "forge_cmd_guided",
               "id": "b70",
               "fields": {
                "yaw_valid": true,
                "DISARM_WHEN_LANDED": false
               },
               "inputs": {
                "pos_n": {
                 "block": {
                  "type": "variables_get",
                  "id": "b63",
                  "fields": {
                   "VAR": {
                    "id": "var_fn"
                   }
                  }
                 }
                },
                "pos_e": {
                 "block": {
                  "type": "variables_get",
                  "id": "b64",
                  "fields": {
                   "VAR": {
                    "id": "var_fe"
                   }
                  }
                 }
                },
                "alt": {
                 "block": {
                  "type": "math_number",
                  "id": "b71",
                  "fields": {
                   "NUM": 10
                  }
                 }
                },
                "yaw": {
                 "block": {
                  "type": "math_arithmetic",
                  "id": "b69",
                  "fields": {
                   "OP": "ADD"
                  },
                  "inputs": {
                   "A": {
                    "block": {
                     "type": "variables_get",
                     "id": "b65",
                     "fields": {
                      "VAR": {
                       "id": "var_h0"
                      }
                     }
                    }
                   },
                   "B": {
                    "block": {
                     "type": "math_arithmetic",
                     "id": "b67",
                     "fields": {
                      "OP": "MULTIPLY"
                     },
                     "inputs": {
                      "A": {
                       "block": {
                        "type": "math_number",
                        "id": "b68",
                        "fields": {
                         "NUM": 20
                        }
                       }
                      },
                      "B": {
                       "block": {
                        "type": "forge_time_in_state",
                        "id": "b66"
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                },
                "speed_max": {
                 "block": {
                  "type": "math_number",
                  "id": "b72",
                  "fields": {
                   "NUM": 5
                  }
                 }
                }
               },
               "next": {
                "block": {
                 "type": "forge_debug",
                 "id": "b73",
                 "fields": {
                  "INDEX": "0"
                 },
                 "inputs": {
                  "VALUE": {
                   "block": {
                    "type": "math_number",
                    "id": "b74",
                    "fields": {
                     "NUM": 2
                    }
                   }
                  }
                 },
                 "next": {
                  "block": {
                   "type": "controls_if",
                   "id": "b79",
                   "inputs": {
                    "IF0": {
                     "block": {
                      "type": "logic_compare",
                      "id": "b76",
                      "fields": {
                       "OP": "GT"
                      },
                      "inputs": {
                       "A": {
                        "block": {
                         "type": "forge_time_in_state",
                         "id": "b75"
                        }
                       },
                       "B": {
                        "block": {
                         "type": "math_number",
                         "id": "b77",
                         "fields": {
                          "NUM": 18
                         }
                        }
                       }
                      }
                     }
                    },
                    "DO0": {
                     "block": {
                      "type": "forge_goto",
                      "id": "b78",
                      "fields": {
                       "NAME": "back"
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            },
            "next": {
             "block": {
              "type": "forge_state",
              "id": "b106",
              "fields": {
               "NAME": "back"
              },
              "inputs": {
               "TICK": {
                "block": {
                 "type": "forge_cmd_guided",
                 "id": "b86",
                 "fields": {
                  "yaw_valid": true,
                  "DISARM_WHEN_LANDED": false
                 },
                 "inputs": {
                  "pos_n": {
                   "block": {
                    "type": "variables_get",
                    "id": "b81",
                    "fields": {
                     "VAR": {
                      "id": "var_n0"
                     }
                    }
                   }
                  },
                  "pos_e": {
                   "block": {
                    "type": "variables_get",
                    "id": "b82",
                    "fields": {
                     "VAR": {
                      "id": "var_e0"
                     }
                    }
                   }
                  },
                  "alt": {
                   "block": {
                    "type": "math_number",
                    "id": "b87",
                    "fields": {
                     "NUM": 10
                    }
                   }
                  },
                  "yaw": {
                   "block": {
                    "type": "math_arithmetic",
                    "id": "b84",
                    "fields": {
                     "OP": "ADD"
                    },
                    "inputs": {
                     "A": {
                      "block": {
                       "type": "variables_get",
                       "id": "b83",
                       "fields": {
                        "VAR": {
                         "id": "var_h0"
                        }
                       }
                      }
                     },
                     "B": {
                      "block": {
                       "type": "math_number",
                       "id": "b85",
                       "fields": {
                        "NUM": 180
                       }
                      }
                     }
                    }
                   }
                  },
                  "speed_max": {
                   "block": {
                    "type": "math_number",
                    "id": "b88",
                    "fields": {
                     "NUM": 5
                    }
                   }
                  }
                 },
                 "next": {
                  "block": {
                   "type": "variables_set",
                   "id": "b92",
                   "fields": {
                    "VAR": {
                     "id": "var_d"
                    }
                   },
                   "inputs": {
                    "VALUE": {
                     "block": {
                      "type": "forge_distance_to",
                      "id": "b91",
                      "inputs": {
                       "N": {
                        "block": {
                         "type": "variables_get",
                         "id": "b89",
                         "fields": {
                          "VAR": {
                           "id": "var_n0"
                          }
                         }
                        }
                       },
                       "E": {
                        "block": {
                         "type": "variables_get",
                         "id": "b90",
                         "fields": {
                          "VAR": {
                           "id": "var_e0"
                          }
                         }
                        }
                       }
                      }
                     }
                    }
                   },
                   "next": {
                    "block": {
                     "type": "forge_debug",
                     "id": "b93",
                     "fields": {
                      "INDEX": "0"
                     },
                     "inputs": {
                      "VALUE": {
                       "block": {
                        "type": "math_number",
                        "id": "b94",
                        "fields": {
                         "NUM": 3
                        }
                       }
                      }
                     },
                     "next": {
                      "block": {
                       "type": "forge_debug",
                       "id": "b96",
                       "fields": {
                        "INDEX": "1"
                       },
                       "inputs": {
                        "VALUE": {
                         "block": {
                          "type": "variables_get",
                          "id": "b95",
                          "fields": {
                           "VAR": {
                            "id": "var_d"
                           }
                          }
                         }
                        }
                       },
                       "next": {
                        "block": {
                         "type": "controls_if",
                         "id": "b105",
                         "inputs": {
                          "IF0": {
                           "block": {
                            "type": "logic_operation",
                            "id": "b103",
                            "fields": {
                             "OP": "AND"
                            },
                            "inputs": {
                             "A": {
                              "block": {
                               "type": "logic_compare",
                               "id": "b98",
                               "fields": {
                                "OP": "LT"
                               },
                               "inputs": {
                                "A": {
                                 "block": {
                                  "type": "variables_get",
                                  "id": "b97",
                                  "fields": {
                                   "VAR": {
                                    "id": "var_d"
                                   }
                                  }
                                 }
                                },
                                "B": {
                                 "block": {
                                  "type": "math_number",
                                  "id": "b99",
                                  "fields": {
                                   "NUM": 0.5
                                  }
                                 }
                                }
                               }
                              }
                             },
                             "B": {
                              "block": {
                               "type": "logic_compare",
                               "id": "b101",
                               "fields": {
                                "OP": "LT"
                               },
                               "inputs": {
                                "A": {
                                 "block": {
                                  "type": "forge_vehicle_value",
                                  "id": "b100",
                                  "fields": {
                                   "WHAT": "ground_speed"
                                  }
                                 }
                                },
                                "B": {
                                 "block": {
                                  "type": "math_number",
                                  "id": "b102",
                                  "fields": {
                                   "NUM": 0.5
                                  }
                                 }
                                }
                               }
                              }
                             }
                            }
                           }
                          },
                          "DO0": {
                           "block": {
                            "type": "forge_goto",
                            "id": "b104",
                            "fields": {
                             "NAME": "land"
                            }
                           }
                          }
                         }
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              },
              "next": {
               "block": {
                "type": "forge_state",
                "id": "b112",
                "fields": {
                 "NAME": "land"
                },
                "inputs": {
                 "TICK": {
                  "block": {
                   "type": "forge_cmd_land",
                   "id": "b107",
                   "inputs": {
                    "vel_x": {
                     "block": {
                      "type": "math_number",
                      "id": "b108",
                      "fields": {
                       "NUM": 0
                      }
                     }
                    },
                    "vel_y": {
                     "block": {
                      "type": "math_number",
                      "id": "b109",
                      "fields": {
                       "NUM": 0
                      }
                     }
                    }
                   },
                   "next": {
                    "block": {
                     "type": "forge_debug",
                     "id": "b110",
                     "fields": {
                      "INDEX": "0"
                     },
                     "inputs": {
                      "VALUE": {
                       "block": {
                        "type": "math_number",
                        "id": "b111",
                        "fields": {
                         "NUM": 4
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "x": 40,
     "y": 40
    }
   ]
  },
  "variables": [
   {
    "name": "n0",
    "id": "var_n0"
   },
   {
    "name": "e0",
    "id": "var_e0"
   },
   {
    "name": "h0",
    "id": "var_h0"
   },
   {
    "name": "fn",
    "id": "var_fn"
   },
   {
    "name": "fe",
    "id": "var_fe"
   },
   {
    "name": "d",
    "id": "var_d"
   }
  ]
 }
}
