Skip to content

Commit

Permalink
Fix TaskComposerProblem serialization and equal operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Dec 13, 2023
1 parent a315913 commit bde7a8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tesseract_task_composer/core/src/task_composer_problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool TaskComposerProblem::operator==(const TaskComposerProblem& rhs) const
bool equal = true;
equal &= name == rhs.name;
equal &= dotgraph == rhs.dotgraph;
equal &= input == input;
equal &= input == rhs.input;
return equal;
}

Expand All @@ -57,7 +57,7 @@ void TaskComposerProblem::serialize(Archive& ar, const unsigned int /*version*/)
{
ar& boost::serialization::make_nvp("name", name);
ar& boost::serialization::make_nvp("dotgraph", dotgraph);
ar& boost::serialization::make_nvp("input", dotgraph);
ar& boost::serialization::make_nvp("input", input);
}

} // namespace tesseract_planning
Expand Down
11 changes: 11 additions & 0 deletions tesseract_task_composer/test/tesseract_task_composer_core_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerProblemTests) // NOLINT
auto problem = std::make_unique<TaskComposerProblem>();
EXPECT_EQ(problem->name, "unset");
EXPECT_FALSE(problem->dotgraph);
EXPECT_TRUE(problem->input.isNull());

tesseract_common::JointState joint_state;
joint_state.joint_names = { "joint_1", "joint_2", "joint_3" };
joint_state.position = Eigen::VectorXd::Constant(3, 5);
joint_state.velocity = Eigen::VectorXd::Constant(3, 6);
joint_state.acceleration = Eigen::VectorXd::Constant(3, 7);
joint_state.effort = Eigen::VectorXd::Constant(3, 8);
joint_state.time = 100;

problem->input = joint_state;

// Serialization
test_suite::runSerializationPointerTest(problem, "TaskComposerProblemTests");
Expand Down

0 comments on commit bde7a8e

Please sign in to comment.