コード例 #1
0
def generatePointCloudClicked():
    Point_param.pushButton.setEnabled(True)
    os.chdir(wrk_drr)

    print "current working directory is", wrk_drr
    bundlerPath=""
    path_image= str(Point_param.plainTextEdit.toPlainText())
    print "image path is",path_image
    newPhotoPath=r"point_cloud/temp/"
    
    if not(os.path.isdir(path_image)):
        print("choose correct directory")
       # win32api.MessageBox(0,"Invalid Path, Please choose Correct Directory","Warning")
    else:
        p=os.listdir(newPhotoPath)
        for i in p:
            os.remove(newPhotoPath+i)
        f=os.listdir(path_image)
        for i in f:
            a=i.split('.')
            flag=0
##            try:
##                Image.open(os.path.join(path_image,i))
##            except:
##                flag=1
##                print "can not open image"
            if (a[len(a)-1]=="jpg" or a[len(a)-1]=="JPG")and flag==0:
                shutil.copy(os.path.join(path_image,i),newPhotoPath)
                print "copying photo"
        gps.run(projPath,[newPhotoPath ,os.path.join(projPath,"coordinates.txt")])# photo directory along with coordinates is passed to it
        #checkGeotag()
        a=[os.path.join(wrk_drr,newPhotoPath)]
        name.run(a)
        os.chdir(wrk_drr)
        a=[bundlerPath , "--photos=" + os.path.join(wrk_drr,newPhotoPath)]
##        thread.start_new_thread(RunBundler.run,(a,))
        with open(r"osmbundler/curr_proj.txt",'w') as proj :
            proj.write(projPath)
        RunBundler.run(a)
        print "in point cloud before georeference"
##to run PMVS
        
        bundlerOutputPath=os.path.join(projPath,"PointCloud")
        print "bundlerOutputPath"
        print bundlerOutputPath
        
        if not (os.path.isdir(bundlerOutputPath)):
            print("enter correct path")
           # win32api.MessageBox(0,'Invalid path. Enter the correct path','Warning')
        else:
            a=['--bundlerOutputPath='+bundlerOutputPath]
            RunPMVS.run(a)
##            thread.start_new_thread( RunPMVS.run,(a,) )
        print "step 1 ends"
        Point_param.pushButton_3.setStyleSheet(_fromUtf8("color: rgb(0, 85,0);\n""font: 10pt \"Times New Roman\";"))
        Point_param.pushButton.setEnabled(True)
        return True
コード例 #2
0
def generatePointCloudClicked():
    Point_param.pushButton.setEnabled(True)
    os.chdir(wrk_drr)

    print "current working directory is", wrk_drr
    bundlerPath=""
    path_image= str(Point_param.plainTextEdit.toPlainText())
    print "image path is",path_image
    newPhotoPath=r"point_cloud/temp/"
    
    if not(os.path.isdir(path_image)):
        print("choose correct directory")
       # win32api.MessageBox(0,"Invalid Path, Please choose Correct Directory","Warning")
    else:
        p=os.listdir(newPhotoPath)
        for i in p:
            os.remove(newPhotoPath+i)
        f=os.listdir(path_image)
        for i in f:
            a=i.split('.')
            flag=0
##            try:
##                Image.open(os.path.join(path_image,i))
##            except:
##                flag=1
##                print "can not open image"
            if (a[len(a)-1]=="jpg" or a[len(a)-1]=="JPG")and flag==0:
                shutil.copy(os.path.join(path_image,i),newPhotoPath)
                print "copying photo"
        gps.run(projPath,[newPhotoPath ,os.path.join(projPath,"coordinates.txt")])# photo directory along with coordinates is passed to it
        #checkGeotag()
        a=[os.path.join(wrk_drr,newPhotoPath)]
        name.run(a)
        os.chdir(wrk_drr)
        a=[bundlerPath , "--photos=" + os.path.join(wrk_drr,newPhotoPath)]
##        thread.start_new_thread(RunBundler.run,(a,))
        with open(r"osmbundler/curr_proj.txt",'w') as proj :
            proj.write(projPath)
        RunBundler.run(a)
        print "in point cloud before georeference"
##to run PMVS
        
##        bundlerOutputPath=os.path.join(projPath,"PointCloud")
##        print "bundlerOutputPath"
##        print bundlerOutputPath
##        
##        if not (os.path.isdir(bundlerOutputPath)):
##            print("enter correct path")
##           # win32api.MessageBox(0,'Invalid path. Enter the correct path','Warning')
##        else:
##            a=['--bundlerOutputPath='+bundlerOutputPath]
##            RunPMVS.run(a)
####            thread.start_new_thread( RunPMVS.run,(a,) )
##        print "step 1 ends"
        Point_param.pushButton_3.setStyleSheet(_fromUtf8("color: rgb(0, 85,0);\n""font: 10pt \"Times New Roman\";"))
        Point_param.pushButton.setEnabled(True)
        return True
コード例 #3
0
ファイル: gpsNode.py プロジェクト: vanstrn/Robot
def main():
    #Createion of
    parser = argparse.ArgumentParser(description='Arguments for Imu Node')
    parser.add_argument(
        "--debug",
        default=False,
        action="store_true",
        help="Boolean toggle to print operational debug messages.")
    parser.add_argument("-t", "--topic", default="gps/fix", help="Topic Name")
    args = parser.parse_args()

    rclpy.init()

    gps = GPSNode(args.debug, args.topic)
    gps.run()

    # Destroy the node explicitly
    # (optional - otherwise it will be done automatically
    # when the garbage collector destroys the node object)
    gps.destroy_node()
    rclpy.shutdown()
コード例 #4
0
def actGPS():
    global currGPS

    for current in gps.run():
        currGPS = current