Esempio n. 1
0
 def __init__(self,cfgFileName):
     super(B_BCoveragePathPlan,self).__init__(cfgFileName)
     self.cfgFileName = cfgFileName 
     readCfg = rd.Read_Cfg(cfgFileName)                        
     self.robRow = int(readCfg.getSingleVal('robRow'))
     self.robCol = int(readCfg.getSingleVal('robCol'))
     self.robPos = (self.robRow,self.robCol)
Esempio n. 2
0
def drawEdge(cfgFileName='5_20_20_80_Outdoor_Cfg.txt', edges=[]):
    py.sign_in('tesla_fox', 'HOTRQ3nIOdYUUszDIfgN')
    readCfg = rd.Read_Cfg(cfgFileName)
    data = []
    readCfg.get('row', data)
    row = int(data.pop())
    readCfg.get('col', data)
    col = int(data.pop())
    mat = np.zeros((row, col))
    obRowLst = []
    obColLst = []
    readCfg.get('obRow', obRowLst)
    readCfg.get('obCol', obColLst)

    for i in range(len(obRowLst)):
        obRow = int(obRowLst[i])
        obCol = int(obColLst[i])
        mat[obRow][obCol] = 1

    robRowLst = []
    robColLst = []
    readCfg.get('robRow', robRowLst)
    readCfg.get('robCol', robColLst)
    env = Env(mat)
    env.addgrid()
    robLst = []
    robLst.append(robRowLst)
    robLst.append(robColLst)
    env.addRobotStartPnt(robLst)
    env.addEdges(edges)
    cfgFileName = cfgFileName.split('data//')[1]
    cfgFileName = cfgFileName.split('.dat')[0]
    env.drawPic('./png/env_' + cfgFileName)
Esempio n. 3
0
 def __init__(self,cfgFileName = './/data//1_8_8_3_Cfg.dat'):
     
     readCfg = rd.Read_Cfg(cfgFileName)    
     data = []
     readCfg.get('row',data)
     self.row = int(data.pop())    
     readCfg.get('col',data)
     self.col = int(data.pop())            
     self.mat = np.zeros((self.row,self.col))
     
     self.obRowLst = []
     self.obColLst = []
     readCfg.get('obRow',self.obRowLst)
     readCfg.get('obCol',self.obColLst)
     
     for i in range(len(self.obRowLst)):
         obRow = int(self.obRowLst[i])
         obCol = int(self.obColLst[i])
         self.mat[obRow][obCol] = 1 
 
 
     self.robRowLst = []
     self.robColLst = []
     readCfg.get('robRow',self.robRowLst)
     readCfg.get('robCol',self.robColLst)
     
     self.proLevLst = []
     readCfg.get('proLevGrid',self.proLevLst)
     self.proLevNum = int(readCfg.getSingleVal('proLevNum'))        
     self.proMat = []
Esempio n. 4
0
def drawIns(cfgFileName='5_20_20_80_Outdoor_Cfg.txt',
            drawType=1,
            fileName='nothing',
            fileType=False):
    py.sign_in('tesla_fox', 'HOTRQ3nIOdYUUszDIfgN')
    #    conFileDir = './/data//'
    #    degNameCfg = conFileDir + cfgFileName

    readCfg = rd.Read_Cfg(cfgFileName)

    data = []
    readCfg.get('row', data)
    row = int(data.pop())

    readCfg.get('col', data)
    col = int(data.pop())

    mat = np.zeros((row, col))

    obRowLst = []
    obColLst = []
    readCfg.get('obRow', obRowLst)
    readCfg.get('obCol', obColLst)

    for i in range(len(obRowLst)):
        obRow = int(obRowLst[i])
        obCol = int(obColLst[i])
        mat[obRow][obCol] = 1

    robRowLst = []
    robColLst = []
    readCfg.get('robRow', robRowLst)
    readCfg.get('robCol', robColLst)

    proLevLst = []
    readCfg.get('proLevGrid', proLevLst)
    env = Env(mat)

    env.proLevNum = int(readCfg.getSingleVal('proLevNum'))
    #    proMat  = np.zeros((row,col),dtype = int)

    #case 1 draw Environment
    if (drawType == 1):
        #        env.addgrid()
        env.addProGrid(proLevLst=proLevLst)
        robLst = []
        robLst.append(robRowLst)
        robLst.append(robColLst)
        env.addRobotStartPnt(robLst)
        cfgFileName = cfgFileName.split('data//')[1]
        cfgFileName = cfgFileName.split('.dat')[0]
        env.drawPic('./png/env_' + cfgFileName, fileType)
Esempio n. 5
0
    def __init__(self, cfgFileName):
        readCfg = rd.Read_Cfg(cfgFileName)
        data = []
        readCfg.get('row', data)
        self.row = int(data.pop())
        readCfg.get('col', data)
        self.col = int(data.pop())
        self.mat = np.zeros((self.row, self.col))

        obRowLst = []
        obColLst = []
        readCfg.get('obRow', obRowLst)
        readCfg.get('obCol', obColLst)

        for i in range(len(obRowLst)):
            obRow = int(obRowLst[i])
            obCol = int(obColLst[i])
            self.mat[obRow][obCol] = 1
#        print(self.mat)
        self.constructGraph()