Skip to content

Commit ad2fb6b

Browse files
Update to leverage property tree schema
1 parent 1c16d63 commit ad2fb6b

37 files changed

Lines changed: 561 additions & 14 deletions

motion_planners/ompl/src/ompl_motion_planner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ long OMPLMotionPlanner::assignTrajectory(tesseract::command_language::CompositeI
208208
bool found{ false };
209209
Eigen::Index row{ 0 };
210210
auto& ci = output.getInstructions();
211-
for (auto it = ci.begin() + static_cast<long>(start_index); it != ci.end(); ++it)
211+
for (auto it = ci.begin() + start_index; it != ci.end(); ++it)
212212
{
213213
if (it->isMoveInstruction())
214214
{

task_composer/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ add_library(
1919
src/task_composer_plugin_factory.cpp
2020
src/task_composer_server.cpp
2121
src/task_composer_task.cpp
22+
src/yaml_extensions.cpp
2223
src/yaml_utils.cpp)
2324
add_library(tesseract::task_composer ALIAS task_composer)
2425
if(NOT WIN32 AND NOT APPLE)

task_composer/core/include/tesseract/task_composer/nodes/remap_task.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class TESSERACT_TASK_COMPOSER_NODES_EXPORT RemapTask : public TaskComposerTask
5353
explicit RemapTask(std::string name, const YAML::Node& config, const TaskComposerPluginFactory& plugin_factory);
5454
~RemapTask() override = default;
5555

56+
static tesseract::common::PropertyTree schema();
57+
5658
private:
5759
bool copy_{ false };
5860

task_composer/core/include/tesseract/task_composer/task_composer_graph.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class TaskComposerGraph : public TaskComposerNode
5757
TaskComposerGraph(TaskComposerGraph&&) = delete;
5858
TaskComposerGraph& operator=(TaskComposerGraph&&) = delete;
5959

60+
/** @brief Return the PropertyTree schema for a TaskComposerGraph. */
61+
static tesseract::common::PropertyTree schema();
62+
6063
/**
6164
* @brief Get the root node of the graph
6265
* @return The root node uuid

task_composer/core/include/tesseract/task_composer/task_composer_node.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ class TaskComposerNode
8282

8383
int run(TaskComposerContext& context, OptionalTaskComposerExecutor executor = std::nullopt) const;
8484

85+
/** @brief Return the PropertyTree schema for this node type. */
86+
static tesseract::common::PropertyTree schema();
87+
8588
/** @brief Set the name of the node */
8689
void setName(const std::string& name);
8790

task_composer/core/include/tesseract/task_composer/task_composer_plugin_factory.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class TaskComposerNodeFactory
7070
const YAML::Node& config,
7171
const TaskComposerPluginFactory& plugin_factory) const = 0;
7272

73+
/** @brief Return the PropertyTree schema describing the config this factory accepts */
74+
virtual tesseract::common::PropertyTree schema() const;
75+
7376
static std::string getSection();
7477
};
7578

@@ -85,6 +88,9 @@ class TaskComposerExecutorFactory
8588

8689
virtual std::unique_ptr<TaskComposerExecutor> create(const std::string& name, const YAML::Node& config) const = 0;
8790

91+
/** @brief Return the PropertyTree schema describing the config this factory accepts */
92+
virtual tesseract::common::PropertyTree schema() const;
93+
8894
static std::string getSection();
8995
};
9096

task_composer/core/include/tesseract/task_composer/task_composer_plugin_factory_utils.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define TESSERACT_TASK_COMPOSER_TASK_COMPOSER_PLUGIN_FACTORY_UTILS_H
2626

2727
#include <tesseract/task_composer/task_composer_plugin_factory.h>
28+
#include <tesseract/common/property_tree.h>
2829

2930
namespace tesseract::task_composer
3031
{
@@ -38,6 +39,8 @@ class TaskComposerTaskFactory : public TaskComposerNodeFactory
3839
{
3940
return std::make_unique<TaskType>(name, config, plugin_factory);
4041
}
42+
43+
tesseract::common::PropertyTree schema() const override { return TaskType::schema(); }
4144
};
4245

4346
template <typename ExecutorType>
@@ -48,7 +51,10 @@ class TaskComposerExecutorFactoryImpl : public TaskComposerExecutorFactory
4851
{
4952
return std::make_unique<ExecutorType>(name, config);
5053
}
54+
55+
tesseract::common::PropertyTree schema() const override { return ExecutorType::schema(); }
5156
};
57+
5258
} // namespace tesseract::task_composer
5359

5460
#endif // TESSERACT_TASK_COMPOSER_TASK_COMPOSER_PLUGIN_FACTORY_UTILS_H

task_composer/core/include/tesseract/task_composer/task_composer_task.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class TaskComposerTask : public TaskComposerNode
5252
TaskComposerTask(TaskComposerTask&&) = delete;
5353
TaskComposerTask& operator=(TaskComposerTask&&) = delete;
5454

55+
/** @brief Return the PropertyTree schema for this task type. */
56+
static tesseract::common::PropertyTree schema();
57+
5558
/**
5659
* @brief If true this node should call context.abort(uuid_) after run method returns
5760
* @param enable True if task should call context.abort(uuid_) after run method returns

task_composer/core/include/tesseract/task_composer/test_suite/test_task.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class TestTask : public TaskComposerTask
6464
bool operator==(const TestTask& rhs) const;
6565
bool operator!=(const TestTask& rhs) const;
6666

67+
static tesseract::common::PropertyTree schema();
68+
6769
private:
6870
static TaskComposerNodePorts ports();
6971

task_composer/core/include/tesseract/task_composer/yaml_extensions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
3030
TESSERACT_COMMON_IGNORE_WARNINGS_POP
3131

3232
#include <tesseract/common/yaml_extensions.h>
33+
#include <tesseract/common/fwd.h>
3334
#include <tesseract/task_composer/task_composer_keys.h>
3435

3536
namespace YAML
@@ -69,6 +70,8 @@ struct convert<tesseract::task_composer::TaskComposerKeys>
6970

7071
return true;
7172
}
73+
74+
static tesseract::common::PropertyTree schema();
7275
};
7376

7477
} // namespace YAML

0 commit comments

Comments
 (0)