diff --git a/src/UsgsAstroFrameSensorModel.cpp b/src/UsgsAstroFrameSensorModel.cpp index 33720d335e1c378637f7c0807e64bf327fe9906d..19304320306dee7311a13d3ee859ab7640611526 100644 --- a/src/UsgsAstroFrameSensorModel.cpp +++ b/src/UsgsAstroFrameSensorModel.cpp @@ -752,7 +752,7 @@ std::string UsgsAstroFrameSensorModel::getModelState() const { {m_referencePointXyz.x, m_referencePointXyz.y, m_referencePointXyz.z}}, {"m_currentParameterCovariance", m_currentParameterCovariance}}; - std::string stateString = getModelName() + "\n" + state.dump(); + std::string stateString = getModelName() + "\n" + state.dump(2); return stateString; } diff --git a/src/UsgsAstroLsSensorModel.cpp b/src/UsgsAstroLsSensorModel.cpp index 1fe6bed7d2c8475e792a64c88b8392711b43b19b..3b39ee66a24aacc705d8972c30e1a4a35c65fc0d 100644 --- a/src/UsgsAstroLsSensorModel.cpp +++ b/src/UsgsAstroLsSensorModel.cpp @@ -437,7 +437,7 @@ std::string UsgsAstroLsSensorModel::getModelState() const { state["m_sunVelocity"] = m_sunVelocity; MESSAGE_LOG("num sun velocities: {} ", m_sunVelocity.size()) - std::string stateString = getModelName() + "\n" + state.dump(); + std::string stateString = getModelName() + "\n" + state.dump(2); return stateString; } @@ -453,24 +453,24 @@ void UsgsAstroLsSensorModel::applyTransformToState(ale::Rotation const& r, ale:: std::vector<double> quaternions = j["m_quaternions"].get<std::vector<double>>(); applyRotationToQuatVec(r, quaternions); j["m_quaternions"] = quaternions; - + // Apply rotation and translation to positions std::vector<double> positions = j["m_positions"].get<std::vector<double>>();; applyRotationTranslationToXyzVec(r, t, positions); j["m_positions"] = positions; - - // Apply rotation to velocities. The translation does not get applied. + + // Apply rotation to velocities. The translation does not get applied. ale::Vec3d zero_t(0, 0, 0); std::vector<double> velocities = j["m_velocities"].get<std::vector<double>>();; applyRotationTranslationToXyzVec(r, zero_t, velocities); j["m_velocities"] = velocities; - + // We do not change the Sun position or velocity. The idea is that // the Sun is so far, that minor camera adjustments won't affect // where the Sun is. // Update the state string - stateString = getModelNameFromModelState(stateString) + "\n" + j.dump(); + stateString = getModelNameFromModelState(stateString) + "\n" + j.dump(2); } //*************************************************************************** // UsgsAstroLineScannerSensorModel::reset diff --git a/src/Utilities.cpp b/src/Utilities.cpp index df3e5d2ea50fce11281a50466a45e2ed1142c7b3..6b448b9108807b2b37e78c7cb37fdfa5ed090170 100644 --- a/src/Utilities.cpp +++ b/src/Utilities.cpp @@ -1327,14 +1327,14 @@ json stateAsJson(std::string modelState) { // Apply a rotation to a vector of quaternions. void applyRotationToQuatVec(ale::Rotation const& r, std::vector<double> & quaternions) { int num_quat = quaternions.size(); - + for (int it = 0; it < num_quat/4; it++) { double * q = &quaternions[4*it]; // Note that quaternion in q is stored in order x, y, z, w, while // the rotation matrix wants it as w, x, y, z. - + std::vector<double> trans_q = (r * ale::Rotation(q[3], q[0], q[1], q[2])).toQuaternion(); // Modify in-place @@ -1348,14 +1348,14 @@ void applyRotationToQuatVec(ale::Rotation const& r, std::vector<double> & quater // Apply a rotation and translation to a vector of xyz vectors. void applyRotationTranslationToXyzVec(ale::Rotation const& r, ale::Vec3d const& t, std::vector<double> & xyz) { - + int num_xyz = xyz.size(); for (int it = 0; it < num_xyz/3; it++) { - + double * p = &xyz[3*it]; ale::Vec3d p_vec(p[0], p[1], p[2]); - + // Apply the rotation p_vec = r(p_vec); @@ -1366,6 +1366,6 @@ void applyRotationTranslationToXyzVec(ale::Rotation const& r, ale::Vec3d const& p[0] = p_vec.x; p[1] = p_vec.y; p[2] = p_vec.z; - + } }