Commit a91ea437 authored by Jesse Mapel's avatar Jesse Mapel Committed by jlaura
Browse files

Fixed ordering on framer quaternions (#219)

parent 24ce64ac
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1191,10 +1191,10 @@ void UsgsAstroFrameSensorModel::calcRotationMatrix(
    double m[3][3]) const {
  MESSAGE_LOG(this->m_logger, "Calculating rotation matrix");
  // Trigonometric functions for rotation matrix
  double w = m_currentParameterValue[3];
  double x = m_currentParameterValue[4];
  double y = m_currentParameterValue[5];
  double z = m_currentParameterValue[6];
  double x = m_currentParameterValue[3];
  double y = m_currentParameterValue[4];
  double z = m_currentParameterValue[5];
  double w = m_currentParameterValue[6];

  m[0][0] = w*w + x*x - y*y - z*z;
  m[0][1] = 2 * (x*y - w*z);
@@ -1212,10 +1212,10 @@ void UsgsAstroFrameSensorModel::calcRotationMatrix(
  double m[3][3], const std::vector<double> &adjustments) const {
  MESSAGE_LOG(this->m_logger, "Calculating rotation matrix with adjustments");
  // Trigonometric functions for rotation matrix
  double w = getValue(3, adjustments);
  double x = getValue(4, adjustments);
  double y = getValue(5, adjustments);
  double z = getValue(6, adjustments);
  double x = getValue(3, adjustments);
  double y = getValue(4, adjustments);
  double z = getValue(5, adjustments);
  double w = getValue(6, adjustments);

  m[0][0] = w*w + x*x - y*y - z*z;
  m[0][1] = 2 * (x*y - w*z);
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ TEST_F(FrameSensorModel, Rotation_NPole_Center) {


TEST_F(FrameSensorModel, Rotation_SPole_Center) {
   sensorModel->setParameterValue(4, 0.0); // phi
   sensorModel->setParameterValue(3, 0.0); // phi
   sensorModel->setParameterValue(0, 0.0); // X
   sensorModel->setParameterValue(1, 0.0); // Y
   sensorModel->setParameterValue(2, -1000.0); // Z
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
	},
	"sensor_orientation": {
		"quaternions": [
			[0.0, -0.707106781186547, 0.0, 0.707106781186547]
			[-0.707106781186547, 0.0, 0.707106781186547, 0.0]
		]
	},
	"starting_detector_line": 0,