Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airsim Interface Update #307

Open
wants to merge 236 commits into
base: airsim
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
8f9a74c
Moved all boolean calls to Manifold.
Eric-Vin Aug 30, 2023
149646c
Overloaded count to work for scenes as well.
Eric-Vin Sep 7, 2023
c0e65d3
Fixed formatting.
Eric-Vin Sep 7, 2023
44d1770
Added object inradius test + bugfix.
Eric-Vin Sep 7, 2023
3bad697
Added planarInradius functionality and tests for proper 2D pruning.
Eric-Vin Sep 8, 2023
682154c
Improved pruning for 2d regions.
Eric-Vin Sep 8, 2023
627893c
Rudimentary VoxelRegion implementation.
Eric-Vin Sep 11, 2023
e6f6922
Added volume and dimensionality to VoxelRegion.
Eric-Vin Sep 11, 2023
c539dd4
Pruning cleanup.
Eric-Vin Sep 11, 2023
5ddfab3
Progress on mesh voxelization pruning.
Eric-Vin Sep 12, 2023
de2bf66
More cleanup and fixes for voxelization.
Eric-Vin Sep 13, 2023
6bb59ab
Pared back voxel region constructor.
Eric-Vin Sep 13, 2023
3230375
Fixed scipy interpreting 0 as reach fixpoint.
Eric-Vin Sep 13, 2023
9d6a8c3
Remove lazy return.
Eric-Vin Sep 13, 2023
855e976
Tighter bound on erosion.
Eric-Vin Sep 13, 2023
a6ac69f
In pruning, ensure vozelization overapproximates mesh.
Eric-Vin Sep 13, 2023
b1f068b
New test that causes serialization to finish.
Eric-Vin Sep 13, 2023
f086fff
Added serialization for Orientation objects.
Eric-Vin Sep 13, 2023
3faab47
Allow multiple iterations for random scene.
Eric-Vin Sep 13, 2023
7c32bc9
Ensure planarInradius is only used when there is no pitch or roll.
Eric-Vin Sep 14, 2023
4561029
Added Rotation round-trip workaround.
Eric-Vin Sep 15, 2023
a32a598
More pruning work.
Eric-Vin Sep 18, 2023
4c71650
Moved count arg to main block.
Eric-Vin Sep 18, 2023
0d62074
Moved count arg documentation location.
Eric-Vin Sep 18, 2023
7aa1cfd
Updated tests.
Eric-Vin Sep 18, 2023
74f894a
backup
Sep 20, 2023
1d20fd9
good
Sep 20, 2023
e15c4b5
removed cubes
Sep 20, 2023
80f4a26
small fix to Newtonian driving model
dfremont Sep 24, 2023
3b3814c
reuse objects across time steps, mutating dynamic properties
dfremont Sep 24, 2023
9932df5
bypass specifier machinery when recomputing dynamic finals
dfremont Sep 24, 2023
6deef1f
Merge pull request #182 from BerkeleyLearnVerify/dynamic-props
dfremont Sep 25, 2023
5e89a73
Add intersects operator.
Eric-Vin Sep 25, 2023
8e50e2c
Updated docs for on
Eric-Vin Sep 26, 2023
605c4c8
Fixed RectangularRegion sampling w/ non-zero Z + additional tests.
Eric-Vin Sep 27, 2023
d9eeb7f
Added sector test.
Eric-Vin Sep 27, 2023
5e6f206
Actually test sector.
Eric-Vin Sep 27, 2023
19e0326
Merge pull request #185 from BerkeleyLearnVerify/2DSamplingZFix
dfremont Sep 27, 2023
af40e06
Merge pull request #174 from BerkeleyLearnVerify/OverloadCountParam
dfremont Sep 27, 2023
ed40c81
Added doc dependencies to test-full.
Eric-Vin Sep 29, 2023
6febe87
Fixed Trimesh url.
Eric-Vin Sep 29, 2023
dc8f524
Merge pull request #186 from BerkeleyLearnVerify/CIDocsTesting
dfremont Sep 30, 2023
27f577e
refactor dynamics.py; fix message for rejected simulations
dfremont Sep 30, 2023
5f78382
Intersects operator fixes + changes to docs/tests.
Eric-Vin Oct 1, 2023
42b2370
Update docs/reference/specifiers.rst
Eric-Vin Oct 1, 2023
3af563d
Merge pull request #187 from BerkeleyLearnVerify/dynamics-refactor
dfremont Oct 1, 2023
a974eae
Force coercion to mesh when loading.
Eric-Vin Oct 1, 2023
b9bf460
properly mark TypecheckedDistribution as deterministic
dfremont Oct 1, 2023
aa8585d
added docs
Oct 2, 2023
96ff58d
added docs
Oct 2, 2023
7c5db2d
Updated On Typechecking + Docs.
Eric-Vin Oct 2, 2023
03d10b7
Add clearer check to MeshShape for well defined volumes.
Eric-Vin Oct 3, 2023
2d24f6c
fix Lane polygon overlaps
dfremont Oct 3, 2023
fc89ac1
Merge pull request #190 from BerkeleyLearnVerify/fix-lane-overlaps
Eric-Vin Oct 3, 2023
10d976f
Merge branch 'main' into LoadForceMesh
Eric-Vin Oct 3, 2023
a8902c8
Merge branch 'main' into 3DSerialization
Eric-Vin Oct 3, 2023
5125dac
Merge pull request #188 from BerkeleyLearnVerify/LoadForceMesh
dfremont Oct 3, 2023
805656e
good
Oct 4, 2023
c8f05f9
removed print statements
Oct 4, 2023
261177c
Merge remote-tracking branch 'upstream/airsim' into airsim
sunyesta Oct 4, 2023
98a3d4d
Visibiliy pruning work.
Eric-Vin Oct 4, 2023
2735522
formatted
sunyesta Oct 4, 2023
4174128
Use conditioned value when pruning visibility.
Eric-Vin Oct 4, 2023
6993f02
Only prune fixed view regions now.
Eric-Vin Oct 4, 2023
dec858b
Updated inradius and planarInradius to have proper return types.
Eric-Vin Oct 5, 2023
dbb149a
Fully implemented visibility pruning.
Eric-Vin Oct 5, 2023
5337150
Merge pull request #178 from BerkeleyLearnVerify/3DSerialization
dfremont Oct 6, 2023
95c96a3
include roadRegion as well as laneRegion in drivableRegion
dfremont Oct 7, 2023
fc1df60
robustify road network tests
dfremont Oct 7, 2023
14e676b
Path for PolygonalRegion unionAll
Eric-Vin Oct 9, 2023
05b3589
add test for PolygonalRegion.unionAll
dfremont Oct 9, 2023
4bd4eb7
Merge pull request #194 from BerkeleyLearnVerify/fix-drivableRegion
dfremont Oct 9, 2023
9110b25
Add proper dependency check.
Eric-Vin Oct 9, 2023
b790262
More work on visibility pruning.
Eric-Vin Oct 10, 2023
88d2ac2
Visibility pruning tests.
Eric-Vin Oct 11, 2023
1b878bc
Merge pull request #184 from BerkeleyLearnVerify/OnDocsUpdate
dfremont Oct 12, 2023
2a117c9
Couldn't get hack to work for vector norm.
Eric-Vin Oct 12, 2023
c45b4df
Pruning tweaks and VoxelRegion optimizations.
Eric-Vin Oct 13, 2023
9da91dc
Added additional documentation for using footprint w/ intersects op
Eric-Vin Oct 31, 2023
fb3e6a3
Merge branch 'main' into IntersectsOperator
Eric-Vin Nov 1, 2023
72bb72d
Fixed bad ref.
Eric-Vin Nov 1, 2023
fda2ee2
Update docs/glossary.rst
Eric-Vin Nov 6, 2023
502d505
Update src/scenic/core/object_types.py
Eric-Vin Nov 6, 2023
69c12b0
Minor fixes.
Eric-Vin Nov 7, 2023
363df2d
Clean up tests.
Eric-Vin Nov 8, 2023
6c66160
Merge pull request #183 from BerkeleyLearnVerify/IntersectsOperator
dfremont Nov 9, 2023
84071ae
Slight pruning module re-org.
Eric-Vin Nov 9, 2023
2f6fcd1
Added manifold as dependency and tore out engine option.
Eric-Vin Nov 9, 2023
75d004a
Merge branch 'main' into ManifoldEngine
Eric-Vin Nov 9, 2023
06f98c3
Work on updating view regions.
Eric-Vin Nov 10, 2023
29649c6
3.12 Updates (#197)
Eric-Vin Nov 14, 2023
cfaa8d5
testing
sunyesta Nov 27, 2023
36cb62f
test:
sunyesta Nov 27, 2023
4eb623e
yes
sunyesta Nov 28, 2023
a055456
updated
sunyesta Dec 7, 2023
64f15dd
Added missing import
Eric-Vin Dec 9, 2023
43959f0
Merge pull request #203 from BerkeleyLearnVerify/TypesImportFix
dfremont Dec 9, 2023
6404338
Tweaked angle cutoff values.
Eric-Vin Dec 13, 2023
98ec6d7
View region patches.
Eric-Vin Dec 18, 2023
b9d1df9
working but not clean
mariana-ZM Dec 19, 2023
49697af
Updated unifyMesh function.
Eric-Vin Dec 19, 2023
21ee673
Removed Blender/OpenSCAD install in CI.
Eric-Vin Dec 19, 2023
85e33f1
Updated docs to remove references to OpenSCAD/Blender.
Eric-Vin Dec 19, 2023
14fd3a8
cleaned
mariana-ZM Dec 21, 2023
ecc7df7
added docs
mariana-ZM Dec 22, 2023
3e05d45
fixed docs
mariana-ZM Dec 22, 2023
9fe5e53
fixed docs
mariana-ZM Dec 22, 2023
246a5b2
fixed docs
mariana-ZM Dec 22, 2023
8726b45
formatted
mariana-ZM Dec 22, 2023
fa0551a
fix GTA assertion failure with time param just before midnight
dfremont Jan 6, 2024
a9d4bc0
add test for aforementioned GTA time issue
dfremont Jan 6, 2024
7738224
PR fixes.
Eric-Vin Jan 11, 2024
b472b3a
ManifoldEngine PR Fixes.
Eric-Vin Jan 11, 2024
a37695b
Added error for when "require MONITOR" instead of "require monitor MO…
Eric-Vin Jan 11, 2024
53db638
Merge pull request #210 from BerkeleyLearnVerify/RequireMonitorError
dfremont Jan 11, 2024
39b2279
Merge pull request #208 from BerkeleyLearnVerify/GTATimeFix
dfremont Jan 11, 2024
0a75bfc
3DPruningImprovements PR Fixes
Eric-Vin Jan 12, 2024
d40cd68
Fixes for manifold api change.
Eric-Vin Jan 12, 2024
e18eb95
Merge pull request #169 from BerkeleyLearnVerify/ManifoldEngine
dfremont Jan 12, 2024
c4895b4
Merge pull request #175 from BerkeleyLearnVerify/3DPruningImprovements
dfremont Jan 12, 2024
ed1aa72
Added Missing Trimesh Import (#211)
Eric-Vin Jan 12, 2024
ac0fea9
Removed redundant mesh loading code.
Eric-Vin Jan 13, 2024
a32ebb4
Removed voxel caching workaround code.
Eric-Vin Jan 13, 2024
340c40b
Merge pull request #212 from BerkeleyLearnVerify/LoadMeshSimplification
dfremont Jan 23, 2024
bc58796
Added code for PathRegion default orientation + test
Eric-Vin Jan 30, 2024
c6c83f9
Update to black 2024 stable style
Eric-Vin Jan 31, 2024
ebbdf92
Added 2024 black commit.
Eric-Vin Jan 31, 2024
28a2a4f
Added orientation param documentation.
Eric-Vin Jan 31, 2024
783557d
Made variable internal.
Eric-Vin Jan 31, 2024
3fbecd4
Fix orientation inconsistenceis.
Eric-Vin Feb 1, 2024
f0b63a0
Fix formatting.
Eric-Vin Feb 1, 2024
995cd18
Fixed test quote placement
Eric-Vin Feb 2, 2024
12e8595
Added commit to ignore.
Eric-Vin Feb 2, 2024
92bb322
Update src/scenic/core/regions.py
Eric-Vin Feb 4, 2024
5d81fb0
Merge pull request #213 from BerkeleyLearnVerify/PathRegionOrientation
Eric-Vin Feb 6, 2024
a9931d4
upgrade to Tox 4; document how to use it
dfremont Feb 24, 2024
29de7c8
Merge pull request #216 from BerkeleyLearnVerify/tox
dfremont Feb 29, 2024
a3ed9e2
feat: adding ISSUE_TEMPLATE to facilitate issue triage
Mar 5, 2024
f9cb0f0
feat: adding new issue templates
Mar 7, 2024
0f62918
fix: reformatting yaml files and re-editing checklist items
Mar 7, 2024
36c49bc
feat: adding simular as option to bug report
Mar 7, 2024
b491f9f
feat: adding pull request template
Mar 7, 2024
042a1dc
fix: re-editing markdown
Mar 7, 2024
0a39353
fix: removing test failure as discussed with Daniel
Mar 8, 2024
168b870
fix: updating PR template based on feedback
Mar 8, 2024
20961e3
fix: addressing first round of feedback
Mar 12, 2024
6d62d9c
fix: addressing first round of feedback
Mar 12, 2024
39dd102
Merge pull request #219 from BerkeleyLearnVerify/abanuelo/pr-template
abanuelo Mar 13, 2024
a539e6e
fix: adding email
Mar 13, 2024
63b432d
Merge pull request #218 from BerkeleyLearnVerify/abanuelo/issue-template
abanuelo Mar 14, 2024
ec256a7
fix: fixing syntax for issue template
Mar 14, 2024
bcc0b5c
fix: typo
Mar 14, 2024
fcaf3ec
fix: moving out of workflow directory and fixing yml syntax, also add…
Mar 14, 2024
169a960
Merge pull request #220 from BerkeleyLearnVerify/abanuelo/fix-issue-t…
abanuelo Mar 14, 2024
f0694d2
feat: adding code cov for PyTest including statement & branch coverag…
abanuelo Mar 15, 2024
d5a21fc
feat: editing bug templates, adding to gitignore, and rename config y…
abanuelo Mar 15, 2024
1e84dbc
fix: adding seed under reproduce in bug report (#225)
abanuelo Apr 2, 2024
e936093
Carla Interface Convert `record` to Absolute Path (#223)
Eric-Vin Apr 3, 2024
b2bb2f7
fix: ignoring src/scenic/simulators in codecov report (#224)
abanuelo Apr 10, 2024
2797283
spawns cars using variation of simulator
tcdanielh Apr 11, 2024
ed540b0
Update spawnCar.scenic
tcdanielh Apr 11, 2024
7ed0ea4
add verifai
tcdanielh Apr 12, 2024
3098031
add demoDrone.scenic template example, added verifai_sampler.py, adde…
tcdanielh Apr 12, 2024
f2442cc
fix some scenarios
tcdanielh Apr 12, 2024
ba63352
Update scenic to latest
tcdanielh Apr 12, 2024
63d7b07
changes to scenarios
tcdanielh Apr 12, 2024
67bc06f
Merge pull request #2 from tcdanielh/airsim
redspry Apr 12, 2024
4ffb601
clean up
tcdanielh Apr 13, 2024
d1e5b9a
fix
tcdanielh Apr 13, 2024
344bee1
clean demo
tcdanielh Apr 13, 2024
a6cb73d
fix pose mismatch, demo prep, re-add simulator instruction for airsim
tcdanielh Apr 14, 2024
1aaba25
Merge pull request #3 from tcdanielh/airsim
tcdanielh Apr 14, 2024
af895f8
fix scenario, remove sphere_test.obj
tcdanielh Apr 14, 2024
3382ad9
added test.scenic to test verifai problems
tcdanielh Apr 14, 2024
e74083e
Merge pull request #4 from tcdanielh/airsim
tcdanielh Apr 14, 2024
4feddf3
Update demoDrone.scenic
tcdanielh Apr 14, 2024
0232e6f
feat: sync opened GitHub issues with Jira (#232)
abanuelo Apr 15, 2024
fef8fb4
patch verifai bug, plan b demo ready
tcdanielh Apr 16, 2024
fcef037
drone demo in NH
tcdanielh Apr 17, 2024
c9c5a54
verifai update 2.1.1
tcdanielh Apr 17, 2024
7f018e0
Visible/Non Visible Specifier Changes (#214)
Eric-Vin Apr 19, 2024
747f211
Color tweaks. (#240)
Eric-Vin Apr 22, 2024
1c49d80
Orientation Composition Fixes (#241)
Eric-Vin Apr 23, 2024
0f95996
More Color Fixes (#243)
Eric-Vin Apr 23, 2024
7e14cc7
Fix orientation conversion for CARLA (#245)
dfremont Apr 23, 2024
1464b3a
Update credits.rst (#242)
dfremont Apr 23, 2024
d846a15
feat: adding ci for simulator testing (#226)
abanuelo Apr 24, 2024
9da70c3
Fix Qiancheng's name in credits.rst (#247)
dfremont Apr 27, 2024
960a5f1
Add Tox plugin to work around cyclic dependency on verifai (#251)
dfremont Apr 27, 2024
eb4c4b1
fix: add more clarity to issue templates (#250)
abanuelo Apr 27, 2024
d7711c4
Various optimizations (#253)
dfremont May 2, 2024
01af6b1
feat: adding on-call reminder to Slack (#236)
abanuelo May 6, 2024
1924fbc
fix: defaulting carla_map to map .xodr path in scenic files (#237)
abanuelo May 7, 2024
9ba90a3
fix: adding on-call reminders to every Wednesday (#258)
abanuelo May 7, 2024
308c351
Fix CE tests and leakage issue (#259)
dfremont May 9, 2024
2bef39e
add action to set arbitrary object pose
tcdanielh May 10, 2024
6e3ebc2
Driving Domain 3D Compatibility (#254)
Eric-Vin May 15, 2024
6f37d6c
fix: CodeCov `.yml` enhancements (#264)
abanuelo May 16, 2024
e6832d1
Behavior Override Fix (#252)
Eric-Vin May 17, 2024
abde0f9
fix: updating pillow version for MacOS Apple Silicon installation (#270)
abanuelo May 22, 2024
836b0f8
Prepare 3.0.0rc1 (#271)
dfremont May 22, 2024
63725a3
feat: adding output gif for newtonian simulator (#273)
abanuelo Jun 5, 2024
1d434f9
feat: Adding Discourse Links to Relevant Sections (#272)
abanuelo Jun 7, 2024
2a1b29c
Prepare 3.0.0 (#277)
dfremont Jun 7, 2024
7126916
add logo to sdist for README (#278)
dfremont Jun 7, 2024
0c667bd
Minor Misc Fixes (#279)
Eric-Vin Jun 11, 2024
d7679fb
Docs update (#282)
dfremont Jun 13, 2024
82ef36e
Merge pull request #1 from Berkeley-UAV/airsim
tcdanielh Jun 25, 2024
d5e9e0d
documentation update for world info for large environments
tcdanielh Jun 25, 2024
846b44d
chore: gif cleanup for pytests (#285)
abanuelo Jul 5, 2024
7cde613
Fix Verifai Sampler with more than 10 objects (#280)
tcdanielh Jul 9, 2024
2d26e8d
Add test for VerifaiSampler with more than 10 features (#288)
dfremont Jul 10, 2024
a34460a
Better Handling of Type Casting Functions (#283)
Eric-Vin Jul 10, 2024
652a7ec
Requirement Boolean Negation Fix (#289)
Eric-Vin Jul 11, 2024
6c3bc2b
feat: adding dynamic scenario and object creation tests for CARLA (#227)
abanuelo Jul 12, 2024
f2c61b1
fix: Update simulator workflow (#291)
abanuelo Jul 12, 2024
488f45a
Heuristic Sampling Improvements (#287)
Eric-Vin Jul 18, 2024
df5595c
fix: add blueprint for test_brake for CARLA simulator tests (#292)
abanuelo Jul 26, 2024
5f134ad
Minor Tweaks to PolygonalRegion (#290)
Eric-Vin Jul 29, 2024
797efdd
AABB Tweaks + Testing (#298)
Eric-Vin Aug 14, 2024
50eed8e
Requirement Parsing Fixes (#299)
Eric-Vin Aug 14, 2024
e6b5f26
alwaysProvidesOrientation Patch and Test (#300)
Eric-Vin Aug 15, 2024
0abbbcd
Added no render option and fixed colors. (#302)
Eric-Vin Aug 25, 2024
db9cc11
ya
sunyesta Sep 21, 2024
57aebff
Delete src/scenic/simulators/airsim directory
sunyesta Sep 22, 2024
3b70f08
Delete examples/airsim directory
sunyesta Sep 22, 2024
ae709f6
Merge branch 'main' into airsim
sunyesta Sep 22, 2024
e1ecf20
fixed
sunyesta Sep 22, 2024
34d3419
fixed1
sunyesta Sep 22, 2024
40a67af
added new files
sunyesta Sep 22, 2024
4a445a6
added docs
sunyesta Sep 22, 2024
508d4f7
remove verifai from repo
tcdanielh Sep 30, 2024
6e81d90
Merge branch 'airsim' into sunyesta-airsim
tcdanielh Sep 30, 2024
08ce46a
cleanup
tcdanielh Sep 30, 2024
1bdb9f3
cleanup 2
tcdanielh Sep 30, 2024
e169abd
Merge remote-tracking branch 'upstream/airsim' into airsim
tcdanielh Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 41 additions & 0 deletions examples/airsim/catchDrone.scenic
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import math

# NOTE: add your world info path here
# param worldInfoPath = "[YOUR PATH HERE]"

# param timestep = .1

# drone1 patrols to a single location after spawning. ego spawns somehwere in the center area and tries to catch it before time ends
# run the src/scenic/simulators/airsim/verifai_sampler.py file to test with verifai.

model scenic.simulators.airsim.model


behavior Catch(target, speed = 5,tolerance = 1, offset = (0,0,0)):
try:
while True:
targetPosition = target.position + offset

velocity = targetPosition-self.position
distance = magnitude(velocity)
velocity = (velocity / distance) * speed
if distance > tolerance:
take SetVelocity(velocity)
wait
interrupt when (distance from self to drone1) < 3:
print("Caught drone1!")
terminate


centerArea = RectangularRegion(Vector(0,0,0), 0, 30, 30)

points = [(-1,2,2),(1,4,2),(-1,4,2),(-1,2,4),(1,2,4),(1,4,4),(-1,4,4)]

pos = VerifaiOptions(points)


drone1 = new Drone at (0,0,0),
with behavior Patrol([pos],True)

ego = new Drone in centerArea,
with behavior Catch(drone1)
80 changes: 80 additions & 0 deletions examples/airsim/demoDrone.scenic
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import math

# NOTE: add your world info path here
# param worldInfoPath = "[YOUR PATH HERE]"

model scenic.simulators.airsim.model

# This demo includes 1 adversarial drone, and 1 drone (ego) looking for this adversary.

class AdversaryDrone(Drone): # Drone class defined in model.scenic
patrolPoints: []
patrolPointsProb: []

# Find the adversary. drone1 is the adversary target
behavior FindAdversary(positions, speed = 5):
# try-interrupt statements: https://scenic-lang.readthedocs.io/en/latest/reference/statements.html#try-interrupt-statement
try:
print("POSSIBLE POSITIONS:")
print(positions)
while ((distance from self to drone1) >= 1):
selectedPoint = Discrete({positions[0]:drone1.patrolPointsProb[0],
positions[1]:drone1.patrolPointsProb[1],
positions[2]:drone1.patrolPointsProb[2],
positions[3]:drone1.patrolPointsProb[3]})

print("EGO CHECKING POSITION:")
print(selectedPoint)

do FlyToPosition(selectedPoint, speed=speed, tolerance=1,pidMode=True) # FlyToPosition behavior defined in behaviors.scenic

interrupt when (distance from self to drone1) < 15:
# when I see that I am within 15 meters of adversary, follow it
print("FOLLOWING ADVERSARY")
do Follow(drone1, speed=10, tolerance=1, offset=(0,0,0)) # Follow behavior defined in behaviors.scenic

interrupt when distance from self to drone1 < 7:
# when I get within 7 meters of adversary, terminate scenario
print("ADVERSARY FOUND")
terminate

# Adversary behavior. Patrol through given points.
behavior AdversaryBehavior(points, speed):
do Patrol(points, loop=True, speed=speed) # Patrol behavior defined in behaviors.scenic

ground = getPrexistingObj("ground")
workspaceArea = RectangularRegion(Vector(0,200,30), 0, 100, 100)

platforms = []
blockCount = 4
for i in range(blockCount):
platforms.append(new StaticObj on ground,
contained in workspaceArea,
with assetName "Cone", # use * to pick a random asset in assets
with parentOrientation 0,
with width 5,
with length 5,
with height 10)

points = []
for plat in platforms:
point = new Point on plat
points.append(point.position)

adversarySpawn = Options(points)

# Adversary drone spawning at random point
drone1 = new AdversaryDrone at adversarySpawn + (0,0,2),
with behavior AdversaryBehavior(points, speed=5)
# drone1.patrolPoints = possiblePoints
drone1.patrolPointsProb = [0.4, 0.2, 0.1, 0.3] # Probability distribution on the patrolPoints

# ego drone spawning somwhere in the workspace area
ego = new Drone at (0,Range(150, 250),12),
with behavior FindAdversary(points, speed=5)


# took too long to locate so terminate after x seconds
terminate after 15 seconds

record final (distance to drone1) as dist
7 changes: 3 additions & 4 deletions examples/airsim/flyFromBlockToBlock.scenic
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

model scenic.simulators.airsim.model

# Spawns 10 arbritrary static obstacles on the ground
# drone patrols to these positions uniformly randomly

platforms = []
ground = getPrexistingObj("ground")
Expand All @@ -19,13 +21,10 @@ for i in range(blockCount):
with height 10)





points = []
for plat in platforms:
point = new Point on plat
points.append(point.position)

drone1 = new Drone at Uniform(*points) + (0,0,1),
ego = new Drone at Uniform(*points) + (0,0,1),
with behavior Patrol(points,True)
18 changes: 15 additions & 3 deletions examples/airsim/followDrone.scenic
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import math
# NOTE: add your world info path here
# param worldInfoPath = "[YOUR PATH HERE]"

# Spawns 1 drone (ego) that patrols specific points, drone 2 follows ego

param timestep = .1

model scenic.simulators.airsim.model
Expand All @@ -24,10 +26,20 @@ behavior Follow(target, speed = 5,tolerance = 2, offset = (0,0,1)):
take SetVelocity(velocity)
wait

behavior Patrol(positions, loop=True, smooth = False, speed = 5,tolerance = 2):
while True:
for pos in positions:
do FlyToPosition(pos,speed=speed,pidMode= not smooth,tolerance=tolerance)

if not loop:
return


drone1 = new Drone at (0,0,0),
ego = new Drone at (0,0,0),
with behavior Patrol([(-1,2,2),(1,4,2),(-1,4,2),(-1,2,4),(1,2,4),(1,4,4),(-1,4,4)],True)

drone2 = new Drone at (0,1,0),
with behavior Follow(drone1)
with behavior Follow(ego)

terminate after 10 seconds

record final (distance to drone2) as dist
9 changes: 9 additions & 0 deletions examples/airsim/move_to.scenic
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# NOTE: add your world info path here
# param worldInfoPath = "[YOUR PATH HERE]"

model scenic.simulators.airsim.model


ego = new Drone at (0,0,0),
with behavior MoveToPosition((0,10,10),5)

22 changes: 11 additions & 11 deletions examples/airsim/multiDrone.scenic
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# NOTE: add your world info path here
# param worldInfoPath = "[YOUR PATH HERE]"
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)),
# NOTE: add your world info path here
# param worldInfoPath = "[YOUR PATH HERE]"

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)))
Loading
Loading