Commit 56362d2b authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Update Bundle Utility classes for LiDAR work (#4716)

* Initial utilities hand merge

* Clean up for tests

* Fixed disclaimer for new files

* Removed BundleConstraint

* Moved Constraint into utilities folder

* Fixed header and SpciePosition test

* Moved BundleResults unit test to GTest

* Moved BundleSolutionInfo test to gtest

* BundleControlPoint gtest

* Added constrained point test

* updated BundleResults saving and test

* Updated BundleSolutionInfo Test
parent af3360e0
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@ find files of those names at the top level of this repository. **/

// boost library
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>

// Qt Library
@@ -108,6 +110,16 @@ namespace Isis {
       * API.
       */
      typedef boost::numeric::ublas::symmetric_matrix<double, boost::numeric::ublas::upper> SymmetricMatrix;
      /**
       * Definition for an Isis::LinearAlgebra::MatrixUpperTriangular of doubles with
       * an upper configuration. This is a typedef for a boost symmetric_matrix.
       *
       * Note: This typedef is used so that we can add functionality to an
       * existing matrix type and/or change which third party library's matrix
       * we are using without changing all references to this type in the ISIS
       * API.
       */
      typedef boost::numeric::ublas::symmetric_matrix<double, boost::numeric::ublas::upper> MatrixUpperTriangular;
      /**
       * Definition for an Isis::LinearAlgebra::Vector of doubles. This is a
       * typedef for a boost vector.
@@ -118,6 +130,16 @@ namespace Isis {
       * API.
       */
      typedef boost::numeric::ublas::vector<double> Vector;
      /**
       * Definition for an Isis::LinearAlgebra::VectorCompressed of doubles. This is a
       * typedef for a boost vector. It stores the vector in a more memory efficient form.
       *
       * Note: This typedef is used so that we can add functionality to an
       * existing vector type and/or change which third party library's vector
       * we are using without changing all references to this type in the ISIS
       * API.
       */
       typedef boost::numeric::ublas::compressed_vector<double> VectorCompressed;

      // define AxisAngle and EulerAngle
      /**
+9 −0
Original line number Diff line number Diff line
@@ -1543,6 +1543,15 @@ namespace Isis {
  }


  /**
   * Return the scaled time.
   *
   * @return Scaled time.
   */
  double SpicePosition::scaledTime() const {
    return (p_et - p_baseTime) / p_timeScale;
  }


  /** Cache J2000 position over existing cached time range using
   *  table
+3 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ namespace Isis {
   *   @history 2017-08-18 Tyler Wilson, Summer Stapleton, Ian Humphrey -  Added opening/closing brackets
   *                           to SetEphemerisTimePolyFunction() so this class compiles without warnings
   *                           under C++14. References #4809.
   *   @history 2018-06-22 Ken Edmundson - Added scaledTime() method to return current scaled time.
   *   @history 2020-07-01 Kristin Berry - Updated to use ale::States for internal state cache.
   */
  class SpicePosition {
@@ -205,6 +206,8 @@ namespace Isis {
        return p_et;
      };

      double scaledTime() const;

      const std::vector<double> &GetCenterCoordinate();

      //! Return the current J2000 position
+10 −0
Original line number Diff line number Diff line
@@ -98,33 +98,43 @@ Velocity (J) = -3.4897306 1.5779899 -2.6234689

Testing with polynomial functions...
Time           = -69382819
Scaled Time    = -1
Spacecraft (J) = -1730.4646 -1562.2157 2691.2806
Velocity (J) = -4.1416737 1.1953728 -1.9583892
Time           = -69382785
Scaled Time    = -0.77777778
Spacecraft (J) = -1870.766 -1520.585 2623.0012
Velocity (J) = -4.0837166 1.245281 -2.0445834
Time           = -69382751
Scaled Time    = -0.55555556
Spacecraft (J) = -2009.0152 -1477.2767 2551.8225
Velocity (J) = -4.0213941 1.2937034 -2.1283234
Time           = -69382717
Scaled Time    = -0.33333333
Spacecraft (J) = -2145.0681 -1432.3446 2477.8337
Velocity (J) = -3.9549945 1.3404603 -2.2093002
Time           = -69382683
Scaled Time    = -0.11111111
Spacecraft (J) = -2278.7907 -1385.8484 2401.1337
Velocity (J) = -3.8848114 1.3853831 -2.287244
Time           = -69382648
Scaled Time    = 0.11111111
Spacecraft (J) = -2410.0592 -1337.8533 2321.8302
Velocity (J) = -3.8111662 1.4283185 -2.3619019
Time           = -69382614
Scaled Time    = 0.33333333
Spacecraft (J) = -2538.7616 -1288.4295 2240.0396
Velocity (J) = -3.7344202 1.4691342 -2.4330333
Time           = -69382580
Scaled Time    = 0.55555556
Spacecraft (J) = -2664.799 -1237.651 2155.8858
Velocity (J) = -3.6549756 1.5077253 -2.5004246
Time           = -69382546
Scaled Time    = 0.77777778
Spacecraft (J) = -2788.0864 -1185.5952 2069.4994
Velocity (J) = -3.5732667 1.5440209 -2.5639219
Time           = -69382512
Scaled Time    = 1
Spacecraft (J) = -2908.5545 -1132.3409 1981.0142
Velocity (J) = -3.48974 1.5779929 -2.6234829

+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ int main(int argc, char *argv[]) {
    vector<double> p = pos.Coordinate();
    vector<double> v = pos.Velocity();
    cout << "Time           = " << pos.EphemerisTime() << endl;
    cout << "Scaled Time    = " << pos.scaledTime() << endl;
    cout << "Spacecraft (J) = " << p[0] << " " << p[1] << " " << p[2] << endl;
    cout << "Velocity (J) = " << v[0] << " " << v[1] << " " << v[2] << endl;
  }
Loading