コード例 #1
0
ファイル: main.py プロジェクト: LorenzoChiana/plot4wrd
def createPathNoNoise(animation):
    stay(positions.loc['Pos0'], 20)
    move(positions.loc['Pos0'], positions.loc['Pos1'], 60)
    stay(positions.loc['Pos1'], 20)
    move(positions.loc['Pos1'], positions.loc['Pos2'], 30)
    stay(positions.loc['Pos2'], 20)
    move(positions.loc['Pos2'], positions.loc['Pos1'], 30)
    move(positions.loc['Pos1'], positions.loc['Pos3'], 60)
    stay(positions.loc['Pos3'], 20)
    move(positions.loc['Pos3'], positions.loc['Pos4'], 30)
    stay(positions.loc['Pos4'], 20)
    move(positions.loc['Pos4'], positions.loc['Pos3'], 30)
    move(positions.loc['Pos3'], positions.loc['Pos5'], 120)
    stay(positions.loc['Pos5'], 20)
    move(positions.loc['Pos5'], positions.loc['Pos6'], 30)
    stay(positions.loc['Pos6'], 20)
    move(positions.loc['Pos6'], positions.loc['Pos5'], 30)
    move(positions.loc['Pos5'], positions.loc['Pos0'], 240)

    path_df['x'] = 5 - path_df['x']
    fig, ax = plt.subplots(figsize=(xfig, yfig))
    plotStanza(xfig, yfig, pd.DataFrame(), path_df, fig)
    path_df.to_csv('UWB_NoNOISE_' +
                   str(datetime.today().strftime('%y%m%d')).split()[0] +
                   '.csv',
                   encoding='utf-8')

    if animation:
        a = animate.AnimatedScatter(len(path_df), path_df, xfig, yfig,
                                    pd.DataFrame())
コード例 #2
0
ファイル: main.py プロジェクト: LorenzoChiana/plot4wrd
def createCC90Path(animation):
    stay(positions.loc['Pos0'], 20, 'hight')
    move(positions.loc['Pos0'], positions.loc['Pos1'], 60, 'hight')
    stay(positions.loc['Pos1'], 20, 'hight')
    move(positions.loc['Pos1'], positions.loc['Pos2'], 30, 'hight2medium')
    stay(positions.loc['Pos2'], 20, 'medium')
    move(positions.loc['Pos2'], positions.loc['Pos1'], 30, 'medium2hight')
    move(positions.loc['Pos1'], positions.loc['Pos3'], 60, 'hight2medium')
    stay(positions.loc['Pos3'], 20, 'low')
    move(positions.loc['Pos3'], positions.loc['Pos4'], 30, 'low2medium')
    stay(positions.loc['Pos4'], 20, 'medium')
    move(positions.loc['Pos4'], positions.loc['Pos3'], 30, 'medium2low')
    move(positions.loc['Pos3'], positions.loc['Pos5'], 120, 'low')
    stay(positions.loc['Pos5'], 20, 'low')
    move(positions.loc['Pos5'], positions.loc['Pos6'], 30, 'low2medium')
    stay(positions.loc['Pos6'], 20, 'medium')
    move(positions.loc['Pos6'], positions.loc['Pos5'], 30, 'medium2low')
    move(positions.loc['Pos5'], positions.loc['Pos3'], 120, 'low')
    move(positions.loc['Pos3'], positions.loc['Pos1'], 60, 'medium2hight')
    move(positions.loc['Pos1'], positions.loc['Pos0'], 60, 'hight')

    pathCC90_df = path_df
    pathCC90_df['x'] = 5 - path_df['x']
    fig, ax = plt.subplots(figsize=(xfig, yfig))
    plotStanza(xfig, yfig, anchors_df.loc['CC90'], pathCC90_df, fig)
    pathCC90_df.to_csv('UWB_CC90_' +
                       str(datetime.today().strftime('%y%m%d')).split()[0] +
                       '.csv',
                       encoding='utf-8')

    if animation:
        a = animate.AnimatedScatter(len(pathCC90_df), pathCC90_df, xfig, yfig,
                                    anchors_df.loc['CC90'])
