Unverified Commit c86a6093 authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Initial Lidar Network fixture (#4875)



* Initial Lidar Network fixture

* Initial FunctionalTestJigsawLidar

* Added data tests for lidar

* Compiling BundleAdjust

* In progress debug

* Jigsaw tests passing

* Passing tests

Co-authored-by: default avatarAustin Sanders <austinsanders1993@gmail.com>
parent 56362d2b
Loading
Loading
Loading
Loading
+49 −27
Original line number Diff line number Diff line
@@ -50,6 +50,22 @@ namespace Isis {
    m_points.insert(point->GetId(), point);
  }

  /**
   * Gets a single LidarDataPoint by ID
   *
   * @param pointId The ID of the LidarDataPoint
   * @return QSharedPointer<LidarDataPoint> The LidarDataPoint matching the supplied ID
   */

  QSharedPointer<LidarControlPoint> LidarData::point(QString pointId) const{
    QSharedPointer<LidarControlPoint> point = m_points.value(pointId, 0);
    if (!point) {
      QString msg = "Point " + pointId + " is not in the lidar data.";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
    return point;
  }


  /**
   * Gets the list of Lidar data points optionally sorted .
@@ -649,13 +665,13 @@ namespace Isis {
    QList< ControlMeasure * > validMeasures;

    // Get measures in cube will validate this for us, so we don't need to re-check
//    QList< ControlMeasure * > measureList = GetMeasuresInCube(serialNumber);
    QList< ControlMeasure * > measureList;
    QList< ControlMeasure * > measureList = GetMeasuresInCube(serialNumber);

    foreach(ControlMeasure * measure, measureList) {
      if (!measure->IsIgnored())
      if (!measure->IsIgnored()) {
        validMeasures.append(measure);
      }
    }

    return validMeasures;
  }
@@ -665,13 +681,19 @@ namespace Isis {
   *
   * @returns A list of all measures which are in a given cube
   */
//  QList< ControlMeasure * > LidarData::GetMeasuresInCube(QString serialNumber) {
//    if( !ValidateSerialNumber(serialNumber) ) {
//      IString msg = "Cube Serial Number [" + serialNumber + "] not found in "
//          "the network";
//      throw IException(IException::Programmer, msg, _FILEINFO_);
  QList< ControlMeasure * > LidarData::GetMeasuresInCube(QString serialNumber) {
    if( !ValidateSerialNumber(serialNumber) ) {
      IString msg = "Cube Serial Number [" + serialNumber + "] not found in "
          "the network";
      throw IException(IException::Programmer, msg, _FILEINFO_);

//    }
//    return m_controlGraph[m_vertexMap[serialNumber]].measures.values();
//  }
    }
    QList< ControlMeasure * > measures;
    foreach(QSharedPointer <LidarControlPoint> point, m_points) {
      if (point->HasSerialNumber(serialNumber)) {
        measures.append(point->GetMeasure(serialNumber));
      }
    }
    return measures;
  }
}
+3 −2
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ namespace Isis {

      void insert(QSharedPointer<LidarControlPoint> point);

      QSharedPointer<LidarControlPoint> point(QString pointId) const;
      QList< QSharedPointer<LidarControlPoint> > points(bool sort = false) const;

      void SetImages(SerialNumberList &list, Progress *progress = 0);
+25 −0
Original line number Diff line number Diff line
@@ -86,6 +86,17 @@ namespace Isis {
        ControlNetQsp cnet = fixHeldImages(cnetFile, heldList, cubeList);
        bundleAdjustment = new BundleAdjust(settings, cnet, cubeList);
      }
    else if (ui.WasEntered("LIDARDATA")) {
      QString lidarFile = ui.GetFileName("LIDARDATA");

      // validate lidar point file exists
      if (!QFile::exists(lidarFile)) {
        string msg = "Input lidar point file does not exist";
        throw IException(IException::User, msg, _FILEINFO_);
      }

      bundleAdjustment = new BundleAdjust(settings, cnetFile, cubeList, lidarFile);
    }
      else {
        bundleAdjustment = new BundleAdjust(settings, cnetFile, cubeList);
      }
@@ -119,9 +130,23 @@ namespace Isis {
        bundleSolution->outputResiduals();
      }

    // write lidar csv output file
    if (ui.GetBoolean("LIDAR_CSV")) {
      bundleSolution->outputLidarCSV();
    }

      // write updated control net
      bundleAdjustment->controlNet()->Write(ui.GetFileName("ONET"));

    // write updated lidar data file
    if (ui.WasEntered("LIDARDATA")) {
      if (ui.GetString("OLIDARFORMAT") == "JSON") {
        bundleAdjustment->lidarData()->write(ui.GetFileName("OLIDARDATA"),LidarData::Format::Json);
      }
      else {
        bundleAdjustment->lidarData()->write(ui.GetFileName("OLIDARDATA"),LidarData::Format::Binary);
      }
    }
      PvlGroup gp("JigsawResults");
      // Update the cube pointing if requested but ONLY if bundle has converged
      if (ui.GetBoolean("UPDATE") ) {
+90 −10
Original line number Diff line number Diff line
@@ -307,6 +307,10 @@
      Cleaned up the bundleout.txt file and added new information in the header.
      Fixes #3267.
    </change>
    <change name="Ken Edmundson and Debbie A. Cook" date="2019-05-20">
      Added initial support for simultaneous LIDAR data. Added LIDARDATA, OLIDARDATA,
      and OLIDARFORMAT arguments.
    </change>
    <change name="Aaron Giroux" date="2019-12-19">
      Added SCCONFIG parameter which allows users to pass in a pvl file with different
      settings for different instrumentIDs. Added logic into the observationSolveSettings
@@ -384,6 +388,7 @@
          *.net
        </filter>
      </parameter>

      <parameter name="ONET">
        <type>filename</type>
        <fileMode>output</fileMode>
@@ -400,6 +405,69 @@
        </filter>
      </parameter>

      <parameter name="LIDARDATA">
        <type>filename</type>
        <internalDefault>none</internalDefault>
        <fileMode>input</fileMode>
        <brief>
          Input Lidar Point File - requires SPSOLVE to be turned on
        </brief>
        <description>
        This file is a <def>lidar point data</def> generated from <b>lrolola2isis.cpp</b>.
        It contains <def>lidar control point</def>s and associated measures for simultaneous images.
        If <def>lidar point data</def> are used, SPSOLVE must be turned on (anything besides NONE)
        
        </description>
        <exclusions>
        </exclusions>
        <filter>
          *.dat *.json
        </filter>
      </parameter>

      <parameter name="OLIDARDATA">
        <type>filename</type>
        <internalDefault>none</internalDefault>
        <fileMode>output</fileMode>
        <brief>
          Output lidar data file - requires SPSOLVE to be turned on
        </brief>
        <description>
          This output file contains the adjusted <def>lidar data</def> with
          the final coordinates of the <def>lidar point</def>s and residuals for each
          measurement.
        </description>
        <filter>
          *.dat *.json
        </filter>
      </parameter>

      <parameter name="OLIDARFORMAT">
        <type>string</type>
        <brief> Output lidar data file format</brief>
        <default>
          <item>BINARY</item>
        </default>
        <description>
          Output lidar data file format.
        </description>
        <list>
          <option value="BINARY">
            <brief> Output lidar data in binary format</brief>
            <description>
              Output lidar data in binary format.
            </description>
          </option>

          <option value="JSON">
            <brief> Output lidar data in json format </brief>
            <description>
              Output lidar data in json format.
            </description>
          </option>
        </list>
      </parameter>

      <parameter name="SCCONFIG">
        <exclusions>
          <item>CKDEGREE</item>
@@ -1428,6 +1496,18 @@
            <item>yes</item>
          </default>
        </parameter>

        <parameter name="LIDAR_CSV">
          <brief> Outputs lidar data to csv file - lidar.csv</brief>
          <description>
            Selection of this parameter flags output of lidar data
            points to a csv file
          </description>
          <type>boolean</type>
          <default>
            <item>no</item>
          </default>
        </parameter>
      </group>

    </groups>
@@ -1517,7 +1597,7 @@
         connection to ground in the network, this bundle will only solve for camera specific parameters. The bundle could still solve for other parameters and be 
         correct relative to the camera position, but it would increase the complexity of the bundle. The proceeding two examples will include grounded networks, 
         so we will wait to increase the complexity of the bundle until ground points are included. Additionally, in this example we are evaluating the solution and 
         do not want to apply it to the images yet, therefore, update is set to no.
         do not want to apply it to the images yet, therefore, update is set to 'no'.
        </p> 
        <p>
         This relative bundle turns on and parameterizes the camera twist and camera acceleration solve parameters. Camera twist is a flag that allows the bundle to solve 
@@ -1526,8 +1606,8 @@
         constraint because of the increasing affect alterations of higher order parameters have on the bundle solution.
        </p>
        <p>
         The overexisting flag tells the bundle solution to approximate the camera rotation with a zero polynomial function added to the existing rotation data (adding the 
         polynomial <b>over</b> the <b>existing</b> data). Without the overexisting flag, the bundle fits a polynomial to the existing rotations, throws out the existing data
         The 'overexisting' flag tells the bundle solution to approximate the camera rotation with a zero polynomial function added to the existing rotation data (adding the 
         polynomial <b>over</b> the <b>existing</b> data). Without the 'overexisting' flag, the bundle fits a polynomial to the existing rotations, throws out the existing data
         points, and uses the polynomial to calculate the approximate ephemerides when needed.
        </p>
        <p>
@@ -1613,7 +1693,7 @@
         your update cubes camera pointing (or any kernels resulting from these updated camera pointings).
        </p>
        <p>
         If you want to double check the update was completed, see cathist or catlab (search for Jigged).
         If you want to double check the update was completed, see cathist or catlab (search for 'Jigged').
        </p>
      </description>

+473 −315

File changed.

Preview size limit exceeded, changes collapsed.

Loading