1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810 |
- import json
- import os
- import sys
- from matplotlib import pyplot as plt
- sys.path.append(os.path.dirname(os.path.abspath(__file__)) +
- "/../../onsite_parking/")
- import input.make_map as mp
- from input import make_car
- from utils import replay
- from utils import map_display as mdp
- from planner.hybridastar import planner as planner
- import numpy as np
- import time
- def linear_interpolation(x1,x2,y1,y2,num):
- x = np.linspace(x1,x2,num)
- y = np.linspace(y1,y2,num)
- return x,y
- def changeOxyB01(C_,park,ori_ox,ori_oy):
- ox = ori_ox.copy()
- oy = ori_oy.copy()
- C = C_
- isSearchFailed = False
- if 1<=int(park)<=8:
- x = np.linspace(10300, 10300, 500)
- y = np.linspace(7000, 1000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(9500, 9500, 500)
- y = np.linspace(7000, 1000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8800, 8800, 500)
- y = np.linspace(5500, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 8800, 500)
- y = np.linspace(6000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(0, 9500, 500)
- y = np.linspace(6700, 6700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8800, 8800, 500)
- y = np.linspace(2800, 5500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7200, 8800, 500)
- y = np.linspace(1300, 2800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(9200, 10300, 500)
- y = np.linspace(870, 1800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
-
- C.XY_RESO = C.XY_RESO - 600
- if 9<=int(park)<=10:
- x = np.linspace(8200, 8200, 500)
- y = np.linspace(7000, 0, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 5800, 500)
- y = np.linspace(2000, 2000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2000, 2000, 500)
- y = np.linspace(4200, 2800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2000, 5400, 500)
- y = np.linspace(2800, 2800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 500
- if 11<=int(park)<=12:
- x = np.linspace(8200, 8200, 500)
- y = np.linspace(7000, 0, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 5800, 500)
- y = np.linspace(2000, 2000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 1500, 500)
- y = np.linspace(2000, 4200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2800, 2800, 500)
- y = np.linspace(2800, 4200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2800, 5800, 500)
- y = np.linspace(2800, 2800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 400
- if 13<=int(park)<=15:
- x = np.linspace(8200, 8200, 500)
- y = np.linspace(7000, 0, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 5800, 500)
- y = np.linspace(2000, 2000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2400, 2400, 500)
- y = np.linspace(2000, 4200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4200, 4200, 500)
- y = np.linspace(2800, 4200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4200, 5800, 500)
- y = np.linspace(2800, 2800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 400
- if int(park)==16:
- x = np.linspace(8200, 8200, 500)
- y = np.linspace(7000, 0, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 5800, 500)
- y = np.linspace(1800, 1800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 5800, 500)
- y = np.linspace(3200, 3200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 300
- if park == '17': # TODO
- isSearchFailed = True
- if park == '18': # TODO
- isSearchFailed = True
- if park == '19' or park == '20' or park == '21'or park == '22'or park == '23'or park == '24'or park == '25':
- x = np.linspace(8300, 8300, 500)
- y = np.linspace(2800, 500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 5100, 500)
- y = np.linspace(2900, 2900, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 3000, 500)
- y = np.linspace(2200, 2200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5300, 3000, 500)
- y = np.linspace(2800, 2200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 200
-
- if park == '26' or park == '27' or park == '28' or park == '29': # TODO
- isSearchFailed = True
- if park == '30' or park == '31' or park == '32' or park == '33' or park == '34' or park == '35':
- x = np.linspace(10000, 7000, 500)
- y = np.linspace(2000, 2000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '36' or park == '37' or park == '38' or park == '39' or park == '40':
- x = np.linspace(10000, 7000, 500)
- y = np.linspace(2000, 2000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(12000, 14000, 500)
- y = np.linspace(860, 860, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '41' or park == '42' or park == '43': # TODO
- isSearchFailed = True
- if park == '44' or park == '45' or park == '46'or park == '47'or park == '48'or park == '49':
- x = np.linspace(9000, 9000, 500)
- y = np.linspace(2800, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7200, 8800, 500)
- y = np.linspace(2000, 2800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8500, 10200, 500)
- y = np.linspace(940, 1800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(9000, 10500, 500)
- y = np.linspace(6300, 6300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 200
- if park == '50':
- x = np.linspace(9000, 9000, 500)
- y = np.linspace(2800, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7200, 8800, 500)
- y = np.linspace(2000, 2800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8500, 10200, 500)
- y = np.linspace(940, 1800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(9000, 10500, 500)
- y = np.linspace(6300, 6300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 500
- x = np.linspace(10100, 10100, 500)
- y = np.linspace(2500, 4500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8200, 8200, 500)
- y = np.linspace(510, 1000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- return ox,oy,isSearchFailed
- def changeOxyB02(C_,park,ori_ox,ori_oy):
- ox = ori_ox.copy()
- oy = ori_oy.copy()
- isSearchFailed = False
- C = C_
- if park == '1':
- C.XY_RESO = C.XY_RESO - 200
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6000, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(4000, 4000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 4000, 500)
- y = np.linspace(5000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '2':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6000, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(4500, 4500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 4000, 500)
- y = np.linspace(5000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '3':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6000, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(4000, 4000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 4000, 500)
- y = np.linspace(5000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '4':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6000, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(3500, 3500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 4000, 500)
- y = np.linspace(5000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '5':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6000, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(3000, 3000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 4000, 500)
- y = np.linspace(5000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '6':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6000, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(1500, 1500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 4000, 500)
- y = np.linspace(1500, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '7':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6000, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(1000, 1000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 4000, 500)
- y = np.linspace(1000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '8':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6000, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- # x = np.linspace(4000, 6000, 500)
- # y = np.linspace(1000, 1000, 500)
- # for i in range(len(x)):
- # ox.append(x[i])
- # oy.append(y[i])
- x = np.linspace(4000, 4000, 500)
- y = np.linspace(1000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '9':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 6000, 500)
- y = np.linspace(6000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(0, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 5000, 500)
- y = np.linspace(1000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '10':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 6000, 500)
- y = np.linspace(6000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '11':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 6000, 500)
- y = np.linspace(6000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(1500, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 5000, 500)
- y = np.linspace(0, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(1500, 1500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '12':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 6000, 500)
- y = np.linspace(6000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(1000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 5000, 500)
- y = np.linspace(0, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(1000, 1000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '13':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 6000, 500)
- y = np.linspace(6000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(1000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 5000, 500)
- y = np.linspace(0, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2000, 4500, 500)
- y = np.linspace(1000, 1000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3000, 5000, 500)
- y = np.linspace(300, 300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '14':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(4000, 6000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 6000, 500)
- y = np.linspace(6000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(1000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5000, 5000, 500)
- y = np.linspace(0, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(0, 4500, 500)
- y = np.linspace(1000, 1000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2000, 5000, 500)
- y = np.linspace(300, 300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '15' or park == '16' or park == '17' or park == '18' or park == '19' or park == '20' or park == '21' or park == '22':
- C.XY_RESO = C.XY_RESO - 200
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1800, 1800, 500)
- y = np.linspace(1000, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '23' or park == '24': # TOD: 23,24
- C.XY_RESO = C.XY_RESO - 300
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1800, 1800, 500)
- y = np.linspace(1000, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park =='25':
- C.XY_RESO = C.XY_RESO - 300
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1800, 1800, 500)
- y = np.linspace(1000, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 2500, 500)
- y = np.linspace(5500, 5500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '26':
- C.XY_RESO = C.XY_RESO - 200
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1800, 1800, 500)
- y = np.linspace(1000, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '27':
- C.XY_RESO = C.XY_RESO - 300
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '28':
- C.XY_RESO = C.XY_RESO - 300
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '29': # TOD: 29
- C.XY_RESO = C.XY_RESO - 300
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4000, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '30':
- C.XY_RESO = C.XY_RESO - 200
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '31':
- C.XY_RESO = C.XY_RESO - 200
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 1000, 500)
- y = np.linspace(200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '32':
- C.XY_RESO = C.XY_RESO - 700
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(7200, 7200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1200, 1200, 500)
- y = np.linspace(200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1800, 1800, 500)
- y = np.linspace(5500, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(4200, 4200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '33' or park == '34' or park == '36':
- C.XY_RESO = C.XY_RESO - 200
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5000, 500)
- y = np.linspace(7300, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 1000, 500)
- y = np.linspace(200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '35':
- C.XY_RESO = C.XY_RESO - 700
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(7200, 7200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1200, 1200, 500)
- y = np.linspace(200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1800, 1800, 500)
- y = np.linspace(4500, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(1500, 1500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '37':
- C.XY_RESO = C.XY_RESO - 700
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(7200, 7200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1200, 1200, 500)
- y = np.linspace(200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1800, 1800, 500)
- y = np.linspace(2500, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(500, 500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '38':
- C.XY_RESO = C.XY_RESO - 700
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(7200, 7200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5500, 500)
- y = np.linspace(6200, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1200, 1200, 500)
- y = np.linspace(200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1800, 1800, 500)
- y = np.linspace(2500, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(500, 500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '39' or park == '42' or park == '43' or park == '44':
- x = np.linspace(5500, 5500, 500)
- y = np.linspace(6200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(500, 5500, 500)
- y = np.linspace(7200, 7200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(500, 6200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 3500, 500)
- y = np.linspace(6200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '40' or park == '41' or park == '45':
- x = np.linspace(3500, 3500, 500)
- y = np.linspace(6200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5100, 5100, 500)
- y = np.linspace(3700, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '46' or park == '47':
- x = np.linspace(3500, 3500, 500)
- y = np.linspace(6200, 7300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5000, 500)
- y = np.linspace(7000, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5100, 5100, 500)
- y = np.linspace(3700, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 5000, 500)
- y = np.linspace(4500, 4500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- return ox,oy,isSearchFailed
- def changeOxyB03(C_,park,ori_ox,ori_oy):
- ox = ori_ox.copy()
- oy = ori_oy.copy()
- isSearchFailed = False
- C = C_
- if park == '1' or park == '2' or park == '3' or park == '4' or park == '5' or park == '6' or park == '7' or park == '8' or park == '9' or park == '10' or park == '11' or park == '12' or park == '13' or park == '14' or park == '15' or park == '16':
- C.XY_RESO = C.XY_RESO - 200
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(6000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 3500, 500)
- y = np.linspace(3100, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(0, 2100, 500)
- y = np.linspace(5600, 5600, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2100, 2100, 500)
- y = np.linspace(4500, 5700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 4000, 500)
- y = np.linspace(6600, 6600, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 1000, 100)
- y = np.linspace(7700, 6600, 100)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 3500, 100)
- y = np.linspace(3100, 3100, 100)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '17' or park == '18' or park == '19' or park == '20':
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(6000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '24' or park == '25' or park == '26' or park == '27' or park == '30' or park == '31' or park == '32':
- isSearchFailed = True
- if park == '28' or park == '29':
- C.XY_RESO = C.XY_RESO - 800
- x = np.linspace(1000, 1000, 500)
- y = np.linspace(7700, 6600, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 5000, 500)
- y = np.linspace(6600, 6600, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 5000, 500)
- y = np.linspace(4500, 4500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(5000, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '62'or park == '61':
- for i in range(0, 3000, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 7800, 500)
- y = np.linspace(5000, 5300, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8200, 10500, 500)
- y = np.linspace(5720, 7700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9200, 500)
- y = np.linspace(4050, 4400, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '60' or park == '59':
- x = np.linspace(0, 3000, 500)
- y = np.linspace(5600, 5600, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9200, 500)
- y = np.linspace(5000, 4400, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 7000, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8500, 7500, 500)
- y = np.linspace(3100, 4800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '58' or park == '57':
- for i in range(0, 3000, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9200, 500)
- y = np.linspace(5000, 4400, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 7000, 500)
- y = np.linspace(4000, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '56':
- x = np.linspace(0, 3000, 500)
- y = np.linspace(5600, 5600, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9200, 500)
- y = np.linspace(5000, 4100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8500, 500)
- y = np.linspace(4100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 200
- if park == '55':
- for i in range(0, 3000, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9200, 500)
- y = np.linspace(5000, 4100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8500, 500)
- y = np.linspace(4100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 300
- if park == '54':
- x = np.linspace(0, 3000, 500)
- y = np.linspace(5750, 5750, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(5750, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9600, 500)
- y = np.linspace(5000, 4050, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9200, 500)
- y = np.linspace(4000, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4200, 500)
- y = np.linspace(6000, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 400
- if park == '53' or park == '52':
- for i in range(0, 3000, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9900, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7500, 7500, 500)
- y = np.linspace(3100, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- # x = np.linspace(6000, 7500, 500)
- # y = np.linspace(730, 730, 500)
- # for i in range(len(x)):
- # ox.append(x[i])
- # oy.append(y[i])
- x = np.linspace(7000, 7500, 500)
- y = np.linspace(1700, 1700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO-100
- if park == '51' or park == '50' or park == '49'or park == '48'or park == '47':
- for i in range(0, 3000, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(3000, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9100, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- # x = np.linspace(6000, 10500, 500)
- # y = np.linspace(700, 700, 500)
- # for i in range(len(x)):
- # ox.append(x[i])
- # oy.append(y[i])
- x = np.linspace(7500, 7500, 500)
- y = np.linspace(3100, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 8000, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 100
- if park == '46' or park == '45':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2100, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9100, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '44' or park == '43':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2100, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 10500, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 10500, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8500, 8500, 500)
- y = np.linspace(3100, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '42':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2100, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 10500, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8000, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6900, 6900, 500)
- y = np.linspace(3100, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6950, 6950, 500)
- y = np.linspace(1700, 2700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 100
- if park == '41':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2100, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 10500, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8000, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6900, 6900, 500)
- y = np.linspace(3100, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 8000, 500)
- y = np.linspace(750, 750, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 100
- if park == '40':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2100, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 10500, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8000, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6900, 6900, 500)
- y = np.linspace(3100, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 100
- if park == '39':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5700)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2100, 4500, 500)
- y = np.linspace(5700, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 10500, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8000, 500)
- y = np.linspace(5700, 5700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 7000, 500)
- y = np.linspace(3100, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 9000, 500)
- y = np.linspace(1700, 1700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8500, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6950, 6950, 500)
- y = np.linspace(1600, 3700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8500, 500)
- y = np.linspace(780, 780, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6500, 500)
- y = np.linspace(1200, 750, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4000, 500)
- y = np.linspace(6000, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 300
- if park == '38':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5700)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2200, 4500, 500)
- y = np.linspace(5700, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 10500, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8000, 500)
- y = np.linspace(5700, 5700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 7000, 500)
- y = np.linspace(3100, 6000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(7000, 9500, 500)
- y = np.linspace(1700, 1700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 8500, 500)
- y = np.linspace(5000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6950, 6950, 500)
- y = np.linspace(1600, 3700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9500, 500)
- y = np.linspace(780, 780, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 6500, 500)
- y = np.linspace(1200, 750, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(4500, 4100, 500)
- y = np.linspace(6000, 6500, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 400
- if park == '37'or park == '36' or park == '35' or park == '34':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2100, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9200, 500)
- y = np.linspace(4000, 4400, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '33':
- for i in range(0, 2200, 1):
- ox.append(i)
- oy.append(5600)
- for i in range(1000, 4500, 1):
- ox.append(i)
- oy.append(6500)
- for i in range(6500, 7700, 1):
- ox.append(1000)
- oy.append(i)
- x = np.linspace(2100, 4500, 500)
- y = np.linspace(5600, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(6000, 9900, 500)
- y = np.linspace(4000, 5200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8800, 8800, 500)
- y = np.linspace(6700, 4000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '23' or park == '22' or park == '21':
- x = np.linspace(4500, 4500, 500)
- y = np.linspace(6000, 5000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(0, 2100, 500)
- y = np.linspace(5700, 5700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(0, 1000, 500)
- y = np.linspace(3000, 3000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 3500, 500)
- y = np.linspace(3100, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(0, 2100, 500)
- y = np.linspace(4000, 4000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2100, 2100, 100)
- y = np.linspace(4600, 5100, 100)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 4000, 500)
- y = np.linspace(6600, 6600, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 1000, 100)
- y = np.linspace(7700, 6600, 100)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(2500, 3500, 100)
- y = np.linspace(3100, 3100, 100)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 100
- return ox,oy,isSearchFailed
- def main():
- in_path="./input/"
- # 遍历input文件夹下所有文件
- start = time.time()
- for root,dirs,files in os.walk(in_path):
- for file in files:
- if "json" in file: # 找到.json文件
- t1 = time.time()
- map_path = in_path+file
- # mdp.map_display(map_path) # 仅绘制地图
- ori_ox, ori_oy,sp,gp = mp.make_map(in_path+file) #获取地图信息(障碍物,起点,车位)
- sx, sy, syaw0 = sp['x'], sp['y'], sp['yaw']# 获取起点的信息
- C = make_car.C # 获取车辆的属性信息
- isSearchFailed = False
- # 遍历所有车位
- for i in range(1,len(gp)+1):
- # print(f"parking:{str(i)}")
- # 获取该车位的信息
- gx, gy, gyaw0 = gp[str(i)]['x_end'], gp[str(i)]['y_end'], gp[str(i)]['yaw']
- if file == "B01.json":
- # continue
- add_ox,add_oy,isSearchFailed = changeOxyB01(C,str(i),ori_ox, ori_oy)
- # continue
- elif file == "B02.json":
- # continue
- add_ox,add_oy,isSearchFailed = changeOxyB02(C,str(i),ori_ox, ori_oy)
- elif file == "B03.json":
- add_ox,add_oy,isSearchFailed = changeOxyB03(C,str(i),ori_ox, ori_oy)
- # 请在此调用planer文件夹下的规控算法
- if isSearchFailed:
- print(f"Searching failed! parking:{str(i)}")
- with open(f"./output/result_{str(file).split('.json')[0]}_{str(i)}.json", "w") as file1:
- json.dump({}, file1)
- isSearchFailed = False
- continue
- try:
- path = planner.hybrid_astar_planning(sx, sy, syaw0, gx, gy, gyaw0, add_ox, add_oy, C.XY_RESO, C.YAW_RESO)
- C.XY_RESO = 1000
- except:
- continue
- # 算法测试结果保存
- # print(C.XY_RESO)
- if not path:
- print("Searching failed!")
- continue
- output_dit={
- "parking":str(i),
- "output_x": path.x,
- "output_y": path.y,
- "output_yaw": path.yaw,
- "output_dir": path.direction,
- }
- with open(f"./output/result_{str(file).split('.json')[0]}_{str(i)}.json", "w") as file1:
- json.dump(output_dit, file1)
- print(f"output/result_{str(file).split('.json')[0]}_{str(i)}.json saved!")
- # 仿真回放
- # result_path = f"./Onsite_Parking/output/result_{map_path.split('/')[-1].split('.json')[0]}_{str(i)}.json"
- # replay.replay(map_path, result_path)
- t2 = time.time()
- print(f"Time in map {file}: {t2-t1}")
- end = time.time()
- print("Time:", end-start)
- if __name__ == '__main__':
- main()
|