Skip to content
Snippets Groups Projects
Commit 1e981d2c authored by jlaura's avatar jlaura Committed by Jesse Mapel
Browse files

Merging dev into master for release (#158)

* Updated ISD and tests  (#87)

* updated tests + RIP TestyMcTestFace

* keys updated

* Probably should not hard code .cpps in the CMakeLists.txt for GTest

* updated specs to mimic synthetic json

* appveyor assumed broken from standup, disabling until fixed

* eulers are now quats

* merge from jay's changes

* merge markers

* renamed quats as per Jessie's reccomendation

* only appends sensor_orientation to missing params

* stupid markers

* updated test ISD

* changes as per some comments

* updated as per comments

* defaults are all 0

* #pragma once to C style header guard

* stragler change

* missed some params

* missed another

* moving things around

* patched segfault error + added detector center as defined in json schema (#94)

* patched segfault error + added detector center as defined in the swagger schema

* verbose travi

* Fixed optical distortion and pixel to focal transforms. (#115)

* Update to use quaternions in test to match new ISD

* Fixes #121

* Fix 1 remaining failing omega rotation test

* Updates token to be in quotes

* Still trying to get the builds working.

* Updates to force upload

* Adds newline

* Update for formatting

* Trying to force travis to deploy with labels

I am editing this on the repo in order to get Travis to do its thing - I can not do this via a PR.

* Update .travis.yml

* Update meta.yaml

to try and force a dev tag on the builds to get labels to work.

* Update meta.yaml

* Update .travis.yml

* test x scaling for reset model state

* test FL500 conversion

* test FL500 conversion

* Add tests to include

* commit to force run of tests on mac with debug output

* switch to using tolerances from dev

* 0.5 pixel offset

* try moving set of filename into setup

* initialize differently test

* more debug output

* Add matrix to debug output

* Even more debug output from matrix calculation

* Add missing quaternion component to state string

* cleanup debug output now that problem is fixed

* fix added spacing

* Adds in check for PR for upload

* echo to check travis env

* fixes equality check for PR

* Clean up some spacing (non-functional) in UsgsAstroFrameModel

* Fixed canModelBeConstructedFromISD throwing an exception when the metadata file doesn't exist. (#134)

* fixed can be converted error

* Added not constructible test for frame plugin

* Removed old LS ISD header (#137)

* Update some of the tests that set a new state value to use a function in the fixture, rather than repeating code

* Windows Build (#139)

* adds win build

* Windows build

* Updates submodules

* Refactoring to move to one plugin and removed unused classes.  (#138)

* merge

* changed varrs

* reset test

* First iteration

* it compiles, although renaming this is still neccessary

* added source

* cleaned up, tests still need to pass

* post merge clean up

* validation updated, validation tests are now passing

* Addressed comments from Jesse

* last Jesse comment, convertISDToModelState doesn't check if pointer is invalid anymore as the sensor model should except

* model_name -> m_modelName for frame getState

* copy paste error in FrameSensorModel

* Resolve merge conflicts with FrameIsdTest vs. SimpleFrameIsdTest names

* Fix hopefully last merge problem

* Conda build on win (#143)

* Conda build on win

* Trying a straight build first

* Unneeded csmapi

* Now trying to upload build

* Trying a build and upload

* Trying syntax change

* trying ps

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update meta.yaml

* Update bld.bat

This is a test to see where appveyor is failing.

* Update bld.bat

* Update bld.bat

* Update meta.yaml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Adds if/else into appveyor (#146)

* Adds if/else into appveyor

* Update .appveyor.yml

* Updates to use gcc7

* Update .travis.yml

* Update .appveyor.yml

* Fixed Line Scan construction and condensed plugin tests (#145)

* First pass at test LS ISD

* Initial LS plugin test base

* fixed a test in frame plugin tests

* Initial LS plugin test suite

* Moved to single plugin test file

* Added some new plugin tests

* Fixed LS construction

* Re-updated submodules

* Reverted gtest

* removed debuf prints left in and made getModelName functional (#148)

* Changed line scan sensor model to new ISD spec (#149)

* Changed line scan sensor model to new ISD spec

* Updated LS to the proper spec

* Changed model_name to name_model

* Updated tests to use new name_ format in ISD

* Updated LS test data to new spec

* Fixed typo in ls test ISD

* Moved framer to new ISD format. Added bad debug statements.

* Updated LS to new spec

* Fixed focal length epsilon name

* Added model state test for framer (#152)

* fixed nan issue (#153)

* fixed nan issue

* left in for loop

* Removed switch statement for ls distortion: (#150)
parent 55181f74
No related branches found
No related tags found
No related merge requests found
#ifndef Fixtures_h
#define Fixtures_h
#include "UsgsAstroPlugin.h"
#include "UsgsAstroFrameSensorModel.h"
#include <json.hpp>
#include <map>
#include <sstream>
#include <fstream>
#include <gtest/gtest.h>
using json = nlohmann::json;
// Should this be positioned somewhere in the public API?
inline void jsonToIsd(json &object, csm::Isd &isd, std::string prefix="") {
for (json::iterator it = object.begin(); it != object.end(); ++it) {
json jsonValue = it.value();
if (jsonValue.is_array()) {
for (int i = 0; i < jsonValue.size(); i++) {
isd.addParam(prefix+it.key(), jsonValue[i].dump());
}
}
else if (jsonValue.is_string()) {
isd.addParam(prefix+it.key(), jsonValue.get<std::string>());
}
else {
isd.addParam(prefix+it.key(), jsonValue.dump());
}
}
}
class FrameSensorModel : public ::testing::Test {
protected:
csm::Isd isd;
UsgsAstroFrameSensorModel *sensorModel;
void SetUp() override {
sensorModel = NULL;
isd.setFilename("data/simpleFramerISD.img");
UsgsAstroPlugin frameCameraPlugin;
csm::Model *model = frameCameraPlugin.constructModelFromISD(
isd,
"USGS_ASTRO_FRAME_SENSOR_MODEL");
sensorModel = dynamic_cast<UsgsAstroFrameSensorModel *>(model);
ASSERT_NE(sensorModel, nullptr);
}
void TearDown() override {
if (sensorModel) {
delete sensorModel;
sensorModel = NULL;
}
}
};
class FrameIsdTest : public ::testing::Test {
protected:
csm::Isd isd;
virtual void SetUp() {
isd.setFilename("data/simpleFramerISD.img");
}
};
class ConstVelLineScanIsdTest : public ::testing::Test {
protected:
csm::Isd isd;
virtual void SetUp() {
isd.setFilename("data/constVelocityLineScan.img");
}
};
class FramerParameterizedTest : public ::testing::TestWithParam<csm::ImageCoord> {
protected:
csm::Isd isd;
std::string printIsd(csm::Isd &localIsd) {
std::string str;
std::multimap<std::string,std::string> isdmap= localIsd.parameters();
for (auto it = isdmap.begin(); it != isdmap.end();++it){
str.append(it->first);
str.append(":");
str.append(it->second);
}
return str;
}
UsgsAstroFrameSensorModel* createModel(csm::Isd &modifiedIsd) {
UsgsAstroPlugin frameCameraPlugin;
csm::Model *model = frameCameraPlugin.constructModelFromISD(
modifiedIsd,"USGS_ASTRO_FRAME_SENSOR_MODEL");
UsgsAstroFrameSensorModel* sensorModel = dynamic_cast<UsgsAstroFrameSensorModel *>(model);
if (sensorModel)
return sensorModel;
else
return nullptr;
}
virtual void SetUp() {
isd.setFilename("data/simpleFramerISD.img");
};
};
class FrameStateTest : public ::testing::Test {
protected:
csm::Isd isd;
UsgsAstroFrameSensorModel* createModifiedStateSensorModel(std::string key, double newValue) {
UsgsAstroPlugin cameraPlugin;
csm::Model *model = cameraPlugin.constructModelFromISD(isd,"USGS_ASTRO_FRAME_SENSOR_MODEL");
UsgsAstroFrameSensorModel* sensorModel = dynamic_cast<UsgsAstroFrameSensorModel *>(model);
if (sensorModel) {
sensorModel->getModelState();
std::string modelState = sensorModel->getModelState();
auto state = json::parse(modelState);
state[key] = newValue;
sensorModel->replaceModelState(state.dump());
return sensorModel;
}
else {
return nullptr;
}
}
void SetUp() override {
isd.setFilename("data/simpleFramerISD.img");
}
};
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment