12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697 |
- import os
- import sys
- # sys.path.append(os.path.dirname(os.path.abspath(__file__)) +
- # "/../../onsite_parking/")
- sys.path.insert(0, "/home/yct/Documents/data/onsite/Onsite_Parking")
- import json
- import input.make_map as mp
- from planner.hybridastar import planner as planner
- from input import make_car
- from utils import replay
- from utils import map_display as mdp
- import matplotlib.pyplot as plt
- import numpy as np
- import time
- # sys.setrecursionlimit(3000) # 将默认的递归深度修改为3000
- 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
- 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(500, 1200, 500)
- y = np.linspace(1200, 680, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5500, 1200, 500)
- y = np.linspace(2800, 1800, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(5800, 2000, 500)
- y = np.linspace(1800, 680, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(1000, 2100, 500)
- y = np.linspace(700, 700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 800
- if park == '18': # TODO
- pass
- 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
- x = np.linspace(7200, 7200, 500)
- y = np.linspace(7000, 0, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(9800, 9800, 500)
- y = np.linspace(4000, 0, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8000, 8000, 500)
- y = np.linspace(2000, 0, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(8000, 9800, 500)
- y = np.linspace(2000, 2000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- C.XY_RESO = C.XY_RESO - 500
- 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
- pass
- 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':# TODO 35 37 38 39
- 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])
- elif park == '21' or park == '22' or park == '23':
- 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(5600, 5600, 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(3000, 3500, 100)
- y = np.linspace(3100, 3100, 100)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '24' or park == '25' or park == '26':
- C.XY_RESO = C.XY_RESO - 800
- 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(4500, 7000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- x = np.linspace(3500, 4500, 500)
- y = np.linspace(4500, 4500, 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, 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, 3500, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- elif park == '27':
- pass
- elif 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])
- elif park == '30' or park == '31' or park == '32':
- C.XY_RESO = C.XY_RESO - 900
- 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])
- x = np.linspace(0, 4500, 500)
- y = np.linspace(5500, 5500, 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' or park == '58' or park == '57'or park == '56'or 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, 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 == '54':
- 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, 9550, 500)
- y = np.linspace(5000, 4500, 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 == '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, 5200, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '51' or park == '50' or park == '49':
- 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(7000, 7000, 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])
- if park == '48':
- 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, 4400, 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(7000, 7000, 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, 10500, 500)
- y = np.linspace(3100, 3100, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if 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, 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(700, 700, 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, 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])
- 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'or park == '42'or park == '41'or 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, 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 == '39':
- 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(5700, 5700, 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(7000, 8500, 500)
- y = np.linspace(1700, 1700, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- if park == '38':
- 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(5700, 5700, 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 == '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(9000, 9000, 500)
- y = np.linspace(6700, 4000, 500)
- for i in range(len(x)):
- ox.append(x[i])
- oy.append(y[i])
- return ox,oy,isSearchFailed
- def main():
- # 输入input文件夹下场景文件
- map_path = './input/B01.json'
- # mdp.map_display(map_path) # 仅绘制地图
- ox, oy,sp,gp = mp.make_map(map_path)
- sx, sy, syaw0 = sp['x'], sp['y'], sp['yaw']
- C = make_car.C
- # 获取目标停车位
- park = '26'
- gx, gy, gyaw0 = gp[park]['x_end'], gp[park]['y_end'], gp[park]['yaw']
- isSearchFailed = False
- ox, oy, isSearchFailed = changeOxyB01(C,park,ox,oy)
- plt.plot(ox, oy, ",k")
- plt.show()
- start = time.time()
- # 规划算法
- path = planner.hybrid_astar_planning(sx, sy, syaw0, gx, gy, gyaw0, ox, oy, C.XY_RESO, C.YAW_RESO)
- end = time.time()
- print(f"Time: {end-start}s")
- # 算法测试结果保存
- if not path: plt.plot(ox, oy, ",k")
- plt.show()
- output_dit={
- "output_x":path.x,
- "output_y": path.y,
- "output_yaw": path.yaw,
- "output_dir": path.direction,
- }
- with open(f"./output/result_{map_path.split('/')[-1].split('.json')[0]}_{park}.json", "w") as file:
- json.dump(output_dit, file)
- # 仿真回放
- result_path = f"./output/result_{map_path.split('/')[-1].split('.json')[0]}_{park}.json"
- replay.replay(map_path, result_path)
- if __name__ == '__main__':
- main()
|