Skip to content

Commit 6326806

Browse files
Fix TaskComposerProblem serialization and equal operator
1 parent a315913 commit 6326806

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

tesseract_task_composer/core/src/task_composer_problem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bool TaskComposerProblem::operator==(const TaskComposerProblem& rhs) const
4646
bool equal = true;
4747
equal &= name == rhs.name;
4848
equal &= dotgraph == rhs.dotgraph;
49-
equal &= input == input;
49+
equal &= input == rhs.input;
5050
return equal;
5151
}
5252

@@ -57,7 +57,7 @@ void TaskComposerProblem::serialize(Archive& ar, const unsigned int /*version*/)
5757
{
5858
ar& boost::serialization::make_nvp("name", name);
5959
ar& boost::serialization::make_nvp("dotgraph", dotgraph);
60-
ar& boost::serialization::make_nvp("input", dotgraph);
60+
ar& boost::serialization::make_nvp("input", input);
6161
}
6262

6363
} // namespace tesseract_planning

tesseract_task_composer/test/tesseract_task_composer_core_unit.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerProblemTests) // NOLINT
140140
auto problem = std::make_unique<TaskComposerProblem>();
141141
EXPECT_EQ(problem->name, "unset");
142142
EXPECT_FALSE(problem->dotgraph);
143+
EXPECT_TRUE(problem->input.isNull());
144+
145+
tesseract_common::JointState joint_state;
146+
joint_state.joint_names = { "joint_1", "joint_2", "joint_3" };
147+
joint_state.position = Eigen::VectorXd::Constant(3, 5);
148+
joint_state.velocity = Eigen::VectorXd::Constant(3, 6);
149+
joint_state.acceleration = Eigen::VectorXd::Constant(3, 7);
150+
joint_state.effort = Eigen::VectorXd::Constant(3, 8);
151+
joint_state.time = 100;
152+
153+
problem->input = joint_state;
143154

144155
// Serialization
145156
test_suite::runSerializationPointerTest(problem, "TaskComposerProblemTests");

0 commit comments

Comments
 (0)