コード例 #3
0
ファイル: main.py プロジェクト: LorenzoChiana/plot4wrd
def createCV2Path(animation):
    stay(positions.loc['Pos0'], 20, 'medium', noise_canc=(60, 65))
    move(positions.loc['Pos0'],
         positions.loc['Pos1'],
         60,
         'medium2low',
         noise_canc=(40, 65))
    stay(positions.loc['Pos1'], 20, 'low', noise_canc=(40, 65))

    move(positions.loc['Pos1'],
         positions.loc['Pos2'],
         30,
         'low2medium',
         noise_canc=(50, 60))
    stay(positions.loc['Pos2'], 20, 'medium', noise_canc=(50, 70))
    move(positions.loc['Pos2'],
         positions.loc['Pos1'],
         30,
         'medium2low',
         noise_canc=(60, 65))
    move(positions.loc['Pos1'],
         positions.loc['Pos3'],
         60,
         'low2medium',
         noise_canc=(50, 60))
    stay(positions.loc['Pos3'], 20, 'medium', noise_canc=(80, 90))

    pos = getMiddlePath(positions.loc['Pos4'], positions.loc['Pos3'], 1 / 3)
    move(positions.loc['Pos3'], pos, 10, 'low', 'left', noise_canc=(40, 55))
    move(pos, positions.loc['Pos4'], 20, 'low', 'left', noise_canc=(90, 95))
    stay(positions.loc['Pos4'], 20, 'medium', 'top-left', noise_canc=(85, 90))
    move(positions.loc['Pos4'], pos, 20, 'low', noise_canc=(90, 95))
    move(pos, positions.loc['Pos3'], 10, 'low', 'left', noise_canc=(30, 45))

    # move(positions.loc['Pos3'], positions.loc['Pos4'], 30, 'medium',noise_canc=(100,100))
    # stay(positions.loc['Pos4'], 20, 'medium','',noise_canc=(100,100))
    # move(positions.loc['Pos4'], positions.loc['Pos3'], 30, 'medium',noise_canc=(100,100))

    move(positions.loc['Pos3'],
         positions.loc['Pos5'],
         120,
         'medium',
         'left',
         noise_canc=(70, 85))
    stay(positions.loc['Pos5'], 20, 'low', 'left', noise_canc=(60, 75))

    pos = getMiddlePath(positions.loc['Pos5'], positions.loc['Pos6'], 1 / 3)
    move(positions.loc['Pos5'], pos, 10, 'medium', 'top-left')
    move(pos,
         positions.loc['Pos6'],
         20,
         'medium',
         'top-right',
         noise_canc=(70, 80))
    stay(positions.loc['Pos6'], 20, 'medium', 'top', noise_canc=(80, 85))
    move(positions.loc['Pos6'],
         pos,
         20,
         'medium',
         'top-right',
         noise_canc=(70, 85))
    move(pos,
         positions.loc['Pos5'],
         10,
         'medium',
         'top-left',
         noise_canc=(60, 70))
    move(positions.loc['Pos5'],
         positions.loc['Pos3'],
         120,
         'medium',
         noise_canc=(80, 85))
    move(positions.loc['Pos3'],
         positions.loc['Pos1'],
         60,
         'medium2low',
         noise_canc=(80, 85))
    move(positions.loc['Pos1'],
         positions.loc['Pos0'],
         60,
         'low2medium',
         noise_canc=(55, 75))

    pathCV2_df = path_df
    pathCV2_df['x'] = 5 - path_df['x']
    fig, ax = plt.subplots(figsize=(xfig, yfig))
    plotStanza(xfig, yfig, cameras_df.loc['CV1'], pathCV2_df, fig)
    pathCV2_df.to_csv('CV_CV2_' +
                      str(datetime.today().strftime('%y%m%d')).split()[0] +
                      '.csv',
                      encoding='utf-8')

    if animation:
        a = animate.AnimatedScatter(len(pathCV2_df), pathCV2_df, xfig, yfig,
                                    cameras_df.loc['CV1'])
