diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index c37354106e..5290260b64 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: config: - - runner: macos-12 + - runner: macos-13 vcpkg_triplet: x64-osx-dynamic-release arch: x64 homebrew_root: /usr/local diff --git a/tesseract_task_composer/config/task_composer_plugins_no_trajopt_ifopt.yaml b/tesseract_task_composer/config/task_composer_plugins_no_trajopt_ifopt.yaml index a2f00db1ee..0222349682 100644 --- a/tesseract_task_composer/config/task_composer_plugins_no_trajopt_ifopt.yaml +++ b/tesseract_task_composer/config/task_composer_plugins_no_trajopt_ifopt.yaml @@ -39,7 +39,6 @@ task_composer_plugins: program: input_data environment: environment profiles: profiles - composite_profile_remapping: composite_profile_remapping outputs: program: output_data DescartesMotionPlannerTask: @@ -51,8 +50,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: false @@ -65,7 +62,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping IterativeSplineParameterizationTask: class: IterativeSplineParameterizationTaskFactory config: @@ -75,8 +71,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data edges: @@ -106,6 +100,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: DescartesFTask config: @@ -113,6 +116,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] DescartesDTask: @@ -140,7 +145,6 @@ task_composer_plugins: program: input_data environment: environment profiles: profiles - composite_profile_remapping: composite_profile_remapping outputs: program: output_data DescartesMotionPlannerTask: @@ -152,8 +156,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: false @@ -166,7 +168,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping IterativeSplineParameterizationTask: class: IterativeSplineParameterizationTaskFactory config: @@ -176,8 +177,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data edges: @@ -207,6 +206,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: DescartesDTask config: @@ -214,6 +222,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] DescartesFNPCTask: @@ -241,7 +251,6 @@ task_composer_plugins: program: input_data environment: environment profiles: profiles - composite_profile_remapping: composite_profile_remapping outputs: program: output_data DescartesMotionPlannerTask: @@ -253,8 +262,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: false @@ -267,8 +274,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data edges: @@ -296,6 +301,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: DescartesFNPCTask config: @@ -303,6 +317,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] DescartesDNPCTask: @@ -330,7 +346,6 @@ task_composer_plugins: program: input_data environment: environment profiles: profiles - composite_profile_remapping: composite_profile_remapping outputs: program: output_data DescartesMotionPlannerTask: @@ -342,8 +357,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: false @@ -356,8 +369,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data edges: @@ -385,6 +396,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: DescartesDNPCTask config: @@ -392,6 +412,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] OMPLTask: @@ -419,7 +441,6 @@ task_composer_plugins: program: input_data environment: environment profiles: profiles - composite_profile_remapping: composite_profile_remapping outputs: program: output_data OMPLMotionPlannerTask: @@ -431,8 +452,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: false @@ -445,7 +464,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping IterativeSplineParameterizationTask: class: IterativeSplineParameterizationTaskFactory config: @@ -455,8 +473,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data edges: @@ -486,6 +502,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: OMPLTask config: @@ -493,6 +518,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] TrajOptTask: @@ -520,7 +547,6 @@ task_composer_plugins: program: input_data environment: environment profiles: profiles - composite_profile_remapping: composite_profile_remapping outputs: program: output_data TrajOptMotionPlannerTask: @@ -532,8 +558,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: false @@ -546,7 +570,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping IterativeSplineParameterizationTask: class: IterativeSplineParameterizationTaskFactory config: @@ -556,8 +579,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data edges: @@ -587,6 +608,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: TrajOptTask config: @@ -594,6 +624,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] CartesianTask: @@ -621,7 +653,6 @@ task_composer_plugins: program: input_data environment: environment profiles: profiles - composite_profile_remapping: composite_profile_remapping outputs: program: output_data DescartesMotionPlannerTask: @@ -633,8 +664,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -647,8 +676,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: false @@ -661,7 +688,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping IterativeSplineParameterizationTask: class: IterativeSplineParameterizationTaskFactory config: @@ -671,8 +697,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data edges: @@ -704,6 +728,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: CartesianTask config: @@ -711,6 +744,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] FreespaceTask: @@ -738,7 +773,6 @@ task_composer_plugins: program: input_data environment: environment profiles: profiles - composite_profile_remapping: composite_profile_remapping outputs: program: output_data OMPLMotionPlannerTask: @@ -750,8 +784,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -764,8 +796,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: false @@ -778,7 +808,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping IterativeSplineParameterizationTask: class: IterativeSplineParameterizationTaskFactory config: @@ -788,8 +817,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data edges: @@ -821,6 +848,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: FreespaceTask config: @@ -828,6 +864,128 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask + destinations: [MotionPlanningTask] + terminals: [MotionPlanningTask] + FreespaceIfoptTask: + class: PipelineTaskFactory + config: + conditional: true + inputs: + program: input_data + outputs: + program: output_data + nodes: + DoneTask: + class: DoneTaskFactory + config: + conditional: false + ErrorTask: + class: ErrorTaskFactory + config: + conditional: false + MinLengthTask: + class: MinLengthTaskFactory + config: + conditional: true + inputs: + program: input_data + environment: environment + profiles: profiles + outputs: + program: output_data + OMPLMotionPlannerTask: + class: OMPLMotionPlannerTaskFactory + config: + conditional: true + inputs: + program: output_data + environment: environment + profiles: profiles + manip_info: manip_info + outputs: + program: output_data + format_result_as_input: true + TrajOptIfoptMotionPlannerTask: + class: TrajOptIfoptMotionPlannerTaskFactory + config: + conditional: true + inputs: + program: output_data + environment: environment + profiles: profiles + manip_info: manip_info + outputs: + program: output_data + format_result_as_input: false + DiscreteContactCheckTask: + class: DiscreteContactCheckTaskFactory + config: + conditional: true + inputs: + program: output_data + environment: environment + profiles: profiles + manip_info: manip_info + IterativeSplineParameterizationTask: + class: IterativeSplineParameterizationTaskFactory + config: + conditional: true + inputs: + program: output_data + environment: environment + profiles: profiles + manip_info: manip_info + outputs: + program: output_data + edges: + - source: MinLengthTask + destinations: [ErrorTask, OMPLMotionPlannerTask] + - source: OMPLMotionPlannerTask + destinations: [ErrorTask, TrajOptIfoptMotionPlannerTask] + - source: TrajOptIfoptMotionPlannerTask + destinations: [ErrorTask, DiscreteContactCheckTask] + - source: DiscreteContactCheckTask + destinations: [ErrorTask, IterativeSplineParameterizationTask] + - source: IterativeSplineParameterizationTask + destinations: [ErrorTask, DoneTask] + terminals: [ErrorTask, DoneTask] + FreespaceIfoptPipeline: + class: PipelineTaskFactory + config: + conditional: false + inputs: + planning_input: planning_input + outputs: + program: output_data + nodes: + ProcessInputTask: + class: ProcessPlanningInputTaskFactory + config: + conditional: false + inputs: + planning_input: planning_input + outputs: + program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data + MotionPlanningTask: + task: FreespaceIfoptTask + config: + conditional: false + abort_terminal: 0 + edges: + - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] RasterFtTask: @@ -856,8 +1014,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -915,6 +1071,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: RasterFtTask config: @@ -922,6 +1087,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] RasterCtTask: @@ -950,8 +1117,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1009,6 +1174,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: RasterCtTask config: @@ -1016,6 +1190,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] RasterFtOnlyTask: @@ -1044,8 +1220,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1096,6 +1270,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: RasterFtOnlyTask config: @@ -1103,6 +1286,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] RasterCtOnlyTask: @@ -1131,8 +1316,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1183,6 +1366,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: RasterCtOnlyTask config: @@ -1190,6 +1382,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] RasterFtGlobalTask: @@ -1218,8 +1412,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1232,8 +1424,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1293,6 +1483,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: RasterFtGlobalTask config: @@ -1300,6 +1499,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] RasterCtGlobalTask: @@ -1328,8 +1529,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1342,8 +1541,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1403,6 +1600,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: RasterCtGlobalTask config: @@ -1410,6 +1616,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] RasterFtOnlyGlobalTask: @@ -1438,8 +1646,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1452,8 +1658,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1506,6 +1710,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: RasterFtOnlyGlobalTask config: @@ -1513,6 +1726,8 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] RasterCtOnlyGlobalTask: @@ -1541,8 +1756,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1555,8 +1768,6 @@ task_composer_plugins: environment: environment profiles: profiles manip_info: manip_info - composite_profile_remapping: composite_profile_remapping - move_profile_remapping: move_profile_remapping outputs: program: output_data format_result_as_input: true @@ -1609,6 +1820,15 @@ task_composer_plugins: planning_input: planning_input outputs: program: input_data + FormatInputTask: + class: FormatPlanningInputTaskFactory + config: + conditional: false + inputs: + program: input_data + environment: environment + outputs: + program: input_data MotionPlanningTask: task: RasterCtOnlyGlobalTask config: @@ -1616,5 +1836,7 @@ task_composer_plugins: abort_terminal: 0 edges: - source: ProcessInputTask + destinations: [FormatInputTask] + - source: FormatInputTask destinations: [MotionPlanningTask] terminals: [MotionPlanningTask] diff --git a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node.h b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node.h index 78d18cab27..2dbc602092 100644 --- a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node.h +++ b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node.h @@ -40,7 +40,9 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include #include +#include #include +#include namespace YAML { @@ -52,15 +54,6 @@ namespace tesseract_planning class TaskComposerDataStorage; class TaskComposerContext; class TaskComposerExecutor; -class TaskComposerNodeInfo; - -enum class TaskComposerNodeType -{ - NODE, - TASK, - PIPELINE, - GRAPH -}; /** @brief Represents a node the pipeline to be executed */ class TaskComposerNode @@ -71,6 +64,9 @@ class TaskComposerNode using UPtr = std::unique_ptr; using ConstUPtr = std::unique_ptr; + // @brief The results map + using ResultsMap = std::map>; + /** @brief Most task will not require a executor so making it optional */ using OptionalTaskComposerExecutor = std::optional>; @@ -148,12 +144,10 @@ class TaskComposerNode TaskComposerNodePorts getPorts() const; /** @brief Generate the Dotgraph as a string */ - std::string - getDotgraph(const std::map>& results_map = {}) const; + std::string getDotgraph(const ResultsMap& results_map = ResultsMap()) const; /** @brief Generate the Dotgraph and save to file */ - bool saveDotgraph(const std::string& filepath, - const std::map>& results_map = {}) const; + bool saveDotgraph(const std::string& filepath, const ResultsMap& results_map = ResultsMap()) const; // NOLINT /** @brief Rename input keys */ virtual void renameInputKeys(const std::map& input_keys); @@ -168,10 +162,9 @@ class TaskComposerNode * @brief dump the task to dot * @brief Return additional subgraphs which should get appended if needed */ - virtual std::string - dump(std::ostream& os, - const TaskComposerNode* parent = nullptr, - const std::map>& results_map = {}) const; + virtual std::string dump(std::ostream& os, + const TaskComposerNode* parent = nullptr, + const ResultsMap& results_map = ResultsMap()) const; bool operator==(const TaskComposerNode& rhs) const; bool operator!=(const TaskComposerNode& rhs) const; diff --git a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node_info.h b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node_info.h index f8cdaec107..3dacf256a9 100644 --- a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node_info.h +++ b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node_info.h @@ -40,12 +40,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP #include -#include +#include #include #include namespace tesseract_planning { +class TaskComposerNode; + /** Stores information about a node */ class TaskComposerNodeInfo { @@ -57,7 +59,7 @@ class TaskComposerNodeInfo TaskComposerNodeInfo() = default; // Required for serialization TaskComposerNodeInfo(const TaskComposerNode& node); - ~TaskComposerNodeInfo() = default; + ~TaskComposerNodeInfo(); TaskComposerNodeInfo(const TaskComposerNodeInfo&) = default; TaskComposerNodeInfo& operator=(const TaskComposerNodeInfo&) = default; TaskComposerNodeInfo(TaskComposerNodeInfo&&) = default; diff --git a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node_types.h b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node_types.h new file mode 100644 index 0000000000..41489a9aa1 --- /dev/null +++ b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_node_types.h @@ -0,0 +1,40 @@ +/** + * @file task_composer_node_types.h + * @brief A node types enum + * + * @author Levi Armstrong + * @date July 29. 2022 + * @version TODO + * @bug No known bugs + * + * @copyright Copyright (c) 2022, Levi Armstrong + * + * @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_NODE_TYPES_H +#define TESSERACT_TASK_COMPOSER_TASK_COMPOSER_NODE_TYPES_H + +namespace tesseract_planning +{ +enum class TaskComposerNodeType +{ + NODE, + TASK, + PIPELINE, + GRAPH +}; +} + +#endif // TESSERACT_TASK_COMPOSER_TASK_COMPOSER_NODE_TYPES_H diff --git a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_plugin_factory.h b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_plugin_factory.h index fe4a8a8131..69ac800335 100644 --- a/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_plugin_factory.h +++ b/tesseract_task_composer/core/include/tesseract_task_composer/core/task_composer_plugin_factory.h @@ -100,8 +100,8 @@ class TaskComposerPluginFactory ~TaskComposerPluginFactory(); TaskComposerPluginFactory(const TaskComposerPluginFactory&) = delete; TaskComposerPluginFactory& operator=(const TaskComposerPluginFactory&) = delete; - TaskComposerPluginFactory(TaskComposerPluginFactory&&) = default; - TaskComposerPluginFactory& operator=(TaskComposerPluginFactory&&) = default; + TaskComposerPluginFactory(TaskComposerPluginFactory&&) noexcept = default; + TaskComposerPluginFactory& operator=(TaskComposerPluginFactory&&) noexcept = default; /** * @brief Load plugins from a configuration object diff --git a/tesseract_task_composer/core/src/task_composer_node.cpp b/tesseract_task_composer/core/src/task_composer_node.cpp index 649c359dc9..83727b2589 100644 --- a/tesseract_task_composer/core/src/task_composer_node.cpp +++ b/tesseract_task_composer/core/src/task_composer_node.cpp @@ -31,6 +31,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include #include #include +#include #include #include #include @@ -384,8 +385,7 @@ const TaskComposerKeys& TaskComposerNode::getOutputKeys() const { return output_ TaskComposerNodePorts TaskComposerNode::getPorts() const { return ports_; } -std::string TaskComposerNode::getDotgraph( - const std::map>& results_map) const +std::string TaskComposerNode::getDotgraph(const ResultsMap& results_map) const { try { @@ -402,9 +402,7 @@ std::string TaskComposerNode::getDotgraph( return {}; } -bool TaskComposerNode::saveDotgraph( - const std::string& filepath, - const std::map>& results_map) const +bool TaskComposerNode::saveDotgraph(const std::string& filepath, const ResultsMap& results_map) const { try { @@ -435,10 +433,9 @@ void TaskComposerNode::renameOutputKeys(const std::map void TaskComposerNode::setConditional(bool enable) { conditional_ = enable; } -std::string -TaskComposerNode::dump(std::ostream& os, - const TaskComposerNode* /*parent*/, - const std::map>& results_map) const +std::string TaskComposerNode::dump(std::ostream& os, + const TaskComposerNode* /*parent*/, + const ResultsMap& results_map) const { const std::string tmp = toString(uuid_, "node_"); @@ -543,18 +540,8 @@ void TaskComposerNode::serialize(Archive& ar, const unsigned int /*version*/) std::string TaskComposerNode::toString(const boost::uuids::uuid& u, const std::string& prefix) { - std::string result; - result.reserve(36); - - std::size_t i = 0; - for (const auto* it_data = u.begin(); it_data != u.end(); ++it_data, ++i) - { - const size_t hi = ((*it_data) >> 4) & 0x0F; - result += boost::uuids::detail::to_char(hi); - - const size_t lo = (*it_data) & 0x0F; - result += boost::uuids::detail::to_char(lo); - } + auto result = boost::uuids::to_string(u); + boost::replace_all(result, "-", ""); return (prefix + result); } diff --git a/tesseract_task_composer/core/src/task_composer_node_info.cpp b/tesseract_task_composer/core/src/task_composer_node_info.cpp index 2a859c9f09..b970e6cd0d 100644 --- a/tesseract_task_composer/core/src/task_composer_node_info.cpp +++ b/tesseract_task_composer/core/src/task_composer_node_info.cpp @@ -39,6 +39,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP #include +#include #include namespace tesseract_planning @@ -66,6 +67,8 @@ TaskComposerNodeInfo::TaskComposerNodeInfo(const TaskComposerNode& node) } } +TaskComposerNodeInfo::~TaskComposerNodeInfo() = default; + bool TaskComposerNodeInfo::operator==(const TaskComposerNodeInfo& rhs) const { static auto max_diff = static_cast(std::numeric_limits::epsilon());