diff --git a/tesseract_examples/src/basic_cartesian_example.cpp b/tesseract_examples/src/basic_cartesian_example.cpp index 06b055087e..2af69fc224 100644 --- a/tesseract_examples/src/basic_cartesian_example.cpp +++ b/tesseract_examples/src/basic_cartesian_example.cpp @@ -240,15 +240,11 @@ bool BasicCartesianExample::run() // Create task const std::string task_name = (ifopt_) ? "TrajOptIfoptPipeline" : "TrajOptPipeline"; TaskComposerNode::UPtr task = factory.createTaskComposerNode(task_name); - const std::string input_key = task->getInputKeys().front(); const std::string output_key = task->getOutputKeys().front(); - // Create Task Input Data - auto input_data = std::make_unique(); - input_data->setData(input_key, program); - // Create Task Composer Problem auto problem = std::make_unique(env_, profiles); + problem->input_instruction = program; if (plotter_ != nullptr && plotter_->isConnected()) plotter_->waitForInput("Hit Enter to solve for trajectory."); @@ -256,7 +252,7 @@ bool BasicCartesianExample::run() // Solve task tesseract_common::Timer stopwatch; stopwatch.start(); - TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data)); + TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem)); future->wait(); stopwatch.stop(); diff --git a/tesseract_examples/src/car_seat_example.cpp b/tesseract_examples/src/car_seat_example.cpp index 584665d6e1..1df97d38c5 100644 --- a/tesseract_examples/src/car_seat_example.cpp +++ b/tesseract_examples/src/car_seat_example.cpp @@ -298,18 +298,14 @@ bool CarSeatExample::run() // Create task TaskComposerNode::UPtr task = factory.createTaskComposerNode("TrajOptPipeline"); - const std::string input_key = task->getInputKeys().front(); const std::string output_key = task->getOutputKeys().front(); - // Create Task Input Data - auto input_data = std::make_unique(); - input_data->setData(input_key, program); - // Create Task Composer Problem auto problem = std::make_unique(env_, profiles); + problem->input_instruction = program; // Solve task - TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data)); + TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem)); future->wait(); if (!future->context->isSuccessful()) @@ -386,18 +382,14 @@ bool CarSeatExample::run() // Create task TaskComposerNode::UPtr task = factory.createTaskComposerNode("TrajOptPipeline"); - const std::string input_key = task->getInputKeys().front(); const std::string output_key = task->getOutputKeys().front(); - // Create Task Input Data - auto input_data = std::make_unique(); - input_data->setData(input_key, program); - // Create Task Composer Problem auto problem = std::make_unique(env_, profiles); + problem->input_instruction = program; // Solve task - TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data)); + TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem)); future->wait(); if (!future->context->isSuccessful()) diff --git a/tesseract_examples/src/freespace_hybrid_example.cpp b/tesseract_examples/src/freespace_hybrid_example.cpp index ef3f261e3a..e6abca19d6 100644 --- a/tesseract_examples/src/freespace_hybrid_example.cpp +++ b/tesseract_examples/src/freespace_hybrid_example.cpp @@ -176,18 +176,14 @@ bool FreespaceHybridExample::run() // Create task TaskComposerNode::UPtr task = factory.createTaskComposerNode("FreespacePipeline"); - const std::string input_key = task->getInputKeys().front(); const std::string output_key = task->getOutputKeys().front(); - // Create Task Input Data - auto input_data = std::make_unique(); - input_data->setData(input_key, program); - // Create Task Composer Problem auto problem = std::make_unique(env_, profiles); + problem->input_instruction = program; // Solve task - TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data)); + TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem)); future->wait(); // Plot Process Trajectory diff --git a/tesseract_examples/src/freespace_ompl_example.cpp b/tesseract_examples/src/freespace_ompl_example.cpp index 524c9664fd..8cee960567 100644 --- a/tesseract_examples/src/freespace_ompl_example.cpp +++ b/tesseract_examples/src/freespace_ompl_example.cpp @@ -176,18 +176,14 @@ bool FreespaceOMPLExample::run() // Create task TaskComposerNode::UPtr task = factory.createTaskComposerNode("OMPLPipeline"); - const std::string input_key = task->getInputKeys().front(); const std::string output_key = task->getOutputKeys().front(); - // Create Task Input Data - auto input_data = std::make_unique(); - input_data->setData(input_key, program); - // Create Task Composer Problem auto problem = std::make_unique(env_, profiles); + problem->input_instruction = program; // Solve task - TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data)); + TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem)); future->wait(); // Plot Process Trajectory diff --git a/tesseract_examples/src/glass_upright_example.cpp b/tesseract_examples/src/glass_upright_example.cpp index 308731f015..a22901f3e7 100644 --- a/tesseract_examples/src/glass_upright_example.cpp +++ b/tesseract_examples/src/glass_upright_example.cpp @@ -233,15 +233,11 @@ bool GlassUprightExample::run() // Create task const std::string task_name = (ifopt_) ? "TrajOptIfoptPipeline" : "TrajOptPipeline"; TaskComposerNode::UPtr task = factory.createTaskComposerNode(task_name); - const std::string input_key = task->getInputKeys().front(); const std::string output_key = task->getOutputKeys().front(); - // Create Task Input Data - auto input_data = std::make_unique(); - input_data->setData(input_key, program); - // Create Task Composer Problem auto problem = std::make_unique(env_, profiles); + problem->input_instruction = program; if (plotter_ != nullptr && plotter_->isConnected()) plotter_->waitForInput("Hit Enter to solve for trajectory."); @@ -249,7 +245,7 @@ bool GlassUprightExample::run() // Solve process plan tesseract_common::Timer stopwatch; stopwatch.start(); - TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data)); + TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem)); future->wait(); stopwatch.stop(); diff --git a/tesseract_examples/src/pick_and_place_example.cpp b/tesseract_examples/src/pick_and_place_example.cpp index f622eb5336..5c19f1af67 100644 --- a/tesseract_examples/src/pick_and_place_example.cpp +++ b/tesseract_examples/src/pick_and_place_example.cpp @@ -223,18 +223,14 @@ bool PickAndPlaceExample::run() // Create task TaskComposerNode::UPtr pick_task = factory.createTaskComposerNode("TrajOptPipeline"); - const std::string pick_input_key = pick_task->getInputKeys().front(); const std::string pick_output_key = pick_task->getOutputKeys().front(); - // Create Task Input Data - auto pick_input_data = std::make_unique(); - pick_input_data->setData(pick_input_key, pick_program); - // Create Task Composer Problem auto pick_problem = std::make_unique(env_, profiles); + pick_problem->input_instruction = pick_program; // Solve task - TaskComposerFuture::UPtr pick_future = executor->run(*pick_task, std::move(pick_problem), std::move(pick_input_data)); + TaskComposerFuture::UPtr pick_future = executor->run(*pick_task, std::move(pick_problem)); pick_future->wait(); if (!pick_future->context->isSuccessful()) @@ -344,19 +340,14 @@ bool PickAndPlaceExample::run() // Create task TaskComposerNode::UPtr place_task = factory.createTaskComposerNode("TrajOptPipeline"); - const std::string place_input_key = pick_task->getInputKeys().front(); const std::string place_output_key = pick_task->getOutputKeys().front(); - // Create Task Input Data - auto place_input_data = std::make_unique(); - place_input_data->setData(place_input_key, place_program); - // Create Task Composer Problem auto place_problem = std::make_unique(env_, profiles); + place_problem->input_instruction = place_program; // Solve task - TaskComposerFuture::UPtr place_future = - executor->run(*place_task, std::move(place_problem), std::move(place_input_data)); + TaskComposerFuture::UPtr place_future = executor->run(*place_task, std::move(place_problem)); place_future->wait(); if (!place_future->context->isSuccessful()) diff --git a/tesseract_examples/src/puzzle_piece_auxillary_axes_example.cpp b/tesseract_examples/src/puzzle_piece_auxillary_axes_example.cpp index 4452358818..12420f88c2 100644 --- a/tesseract_examples/src/puzzle_piece_auxillary_axes_example.cpp +++ b/tesseract_examples/src/puzzle_piece_auxillary_axes_example.cpp @@ -226,21 +226,17 @@ bool PuzzlePieceAuxillaryAxesExample::run() // Create task TaskComposerNode::UPtr task = factory.createTaskComposerNode("TrajOptPipeline"); - const std::string input_key = task->getInputKeys().front(); const std::string output_key = task->getOutputKeys().front(); - // Create Task Input Data - auto input_data = std::make_unique(); - input_data->setData(input_key, program); - if (plotter_ != nullptr) plotter_->waitForInput(); // Create Task Composer Problem auto problem = std::make_unique(env_, profiles); + problem->input_instruction = program; // Solve task - TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data)); + TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem)); future->wait(); // Plot Process Trajectory diff --git a/tesseract_examples/src/puzzle_piece_example.cpp b/tesseract_examples/src/puzzle_piece_example.cpp index eaa2cda966..56a65f23ed 100644 --- a/tesseract_examples/src/puzzle_piece_example.cpp +++ b/tesseract_examples/src/puzzle_piece_example.cpp @@ -218,23 +218,19 @@ bool PuzzlePieceExample::run() // Create task TaskComposerNode::UPtr task = factory.createTaskComposerNode("TrajOptPipeline"); - const std::string input_key = task->getInputKeys().front(); const std::string output_key = task->getOutputKeys().front(); - // Create Task Input Data - auto input_data = std::make_unique(); - input_data->setData(input_key, program); - if (plotter_ != nullptr) plotter_->waitForInput(); // Create Task Composer Problem auto problem = std::make_unique(env_, profiles); + problem->input_instruction = program; // Solve task tesseract_common::Timer stopwatch; stopwatch.start(); - TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data)); + TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem)); future->wait(); stopwatch.stop();