diff --git a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_problem.h b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_problem.h deleted file mode 100644 index b6ca8d6313..0000000000 --- a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_problem.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @file task_composer_problem.h - * @brief A task composer server problem - * - * @author Levi Armstrong - * @date August 18, 2020 - * @version TODO - * @bug No known bugs - * - * @copyright Copyright (c) 2020, Southwest Research Institute - * - * @par License - * Software License Agreement (Apache License) - * @par - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * @par - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef TESSERACT_TASK_COMPOSER_TASK_COMPOSER_PROBLEM_H -#define TESSERACT_TASK_COMPOSER_TASK_COMPOSER_PROBLEM_H - -#include -TESSERACT_COMMON_IGNORE_WARNINGS_PUSH -#include -#include -#include -TESSERACT_COMMON_IGNORE_WARNINGS_POP - -#include -#include - -namespace tesseract_planning -{ -struct TaskComposerProblem -{ - using Ptr = std::shared_ptr; - using ConstPtr = std::shared_ptr; - using UPtr = std::unique_ptr; - using ConstUPtr = std::unique_ptr; - - TaskComposerProblem(std::string name = "unset", bool dotgraph = false); - - TaskComposerProblem(const TaskComposerProblem&) = default; - TaskComposerProblem& operator=(const TaskComposerProblem&) = default; - TaskComposerProblem(TaskComposerProblem&&) = default; - TaskComposerProblem& operator=(TaskComposerProblem&&) = default; - virtual ~TaskComposerProblem() = default; - - /** @brief The name of the task to be ran for this problem */ - std::string name; - - /** @brief Indicate if dotgraph should be provided */ - bool dotgraph{ false }; - - /** @brief The problem input */ - tesseract_common::AnyPoly input; - - /** - * @brief Clone the planning problem - * @return A clone of the planning problem - */ - virtual TaskComposerProblem::UPtr clone() const; - - bool operator==(const TaskComposerProblem& rhs) const; - bool operator!=(const TaskComposerProblem& rhs) const; - -protected: - friend struct tesseract_common::Serialization; - friend class boost::serialization::access; - - template - void serialize(Archive& ar, const unsigned int version); // NOLINT -}; -} // namespace tesseract_planning - -BOOST_CLASS_EXPORT_KEY2(tesseract_planning::TaskComposerProblem, "TaskComposerProblem") - -#endif // TESSERACT_TASK_COMPOSER_TASK_COMPOSER_PROBLEM_H diff --git a/tesseract_task_composer/core/src/task_composer_graph.cpp b/tesseract_task_composer/core/src/task_composer_graph.cpp index e20cdd3040..bf4f09c508 100644 --- a/tesseract_task_composer/core/src/task_composer_graph.cpp +++ b/tesseract_task_composer/core/src/task_composer_graph.cpp @@ -35,6 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include #include #include +#include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include @@ -70,6 +71,10 @@ TaskComposerGraph::TaskComposerGraph(std::string name, const TaskComposerPluginFactory& plugin_factory) : TaskComposerNode(std::move(name), type, TaskComposerNodePorts{}, config) { + static const std::set graph_expected_keys{ "conditional", "inputs", "outputs", + "nodes", "edges", "terminals" }; + tesseract_common::checkForUnknownKeys(config, graph_expected_keys); + std::unordered_map node_uuids; YAML::Node nodes = config["nodes"]; if (!nodes.IsMap()) @@ -77,6 +82,9 @@ TaskComposerGraph::TaskComposerGraph(std::string name, for (auto node_it = nodes.begin(); node_it != nodes.end(); ++node_it) { + static const std::set nodes_expected_keys{ "class", "task", "config" }; + tesseract_common::checkForUnknownKeys(node_it->second, nodes_expected_keys); + auto node_name = node_it->first.as(); if (YAML::Node fn = node_it->second["class"]) { @@ -103,6 +111,9 @@ TaskComposerGraph::TaskComposerGraph(std::string name, if (YAML::Node tc = node_it->second["config"]) { + static const std::set tasks_expected_keys{ "conditional", "abort_terminal", "remapping" }; + tesseract_common::checkForUnknownKeys(tc, tasks_expected_keys); + if (YAML::Node n = tc["conditional"]) task_node->setConditional(n.as()); @@ -115,12 +126,6 @@ TaskComposerGraph::TaskComposerGraph(std::string name, throw std::runtime_error("YAML entry 'abort_terminal' is only supported for GRAPH and PIPELINE types"); } - if (tc["input_remapping"]) // NOLINT - throw std::runtime_error("TaskComposerGraph, input_remapping is no longer supported use 'remapping'"); - - if (tc["output_remapping"]) // NOLINT - throw std::runtime_error("TaskComposerGraph, output_remapping is no longer supported use 'remapping'"); - if (YAML::Node n = tc["remapping"]) { auto remapping = n.as>();