Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/airsim' into airsim
Browse files Browse the repository at this point in the history
  • Loading branch information
tcdanielh committed Oct 18, 2024
2 parents 1bdb9f3 + 73071fd commit e169abd
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/3-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ body:
attributes:
label: Issue Submission Checklist
options:
- label: I checked the open and closed issues, forum, etc. and have not found any solution
- label: I checked the open and closed issues, forum, etc. and have not found any solution
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,3 @@ dmypy.json
# generated parser
src/scenic/syntax/parser.py

# airsim
src/scenic/simulators/airsim/more
22 changes: 9 additions & 13 deletions docs/simulators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ See the individual entries for details on each interface's capabilities and how
.. contents:: List of Simulators
:local:



Currently Supported
===================
AirSim
Expand Down Expand Up @@ -54,31 +56,22 @@ Generate World Info

Before running Scenic, it’s essential to generate world information. To
achieve this, utilize the scripts located at
Scenic/src/scenic/simulators/airsim/generators/
:file:`src/scenic/simulators/airsim/generators/`

Using Unreal Engine (recommended)
"""""""""""""""""""""""""""""""""

First, run the generateUnrealWorldInfo.py script inside unreal engine by
First, run the :file:`generateUnrealWorldInfo.py` script inside Unreal Engine by
simply entering in the file path in the engine’s python console.

Then run
`thegenerateWorldInfoFromUnrealWorldInfo.py <http://thegenerateWorldInfoFromUnrealWorldInfo.py>`__
the :file:`generateWorldInfoFromUnrealWorldInfo.py`
script

Using Airsim
""""""""""""

Run the generateWorldInfo.py script

Note: This world info generation only works on small environments such
as the Blocks environment. For larger environments, you will need to
manually create the world info file.

Possible work around for now is to generate the 3d model of the
environment by getting its voxel grid information and using the
helper python script `binvoxToObj.py <http://binvoxToObj.py/>`__ to
put into the assets and objectMeshes folder of your worldInfo folder.
Run the :file:`generateWorldInfo.py` script

**Configure AirSim Settings**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -197,6 +190,7 @@ PX4 firmware in SITL mode.
After this step, you can run Scenic files normally as shown in the
“Running Scenic” section above.


Built-in Newtonian Simulator
----------------------------

Expand Down Expand Up @@ -301,6 +295,8 @@ This interface is part of the VerifAI toolkit; documentation and examples can be
.. _VerifAI repository: https://github.com/BerkeleyLearnVerify/VerifAI




Deprecated
==========

Expand Down
6 changes: 5 additions & 1 deletion examples/airsim/multiDrone.scenic
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

model scenic.simulators.airsim.model


ground = getPrexistingObj("ground")


for i in range(3):
new Drone at (Range(-10,10),Range(-10,10),Range(0,10)),
with behavior FlyToPosition((Range(-10,10),Range(-10,10),Range(0,10)))
with behavior FlyToPosition((Range(-10,10),Range(-10,10),Range(0,10)))
2 changes: 1 addition & 1 deletion examples/airsim/worldGen.scenic
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ for i in range(blockCount):
with height 10)


ranBlock = blocks[random.randint(0,blockCount-1)]
ranBlock = Uniform(*blocks)

drone = new Drone on ranBlock, with behavior Patrol([(10,10,10),(2,2,2)])
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import unreal
from pathlib import Path
import os
import argparse
import json
import os
from pathlib import Path

import unreal

# get output directory
parser = argparse.ArgumentParser()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import argparse
import json
import os
import shutil
from warnings import warn

import bpy
import numpy as np
import trimesh
import bpy
import shutil
from scenic.core.utils import repairMesh

from scenic.core.utils import repairMesh

WORLD_SCALE = 10000
DEFAULT_MESH = trimesh.creation.box((1, 1, 1))
Expand Down Expand Up @@ -54,7 +55,6 @@
tmeshes = {}
for filename in os.listdir(assetsInputDir):
if filename.endswith(".fbx"):

# make fbx into stl so that trimesh can read it
name = os.path.splitext(filename)[0].lower()
filepath = os.path.join(assetsInputDir, filename)
Expand Down Expand Up @@ -107,7 +107,6 @@
with open(inputDirectory + "/actorInfo.json") as file:
actorInfoList = json.load(file)
for actorInfo in actorInfoList:

if not (actorInfo["meshName"].lower() in tmeshes):
continue

Expand Down

0 comments on commit e169abd

Please sign in to comment.