コード例 #4
0
ファイル: main.py プロジェクト: LorenzoChiana/plot4wrd
def createCV1Path(animation):
    stay(positions.loc['Pos0'], 20, 'medium')
    move(positions.loc['Pos0'],
         positions.loc['Pos1'],
         60,
         'hight2medium',
         noise_canc=(55, 75))
    stay(positions.loc['Pos1'], 20, 'medium')
    move(positions.loc['Pos1'],
         positions.loc['Pos2'],
         30,
         'hight',
         noise_canc=(90, 95))
    stay(positions.loc['Pos2'], 20, 'hight')
    move(positions.loc['Pos2'],
         positions.loc['Pos1'],
         30,
         'hight',
         noise_canc=(90, 95))
    move(positions.loc['Pos1'],
         positions.loc['Pos3'],
         60,
         'low',
         noise_canc=(55, 65))
    stay(positions.loc['Pos3'], 20, 'low')

    # x = min(positions.loc['Pos4'].x, positions.loc['Pos3'].x) + (max(positions.loc['Pos4'].x, positions.loc['Pos3'].x) - min(positions.loc['Pos4'].x, positions.loc['Pos3'].x))/2
    # data = {'x': x, 'y': positions.loc['Pos3'].y, 'z': positions.loc['Pos3'].z}
    # pos = pd.Series(data=data, index=['x', 'y', 'z'])
    pos = getMiddlePath(positions.loc['Pos4'], positions.loc['Pos3'])

    move(positions.loc['Pos3'], pos, 15, 'medium', noise_canc=(0, 0))
    move(pos, positions.loc['Pos4'], 15, 'low', 'left', noise_canc=(0, 0))
    stay(positions.loc['Pos4'], 20, 'medium', '')
    move(positions.loc['Pos4'], pos, 15, 'medium', noise_canc=(0, 0))
    move(pos, positions.loc['Pos3'], 15, 'medium', noise_canc=(0, 0))
    move(positions.loc['Pos3'],
         positions.loc['Pos5'],
         120,
         'low',
         noise_canc=(0, 0))
    stay(positions.loc['Pos5'], 20, 'low')
    move(positions.loc['Pos5'],
         positions.loc['Pos6'],
         30,
         'low',
         noise_canc=(0, 0))
    stay(positions.loc['Pos6'], 20, 'low')
    move(positions.loc['Pos6'],
         positions.loc['Pos5'],
         30,
         'low',
         noise_canc=(0, 0))
    move(positions.loc['Pos5'],
         positions.loc['Pos3'],
         120,
         'low',
         noise_canc=(0, 0))
    move(positions.loc['Pos3'],
         positions.loc['Pos1'],
         60,
         'low',
         noise_canc=(55, 65))
    move(positions.loc['Pos1'],
         positions.loc['Pos0'],
         60,
         'medium',
         noise_canc=(55, 75))

    pathCV1_df = path_df
    pathCV1_df['x'] = 5 - path_df['x']
    # dfupdate = path_df.sample(np.random.randint(round(len(pathCV1_df)*0.65),round(len(pathCV1_df)*0.75)))
    # if 0 in dfupdate.index.values:
    #     dfupdate=dfupdate.drop(0)
    # pathCV1_df = pathCV1_df.drop(dfupdate.index)
    fig, ax = plt.subplots(figsize=(xfig, yfig))
    plotStanza(xfig, yfig, cameras_df.loc['CV1'], pathCV1_df, fig)
    pathCV1_df.to_csv('CV_CV1_' +
                      str(datetime.today().strftime('%y%m%d')).split()[0] +
                      '.csv',
                      encoding='utf-8')

    if animation:
        a = animate.AnimatedScatter(len(pathCV1_df), pathCV1_df, xfig, yfig,
                                    cameras_df.loc['CV1'])
コード例 #5
0
    
    df.plot(kind='line', y='distance', color='red', use_index=True, label='Distances')

    numpoints = len(dfmerged)
    # inverto x con y per fare la figura larga
    y = (5-dfmerged.x_1)
    x = dfmerged.y_1
    xfig = 16.5       # room length
    yfig = 5          # room width
    #a = animate.AnimatedScatter(numpoints,x,y,xfig,yfig)
=======
    
    numtimes = len(dfmerged)
    xfig = 16.5       # room length
    yfig = 5          # room width
    a = animate.AnimatedScatter(numtimes,dfmerged,xfig,yfig)
>>>>>>> 0dc0a84e68dd32f88db3ee08b514ec04ba3da7e1
    plt.show()
    
# Program entry point
if __name__ == "__main__":
    print("init")
    source_path=""
    cv_file_name=""
    uwb_file_name=""
    
    if len(sys.argv)>1:
       source_path=sys.argv[1]
       cv_file_name=sys.argv[2]
       uwb_file_name=sys.argv[3]
    else: