Skip to content

Commit

Permalink
Make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Sep 18, 2023
1 parent 24a84b1 commit 7fc216b
Show file tree
Hide file tree
Showing 83 changed files with 611 additions and 631 deletions.
10 changes: 5 additions & 5 deletions tesseract_examples/src/basic_cartesian_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,19 @@ bool BasicCartesianExample::run()
const std::string output_key = task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage input_data;
input_data.setData(input_key, program);
auto input_data = std::make_unique<TaskComposerDataStorage>();
input_data->setData(input_key, program);

// Create Task Composer Problem
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, input_data, profiles);
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

if (plotter_ != nullptr && plotter_->isConnected())
plotter_->waitForInput("Hit Enter to solve for trajectory.");

// Solve task
tesseract_common::Timer stopwatch;
stopwatch.start();
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem));
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data));
future->wait();

stopwatch.stop();
Expand All @@ -266,7 +266,7 @@ bool BasicCartesianExample::run()
if (plotter_ != nullptr && plotter_->isConnected())
{
plotter_->waitForInput();
auto ci = future->context->getDataStorage().getData(output_key).as<CompositeInstruction>();
auto ci = future->context->data_storage->getData(output_key).as<CompositeInstruction>();
tesseract_common::Toolpath toolpath = toToolpath(ci, *env_);
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
Expand Down
20 changes: 10 additions & 10 deletions tesseract_examples/src/car_seat_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,14 @@ bool CarSeatExample::run()
const std::string output_key = task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage input_data;
input_data.setData(input_key, program);
auto input_data = std::unique_ptr<TaskComposerDataStorage>();
input_data->setData(input_key, program);

// Create Task Composer Problem
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, input_data, profiles);
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

// Solve task
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem));
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data));
future->wait();

if (!future->context->isSuccessful())
Expand All @@ -318,7 +318,7 @@ bool CarSeatExample::run()
// Plot Process Trajectory
if (plotter_ != nullptr && plotter_->isConnected())
{
auto ci = future->context->getDataStorage().getData(output_key).as<CompositeInstruction>();
auto ci = future->context->data_storage->getData(output_key).as<CompositeInstruction>();
tesseract_common::Toolpath toolpath = toToolpath(ci, *env_);
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
Expand Down Expand Up @@ -390,14 +390,14 @@ bool CarSeatExample::run()
const std::string output_key = task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage input_data;
input_data.setData(input_key, program);
auto input_data = std::unique_ptr<TaskComposerDataStorage>();
input_data->setData(input_key, program);

// Create Task Composer Problem
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, input_data, profiles);
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

// Solve task
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem));
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data));
future->wait();

if (!future->context->isSuccessful())
Expand All @@ -406,7 +406,7 @@ bool CarSeatExample::run()
// Plot Process Trajectory
if (plotter_ != nullptr && plotter_->isConnected())
{
auto ci = future->context->getDataStorage().getData(output_key).as<CompositeInstruction>();
auto ci = future->context->data_storage->getData(output_key).as<CompositeInstruction>();
tesseract_common::Toolpath toolpath = toToolpath(ci, *env_);
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
Expand Down
10 changes: 5 additions & 5 deletions tesseract_examples/src/freespace_hybrid_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,21 @@ bool FreespaceHybridExample::run()
const std::string output_key = task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage input_data;
input_data.setData(input_key, program);
auto input_data = std::make_unique<TaskComposerDataStorage>();
input_data->setData(input_key, program);

// Create Task Composer Problem
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, input_data, profiles);
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

// Solve task
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem));
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data));
future->wait();

// Plot Process Trajectory
if (plotter_ != nullptr && plotter_->isConnected())
{
plotter_->waitForInput();
auto ci = future->context->getDataStorage().getData(output_key).as<CompositeInstruction>();
auto ci = future->context->data_storage->getData(output_key).as<CompositeInstruction>();
tesseract_common::Toolpath toolpath = toToolpath(ci, *env_);
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
Expand Down
10 changes: 5 additions & 5 deletions tesseract_examples/src/freespace_ompl_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,21 @@ bool FreespaceOMPLExample::run()
const std::string output_key = task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage input_data;
input_data.setData(input_key, program);
auto input_data = std::make_unique<TaskComposerDataStorage>();
input_data->setData(input_key, program);

// Create Task Composer Problem
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, input_data, profiles);
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

// Solve task
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem));
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data));
future->wait();

