Skip to content
Snippets Groups Projects
Commit 08da49a5 authored by Gerald Mösenlechner's avatar Gerald Mösenlechner
Browse files

Updated to Version 1.3.3

parent 286faeb6
No related branches found
No related tags found
No related merge requests found
......@@ -121,58 +121,59 @@ void FCUTest::testValidation()
std::cout << "Check Dimension check.\n";
package = CheckRoiForStar(noSignal, 0, 64, 100, 0.6, 1, 32., 32., 20, sum_star, 0);
std::cout << package.index << "\n";
CPPUNIT_ASSERT(package.index == 111);
std::cout << package.flag << "\n";
CPPUNIT_ASSERT(package.flag == 111);
package.index = 0;
package.flag = 0;
package = CheckRoiForStar(noSignal, 64, 0, 100, 0.6, 1, 32., 32., 20, sum_star, 0);
CPPUNIT_ASSERT(package.index == 111);
std::cout << package.index << "\n";
CPPUNIT_ASSERT(package.flag == 111);
std::cout << package.flag << "\n";
package.index = 0;
package.flag = 0;
package = CheckRoiForStar(noSignal, 3, 3, 100, 0.6, 1, 32., 32., 20, sum_star, 0);
CPPUNIT_ASSERT(package.index == 111);
std::cout << package.index << "\n";
CPPUNIT_ASSERT(package.flag == 111);
std::cout << package.flag << "\n";
package.index = 0;
package.flag = 0;
std::cout << "Check constant image check.\n";
package = CheckRoiForStar(noSignal, 64, 64, 100, 0.6, 1, 32., 32., 20, sum_star, 0);
std::cout << package.index << "\n";
CPPUNIT_ASSERT(package.index == 101);
std::cout << package.flag << "\n";
CPPUNIT_ASSERT(package.flag == 101);
package.index = 0;
package.flag = 0;
std::cout << "Check no star check.\n";
package = CheckRoiForStar(noStar, 64, 64, 100, 0.6, 1, 32., 32., 20, sum_star, 0);
std::cout << package.index << "\n";
CPPUNIT_ASSERT(package.index == 102);
std::cout << package.flag << "\n";
CPPUNIT_ASSERT(package.flag == 102);
package.index = 0;
package.flag = 0;
std::cout << "Check too low signal check.\n";
package = CheckRoiForStar(starImg, 64, 64, 10000, 0.6, 1, 32., 32., 20, sum_star, 0);
std::cout << package.index << "\n";
CPPUNIT_ASSERT(package.index == 104);
std::cout << package.flag << "\n";
CPPUNIT_ASSERT(package.flag == 104);
package.index = 0;
package.flag = 0;
std::cout << "Check too low pearson check.\n";
std_threshold(starImg, 64, 64);
package = CheckRoiForStar(starImg, 64, 64, 100, 1.0, 1, 32., 32., 50, 18000, 0);
std::cout << package.index << "\n";
CPPUNIT_ASSERT(package.index == 106);
std::cout << package.flag << "\n";
CPPUNIT_ASSERT(package.flag == 106);
package.index = 0;
package.flag = 0;
std::cout << "Check valid output FGS1.\n";
package.index = 2.0;
package = CheckRoiForStar(starImg, 64, 64, 100, 0.0, 1, 32., 32., 50, 18000, 0);
std::cout << package.index << "\n";
CPPUNIT_ASSERT(package.index < 1.0);
package.index = 0;
package.index = 2.0;
std::cout << "Check valid output FGS2.\n";
package = CheckRoiForStar(starImg, 64, 64, 100, 0.0, 2, 32., 32., 50, 18000, 0);
......@@ -198,12 +199,15 @@ void FCUTest::testAcquisition()
std::cout << "Check no valid target.\n";
output = SourceDetection(acqImg, 200, 200, 1, 4, 200000, 50, 20, 3, 5., 5., 100, 0.3);
CPPUNIT_ASSERT(output.validity.flag == 0);
std::cout << output.validity.flag << "\n";
CPPUNIT_ASSERT(output.validity.flag == 107);
std::cout << "Check dimension check.\n";
output = SourceDetection(acqImg, 2, 2, 1, 4, sum_acq, 50, 20, 3, 5., 5., 100, 0.3);
CPPUNIT_ASSERT(output.validity.flag == 0);
std::cout << output.validity.flag << "\n";
CPPUNIT_ASSERT(output.validity.flag == 111);
CPPUNIT_ASSERT_DOUBLES_EQUAL(output.x, 0.0, 1e-7);
CPPUNIT_ASSERT_DOUBLES_EQUAL(output.y, 0.0, 1e-7);
}
......@@ -225,7 +229,8 @@ void FCUTest::testCentroid()
std::cout << "Check invalid output.\n";
output = ArielCoG(noStar, 64, 64, 5, 5., 5., 1, 100, 0.3, 50, sum_star, 0);
CPPUNIT_ASSERT(output.validity.flag == 0);
std::cout << output.validity.flag << "\n";
CPPUNIT_ASSERT(output.validity.flag == 102);
}
......
......@@ -293,6 +293,7 @@ void HFSTest::testMainLoop()
double time;
double dt = 0.0125;
unsigned int i;
unsigned int ctr = 0;
outPacket.time = 0.;
time = 0.;
......@@ -336,6 +337,7 @@ void HFSTest::testMainLoop()
update.ang_rate[2] = 1;
fgs.set_params(update, &outPacket);
ctr++;
state = fgs.get_hfs_state();
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.sim_time, 0.0, 0.00001);
std::cout << "Check exposure start\n";
......@@ -346,41 +348,49 @@ void HFSTest::testMainLoop()
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
state = fgs.get_hfs_state();
std::cout << "Check time propagation\n";
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.sim_time, dt, 0.00001);
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.start_exposure, 0.0, 0.00001);
CPPUNIT_ASSERT_EQUAL(state.target_pos_x, 1);
CPPUNIT_ASSERT_EQUAL(state.target_pos_y, 2);
update.target_pos_x = 0;
update.target_pos_y = 0;
std::cout << "Check Drift\n";
for(i = 0; i < 10; i++)
{
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
state = fgs.get_hfs_state();
}
state = fgs.get_hfs_state();
std::cout << "Check new integration start\n";
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.start_exposure, 0.1, 0.00001);
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.start_exposure, 0.1 + ctr * 1.5e-5, 0.0001);
std::cout << "Check generated centroid packet\n";
CPPUNIT_ASSERT(outPacket.x > 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(outPacket.time, 0.12, 0.01);
CPPUNIT_ASSERT_DOUBLES_EQUAL(outPacket.time, 0.12 + ctr * 1.5e-5, 0.01);
std::cout << "Check Channel transition\n";
update.channel = 2;
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
state = fgs.get_hfs_state();
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.transition_end, update.time + 0.5, 0.0001);
std::cout << "Trandition start internal time: " << state.internal_time << "\n";
std::cout << "Trandition start sim time: " << state.sim_time << "\n";
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.transition_end, update.time + 0.5 + ctr * 1.5e-5, 0.0002);
/* Advance time past transtion end*/
for(i = 0; i < 50; i++)
{
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
}
state = fgs.get_hfs_state();
CPPUNIT_ASSERT_EQUAL((int )state.channel, 2);
......@@ -389,15 +399,17 @@ void HFSTest::testMainLoop()
update.mode = 1;
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
update.target_pos_x = 1;
update.target_pos_y = 2;
state = fgs.get_hfs_state();
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.transition_end, update.time + 0.5, 0.0001);
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.transition_end, update.time + 0.5 + ctr * 1.5e-5, 0.0003);
for(i = 0; i < 100; i++)
{
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
}
state = fgs.get_hfs_state();
CPPUNIT_ASSERT_EQUAL((int)state.mode, 1);
......@@ -412,23 +424,31 @@ void HFSTest::testMainLoop()
{
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
}
state = fgs.get_hfs_state();
CPPUNIT_ASSERT_EQUAL(state.target_pos_x, 80);
CPPUNIT_ASSERT_EQUAL(state.target_pos_y, 80);
update.target_pos_x = 0;
update.target_pos_y = 0;
std::cout << "Check Reset of FGS\n";
update.reset = 1;
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
update.reset = 0;
update.channel = 1;
state = fgs.get_hfs_state();
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.reset_end, update.time + 0.5, 0.0001);
CPPUNIT_ASSERT_DOUBLES_EQUAL(state.reset_end, update.time + 0.5 + ctr * 1.5e-5, 0.0004);
/* Advance time past reset end*/
for(i = 0; i < 50; i++)
{
update.time = update.time + dt;
fgs.set_params(update, &outPacket);
ctr++;
}
state = fgs.get_hfs_state();
......
......@@ -2,6 +2,9 @@
<simulation_time>0.0</simulation_time>
<internal_time>0.0</internal_time>
<!-- Global timestep of the matlab simulink model.
Default: 0.0125 (80Hz)-->
<timestep>0.0125</timestep>
......@@ -60,6 +63,10 @@
and transitions, Default: 0.005-->
<timing_tolerance>0.005</timing_tolerance>
<timing_jitter>1e-6</timing_jitter>
<timing_drift>1.5e-5</timing_drift>
<!-- relative path of the Psf input files. The psfs are given as 40x40px
arrays that are stored in the C array format -->
......@@ -175,7 +182,13 @@
<thresholding>2</thresholding>
<!-- Delay of the centroid packet in seconds.
Note: must be lower than the integration time (0.125 s) -->
<delay>0.02</delay>
<delay_mean>0.02</delay_mean>
<delay_std>0.01</delay_std>
<delay_min>0.01</delay_min>
<delay_max>0.07</delay_max>
<!-- Exposure time for mode Tracking in s, default: 0.1 -->
<exposure_time>0.1</exposure_time>
<!-- Brightness tolerance for Validation default is 30% -->
......@@ -194,7 +207,13 @@
<thresholding>2</thresholding>
<!-- Delay of the centroid packet in seconds.
Note: must be lower than the integration time (0.5 s) -->
<delay>0.1</delay>
<delay_mean>0.1</delay_mean>
<delay_std>0.01</delay_std>
<delay_min>0.03</delay_min>
<delay_max>0.07</delay_max>
<!-- Exposure time for mode Acquisition in s, default: 0.5 -->
<exposure_time>0.5</exposure_time>
<!-- Brightness tolerance for target identification default is 30% -->
......@@ -224,15 +243,12 @@
<previous_image>./previous_image.txt</previous_image>
<centroid_queue>./centroid_queue.txt</centroid_queue>
<smear_x>0.0</smear_x>
<smear_y>0.0</smear_y>
<centroid_x>0</centroid_x>
<centroid_y>0</centroid_y>
<centroid_time>0</centroid_time>
<centroid_valid>0</centroid_valid>
<centroid_index>0</centroid_index>
<centroid_mag>0</centroid_mag>
<centroid_send>0</centroid_send>
<trf_x>0</trf_x>
<trf_y>0</trf_y>
</HFS_MetaInfo>
......@@ -2,6 +2,8 @@
<simulation_time>0.0</simulation_time>
<internal_time>0.0</internal_time>
<!-- Global timestep of the matlab simulink model.
Default: 0.0125 (80Hz)-->
<timestep>0.0125</timestep>
......@@ -63,6 +65,9 @@
and transitions, Default: 0.005-->
<timing_tolerance>0.005</timing_tolerance>
<timing_jitter>1e-6</timing_jitter>
<timing_drift>1.5e-5</timing_drift>
<!-- relative path of the Psf input files. The psfs are given as 40x40px
arrays that are stored in the C array format -->
......@@ -145,6 +150,10 @@
<!-- Maximum ramp length. Default: 150 -->
<max_ramp>150</max_ramp>
<!-- Limit for staturated pixels in an image. At this limit, the centroid will be set invalid.
Used for the Snowball detection. Default: 25 -->
<saturation_limit>25</saturation_limit>
<!-- Calibration and hot pixel map that replaces the first sample of a ramp for FGS1 -->
<reset_calibration_FGS1>./Calibration_FGS1.txt</reset_calibration_FGS1>
......@@ -174,7 +183,13 @@
<thresholding>2</thresholding>
<!-- Delay of the centroid packet in seconds.
Note: must be lower than the integration time (0.125 s) -->
<delay>0.02</delay>
<delay_mean>0.05</delay_mean>
<delay_std>0.01</delay_std>
<delay_min>0.03</delay_min>
<delay_max>0.07</delay_max>
<!-- Exposure time for mode Tracking in s, default: 0.1 -->
<exposure_time>0.1</exposure_time>
<!-- Brightness tolerance for Validation default is 30% -->
......@@ -193,7 +208,13 @@
<thresholding>2</thresholding>
<!-- Delay of the centroid packet in seconds.
Note: must be lower than the integration time (0.5 s) -->
<delay>0.1</delay>
<delay_mean>0.05</delay_mean>
<delay_std>0.01</delay_std>
<delay_min>0.03</delay_min>
<delay_max>0.07</delay_max>
<!-- Exposure time for mode Acquisition in s, default: 0.5 -->
<exposure_time>0.5</exposure_time>
<!-- Brightness tolerance for target identification default is 30% -->
......@@ -223,6 +244,8 @@
<previous_image>./previous_image.txt</previous_image>
<centroid_queue>./centroid_queue.txt</centroid_queue>
<smear_x>0.0</smear_x>
<smear_y>0.0</smear_y>
......@@ -233,5 +256,6 @@
<centroid_index>0</centroid_index>
<centroid_mag>0</centroid_mag>
<centroid_send>0</centroid_send>
<trf_x>0</trf_x>
<trf_y>0</trf_y>
</HFS_MetaInfo>
......@@ -186,9 +186,9 @@ int main()
std::cout << "Sim is " << outPacket.time / (ms_double.count()/1000) << " times faster than real time!\n";
std::cout << "Mean Measurement for Tracking: \n x: " << sum_x_tra/ctr_tra << "\n y: " << sum_y_tra/ctr_tra << "\n\n";
std::cout << "Tracking Reference Values: \n x: 462.639mas\n y: 275.203mas\n\n";
std::cout << "Tracking Reference Values: \n x: 463.047mas\n y: 279.941mas\n\n";
std::cout << "Mean Measurement for Acquisition: \n x: " << sum_x_acq/ctr_acq << "\n y: " << sum_y_acq/ctr_acq << "\n\n";
std::cout << "Acquisition Reference Values: \n x: 461.649mas\n y: 275.785mas\n\n";
std::cout << "Acquisition Reference Values: \n x: 461.259mas\n y: 280.179mas\n\n";
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment