From 0b8788467fdd03bd93543de4fc2a41fa8f089c61 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 19 Jun 2018 12:22:24 -0400 Subject: [PATCH 1/7] Added discretization level to point search task message --- mdms/CMASI.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mdms/CMASI.xml b/mdms/CMASI.xml index 16e7db08..e32f7445 100644 --- a/mdms/CMASI.xml +++ b/mdms/CMASI.xml @@ -1313,6 +1313,9 @@ --> + + + From 7b1aa44c503c7d9557aba64bde4b933dd20e7c4e Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 20 Jun 2018 13:16:23 -0400 Subject: [PATCH 2/7] updated description of DiscretizationLevel field of PointSearchTask message --- mdms/CMASI.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdms/CMASI.xml b/mdms/CMASI.xml index e32f7445..dc937c83 100644 --- a/mdms/CMASI.xml +++ b/mdms/CMASI.xml @@ -1313,7 +1313,7 @@ --> - + From 6c11efb83d484a7d3615dcb28c84f7667e10e9ba Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 20 Jun 2018 13:27:02 -0400 Subject: [PATCH 3/7] Added discretization level to point search task. Could consider changing in ViewAngleList logic instead of checking from extents of wedge with 22.5 degree separated headings --- src/Tasks/CmasiPointSearchTaskService.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Tasks/CmasiPointSearchTaskService.cpp b/src/Tasks/CmasiPointSearchTaskService.cpp index 2f7ce9e5..c6a377b1 100644 --- a/src/Tasks/CmasiPointSearchTaskService.cpp +++ b/src/Tasks/CmasiPointSearchTaskService.cpp @@ -146,9 +146,10 @@ void CmasiPointSearchTaskService::buildTaskPlanOptions() } else { - // no set wedge, so standoff from any angle - double dHeadingCurrent_rad = 0.0; - double dHeadingTarget_rad = n_Const::c_Convert::dTwoPi() - wedgeDirectionIncrement; + // no set wedge, so standoff from evenly spaced angles (number based on discretization level). Similar logic could be placed in wedge logic (evenlyish spaced headings checked in wedge) + wedgeDirectionIncrement = n_Const::c_Convert::dTwoPi() / m_pointSearchTask->getDiscretizationLevel(); + double dHeadingCurrent_rad = 0.0; //start from true north + double dHeadingTarget_rad = n_Const::c_Convert::dTwoPi() - wedgeDirectionIncrement; // the target (2pi - increment) so we dont double check angle 0.0 while (n_Const::c_Convert::bCompareDouble(dHeadingTarget_rad, dHeadingCurrent_rad, n_Const::c_Convert::enGreaterEqual)) { if (isCalculateOption(taskId, optionId, dHeadingCurrent_rad)) From 73394859170fd9c115771776883735390aea057d Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 10 Jul 2018 10:22:53 -0400 Subject: [PATCH 4/7] Revert "updated description of DiscretizationLevel field of PointSearchTask message" This reverts commit 7b1aa44c503c7d9557aba64bde4b933dd20e7c4e. --- mdms/CMASI.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdms/CMASI.xml b/mdms/CMASI.xml index dc937c83..e32f7445 100644 --- a/mdms/CMASI.xml +++ b/mdms/CMASI.xml @@ -1313,7 +1313,7 @@ --> - + From 1cd2083d2eeb48a3a13d21cbe8cc0496e53957ae Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 10 Jul 2018 10:24:39 -0400 Subject: [PATCH 5/7] Revert "Added discretization level to point search task message" This reverts commit 0b8788467fdd03bd93543de4fc2a41fa8f089c61. --- mdms/CMASI.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/mdms/CMASI.xml b/mdms/CMASI.xml index e32f7445..16e7db08 100644 --- a/mdms/CMASI.xml +++ b/mdms/CMASI.xml @@ -1313,9 +1313,6 @@ --> - - - From 6261faccb552779f723f8cd2205f9bc75523fb31 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 12 Jul 2018 12:35:12 -0400 Subject: [PATCH 6/7] changed the PointSearchTask to use a discretization parameter from the configuration file --- src/Tasks/CmasiPointSearchTaskService.cpp | 18 +++++++++++++++++- src/Tasks/CmasiPointSearchTaskService.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Tasks/CmasiPointSearchTaskService.cpp b/src/Tasks/CmasiPointSearchTaskService.cpp index c6a377b1..97a73e25 100644 --- a/src/Tasks/CmasiPointSearchTaskService.cpp +++ b/src/Tasks/CmasiPointSearchTaskService.cpp @@ -75,6 +75,22 @@ CmasiPointSearchTaskService::configureTask(const pugi::xml_node& ndComponent) sstrErrors << "ERROR:: **c_Task_CmasiLineSearch::bConfigure failed to cast a PointSearchTask from the task pointer." << std::endl; CERR_FILE_LINE_MSG(sstrErrors.str()) isSuccessful = false; + } else { + { + ////////////////////////////////////////////// + //////////// PROCESS OPTIONS ///////////////// + pugi::xml_node ndTaskOptions = ndComponent.child(m_taskOptions_XmlTag.c_str()); + if (ndTaskOptions) { + for(pugi::xml_node ndTaskOption = ndTaskOptions.first_child(); ndTaskOption; ndTaskOption = ndTaskOption.next_sibling()) + { + if(std::string(STRING_XML_POINT_SEARCH_DISCRETIZATION_LEVEL) == ndTaskOption.name()) + { + //get the value attribute of the discretizationlevel + m_discretizationLevel = atoi(ndTaskOption.child_value()); + } + } + } + } } } else @@ -147,7 +163,7 @@ void CmasiPointSearchTaskService::buildTaskPlanOptions() else { // no set wedge, so standoff from evenly spaced angles (number based on discretization level). Similar logic could be placed in wedge logic (evenlyish spaced headings checked in wedge) - wedgeDirectionIncrement = n_Const::c_Convert::dTwoPi() / m_pointSearchTask->getDiscretizationLevel(); + wedgeDirectionIncrement = n_Const::c_Convert::dTwoPi() / m_discretizationLevel; double dHeadingCurrent_rad = 0.0; //start from true north double dHeadingTarget_rad = n_Const::c_Convert::dTwoPi() - wedgeDirectionIncrement; // the target (2pi - increment) so we dont double check angle 0.0 while (n_Const::c_Convert::bCompareDouble(dHeadingTarget_rad, dHeadingCurrent_rad, n_Const::c_Convert::enGreaterEqual)) diff --git a/src/Tasks/CmasiPointSearchTaskService.h b/src/Tasks/CmasiPointSearchTaskService.h index d6d44d22..f758e117 100644 --- a/src/Tasks/CmasiPointSearchTaskService.h +++ b/src/Tasks/CmasiPointSearchTaskService.h @@ -168,6 +168,7 @@ class CmasiPointSearchTaskService : public TaskServiceBase bool isCalculateOption(const int64_t& taskId, int64_t& optionId, const double& wedgeHeading_rad); private: std::shared_ptr m_pointSearchTask; + int64_t m_discretizationLevel{16}; public: From daa51cf1351c1b65abb3dd81127aaf95ee1bc8f5 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 12 Jul 2018 13:06:50 -0400 Subject: [PATCH 7/7] forgot this --- src/Tasks/CmasiPointSearchTaskService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tasks/CmasiPointSearchTaskService.cpp b/src/Tasks/CmasiPointSearchTaskService.cpp index 97a73e25..7aed3db8 100644 --- a/src/Tasks/CmasiPointSearchTaskService.cpp +++ b/src/Tasks/CmasiPointSearchTaskService.cpp @@ -37,7 +37,7 @@ #define COUT_FILE_LINE_MSG(MESSAGE) std::cout << "CMPS-CMPS-CMPS-CMPS:: CmasiPointSearch:" << __FILE__ << ":" << __LINE__ << ":" << MESSAGE << std::endl;std::cout.flush(); #define CERR_FILE_LINE_MSG(MESSAGE) std::cerr << "CMPS-CMPS-CMPS-CMPS:: CmasiPointSearch:" << __FILE__ << ":" << __LINE__ << ":" << MESSAGE << std::endl;std::cerr.flush(); - +#define STRING_XML_POINT_SEARCH_DISCRETIZATION_LEVEL "DiscretizationLevel" namespace uxas {