// Plot Process Trajectory
if (plotter_ != nullptr && plotter_->isConnected())
{
plotter_->waitForInput();
auto ci = future->context->getDataStorage().getData(output_key).as<CompositeInstruction>();
auto ci = future->context->data_storage->getData(output_key).as<CompositeInstruction>();
tesseract_common::Toolpath toolpath = toToolpath(ci, *env_);
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
Expand Down
10 changes: 5 additions & 5 deletions tesseract_examples/src/glass_upright_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,19 @@ bool GlassUprightExample::run()
const std::string output_key = task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage input_data;
input_data.setData(input_key, program);
auto input_data = std::make_unique<TaskComposerDataStorage>();
input_data->setData(input_key, program);

// Create Task Composer Problem
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, input_data, profiles);
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

if (plotter_ != nullptr && plotter_->isConnected())
plotter_->waitForInput("Hit Enter to solve for trajectory.");

// Solve process plan
tesseract_common::Timer stopwatch;
stopwatch.start();
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem));
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data));
future->wait();

stopwatch.stop();
Expand All @@ -259,7 +259,7 @@ bool GlassUprightExample::run()
if (plotter_ != nullptr && plotter_->isConnected())
{
plotter_->waitForInput();
auto ci = future->context->getDataStorage().getData(output_key).as<CompositeInstruction>();
auto ci = future->context->data_storage->getData(output_key).as<CompositeInstruction>();
tesseract_common::Toolpath toolpath = toToolpath(ci, *env_);
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
Expand Down
23 changes: 12 additions & 11 deletions tesseract_examples/src/pick_and_place_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,14 @@ bool PickAndPlaceExample::run()
const std::string pick_output_key = pick_task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage pick_input_data;
pick_input_data.setData(pick_input_key, pick_program);
auto pick_input_data = std::make_unique<TaskComposerDataStorage>();
pick_input_data->setData(pick_input_key, pick_program);

// Create Task Composer Problem
auto pick_problem = std::make_unique<PlanningTaskComposerProblem>(env_, pick_input_data, profiles);
auto pick_problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

// Solve task
TaskComposerFuture::UPtr pick_future = executor->run(*pick_task, std::move(pick_problem));
TaskComposerFuture::UPtr pick_future = executor->run(*pick_task, std::move(pick_problem), std::move(pick_input_data));
pick_future->wait();

if (!pick_future->context->isSuccessful())
Expand All @@ -244,7 +244,7 @@ bool PickAndPlaceExample::run()
if (plotter_ != nullptr && plotter_->isConnected())
{
plotter_->waitForInput();
auto ci = pick_future->context->getDataStorage().getData(pick_output_key).as<CompositeInstruction>();
auto ci = pick_future->context->data_storage->getData(pick_output_key).as<CompositeInstruction>();
tesseract_common::Toolpath toolpath = toToolpath(ci, *env_);
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
Expand Down Expand Up @@ -278,7 +278,7 @@ bool PickAndPlaceExample::run()

// Get the last move instruction
CompositeInstruction pick_composite =
pick_future->context->getDataStorage().getData(pick_output_key).as<CompositeInstruction>();
pick_future->context->data_storage->getData(pick_output_key).as<CompositeInstruction>();
const MoveInstructionPoly* pick_final_state = pick_composite.getLastMoveInstruction();

// Retreat to the approach pose
Expand Down Expand Up @@ -348,14 +348,15 @@ bool PickAndPlaceExample::run()
const std::string place_output_key = pick_task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage place_input_data;
place_input_data.setData(place_input_key, place_program);
auto place_input_data = std::make_unique<TaskComposerDataStorage>();
place_input_data->setData(place_input_key, place_program);

// Create Task Composer Problem
auto place_problem = std::make_unique<PlanningTaskComposerProblem>(env_, place_input_data, profiles);
auto place_problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

// Solve task
TaskComposerFuture::UPtr place_future = executor->run(*place_task, std::move(place_problem));
TaskComposerFuture::UPtr place_future =
executor->run(*place_task, std::move(place_problem), std::move(place_input_data));
place_future->wait();

if (!place_future->context->isSuccessful())
Expand All @@ -365,7 +366,7 @@ bool PickAndPlaceExample::run()
if (plotter_ != nullptr && plotter_->isConnected())
{
plotter_->waitForInput();
auto ci = place_future->context->getDataStorage().getData(place_output_key).as<CompositeInstruction>();
auto ci = place_future->context->data_storage->getData(place_output_key).as<CompositeInstruction>();
tesseract_common::Toolpath toolpath = toToolpath(ci, *env_);
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
Expand Down
10 changes: 5 additions & 5 deletions tesseract_examples/src/puzzle_piece_auxillary_axes_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,24 +230,24 @@ bool PuzzlePieceAuxillaryAxesExample::run()
const std::string output_key = task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage input_data;
input_data.setData(input_key, program);
auto input_data = std::make_unique<TaskComposerDataStorage>();
input_data->setData(input_key, program);

if (plotter_ != nullptr)
plotter_->waitForInput();

// Create Task Composer Problem
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, input_data, profiles);
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

// Solve task
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem));
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data));
future->wait();

// Plot Process Trajectory
if (plotter_ != nullptr && plotter_->isConnected())
{
plotter_->waitForInput();
auto ci = future->context->getDataStorage().getData(output_key).as<CompositeInstruction>();
auto ci = future->context->data_storage->getData(output_key).as<CompositeInstruction>();
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
plotter_->plotTrajectory(trajectory, *state_solver);
Expand Down
10 changes: 5 additions & 5 deletions tesseract_examples/src/puzzle_piece_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,19 @@ bool PuzzlePieceExample::run()
const std::string output_key = task->getOutputKeys().front();

// Create Task Input Data
TaskComposerDataStorage input_data;
input_data.setData(input_key, program);
auto input_data = std::make_unique<TaskComposerDataStorage>();
input_data->setData(input_key, program);

if (plotter_ != nullptr)
plotter_->waitForInput();

// Create Task Composer Problem
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, input_data, profiles);
auto problem = std::make_unique<PlanningTaskComposerProblem>(env_, profiles);

// Solve task
tesseract_common::Timer stopwatch;
stopwatch.start();
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem));
TaskComposerFuture::UPtr future = executor->run(*task, std::move(problem), std::move(input_data));
future->wait();

stopwatch.stop();
Expand All @@ -244,7 +244,7 @@ bool PuzzlePieceExample::run()
if (plotter_ != nullptr && plotter_->isConnected())
{
plotter_->waitForInput();
auto ci = future->context->getDataStorage().getData(output_key).as<CompositeInstruction>();
auto ci = future->context->data_storage->getData(output_key).as<CompositeInstruction>();
tesseract_common::JointTrajectory trajectory = toJointTrajectory(ci);
auto state_solver = env_->getStateSolver();
plotter_->plotTrajectory(trajectory, *state_solver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class AbortTask : public TaskComposerTask
template <class Archive>
void serialize(Archive& ar, const unsigned int version); // NOLINT

TaskComposerNodeInfo::UPtr runImpl(const TaskComposerContext::Ptr& context,
TaskComposerNodeInfo::UPtr runImpl(TaskComposerContext& context,
OptionalTaskComposerExecutor executor = std::nullopt) const override final;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class DoneTask : public TaskComposerTask
template <class Archive>
void serialize(Archive& ar, const unsigned int version); // NOLINT

TaskComposerNodeInfo::UPtr runImpl(const TaskComposerContext::Ptr& context,
TaskComposerNodeInfo::UPtr runImpl(TaskComposerContext& context,
OptionalTaskComposerExecutor executor = std::nullopt) const override final;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ErrorTask : public TaskComposerTask
template <class Archive>
void serialize(Archive& ar, const unsigned int version); // NOLINT

TaskComposerNodeInfo::UPtr runImpl(const TaskComposerContext::Ptr& context,
TaskComposerNodeInfo::UPtr runImpl(TaskComposerContext& context,
OptionalTaskComposerExecutor executor = std::nullopt) const override final;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class RemapTask : public TaskComposerTask
template <class Archive>
void serialize(Archive& ar, const unsigned int version); // NOLINT

TaskComposerNodeInfo::UPtr runImpl(const TaskComposerContext::Ptr& context,
TaskComposerNodeInfo::UPtr runImpl(TaskComposerContext& context,
OptionalTaskComposerExecutor executor = std::nullopt) const override final;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class StartTask : public TaskComposerTask
template <class Archive>
void serialize(Archive& ar, const unsigned int version); // NOLINT

TaskComposerNodeInfo::UPtr runImpl(const TaskComposerContext::Ptr& context,
TaskComposerNodeInfo::UPtr runImpl(TaskComposerContext& context,
OptionalTaskComposerExecutor executor = std::nullopt) const override final;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class SyncTask : public TaskComposerTask
template <class Archive>
void serialize(Archive& ar, const unsigned int version); // NOLINT

TaskComposerNodeInfo::UPtr runImpl(const TaskComposerContext::Ptr& context,
TaskComposerNodeInfo::UPtr runImpl(TaskComposerContext& context,
OptionalTaskComposerExecutor executor = std::nullopt) const override final;
};

Expand Down
Loading

0 comments on commit 7fc216b

Please sign in to comment.