Skip to content

Commit

Permalink
Add serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoomen committed Dec 18, 2024
1 parent 6cbcafe commit f53935d
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ class SimplePlannerFixedSizeAssignNoIKPlanProfile : public SimplePlannerPlanProf

/** @brief The number of steps to use for linear instruction */
int linear_steps;

protected:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive&, const unsigned int); // NOLINT
};

} // namespace tesseract_planning

BOOST_CLASS_EXPORT_KEY(tesseract_planning::SimplePlannerFixedSizeAssignNoIKPlanProfile)

#endif // TESSERACT_MOTION_PLANNERS_SIMPLE_FIXED_SIZE_ASSIGN_NO_IK_PLAN_PROFILE_H
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,15 @@ class SimplePlannerLVSAssignNoIKPlanProfile : public SimplePlannerPlanProfile

/** @brief The maximum number of steps for the plan */
int max_steps;

protected:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive&, const unsigned int); // NOLINT
};

} // namespace tesseract_planning

BOOST_CLASS_EXPORT_KEY(tesseract_planning::SimplePlannerLVSAssignNoIKPlanProfile)

#endif // TESSERACT_MOTION_PLANNERS_SIMPLE_PLANNER_LVS_ASSIGN_NO_IK_PLAN_PROFILE_H
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,15 @@ class SimplePlannerLVSAssignPlanProfile : public SimplePlannerPlanProfile

/** @brief The maximum number of steps for the plan */
int max_steps;

protected:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive&, const unsigned int); // NOLINT
};

} // namespace tesseract_planning

BOOST_CLASS_EXPORT_KEY(tesseract_planning::SimplePlannerLVSAssignPlanProfile)

#endif // TESSERACT_MOTION_PLANNERS_SIMPLE_PLANNER_LVS_ASSIGN_PLAN_PROFILE_H
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,16 @@ std::vector<MoveInstructionPoly> SimplePlannerFixedSizeAssignNoIKPlanProfile::ge
return getInterpolatedInstructions(base.manip->getJointNames(), states, base.instruction);
}

template <class Archive>
void SimplePlannerFixedSizeAssignNoIKPlanProfile::serialize(Archive& ar, const unsigned int /*version*/)
{
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(SimplePlannerPlanProfile);
ar& BOOST_SERIALIZATION_NVP(freespace_steps);
ar& BOOST_SERIALIZATION_NVP(linear_steps);
}

} // namespace tesseract_planning

#include <tesseract_common/serialization.h>
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(tesseract_planning::SimplePlannerFixedSizeAssignNoIKPlanProfile)
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_planning::SimplePlannerFixedSizeAssignNoIKPlanProfile)
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,19 @@ SimplePlannerLVSAssignNoIKPlanProfile::generate(const MoveInstructionPoly& prev_
return getInterpolatedInstructions(base.manip->getJointNames(), states, base.instruction);
}

template <class Archive>
void SimplePlannerLVSAssignNoIKPlanProfile::serialize(Archive& ar, const unsigned int /*version*/)
{
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(SimplePlannerPlanProfile);
ar& BOOST_SERIALIZATION_NVP(state_longest_valid_segment_length);
ar& BOOST_SERIALIZATION_NVP(translation_longest_valid_segment_length);
ar& BOOST_SERIALIZATION_NVP(rotation_longest_valid_segment_length);
ar& BOOST_SERIALIZATION_NVP(min_steps);
ar& BOOST_SERIALIZATION_NVP(max_steps);
}

} // namespace tesseract_planning

#include <tesseract_common/serialization.h>
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(tesseract_planning::SimplePlannerLVSAssignNoIKPlanProfile)
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_planning::SimplePlannerLVSAssignNoIKPlanProfile)
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,19 @@ SimplePlannerLVSAssignPlanProfile::generate(const MoveInstructionPoly& prev_inst
return getInterpolatedInstructions(base.manip->getJointNames(), states, base.instruction);
}

template <class Archive>
void SimplePlannerLVSAssignPlanProfile::serialize(Archive& ar, const unsigned int /*version*/)
{
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(SimplePlannerPlanProfile);
ar& BOOST_SERIALIZATION_NVP(state_longest_valid_segment_length);
ar& BOOST_SERIALIZATION_NVP(translation_longest_valid_segment_length);
ar& BOOST_SERIALIZATION_NVP(rotation_longest_valid_segment_length);
ar& BOOST_SERIALIZATION_NVP(min_steps);
ar& BOOST_SERIALIZATION_NVP(max_steps);
}

} // namespace tesseract_planning

#include <tesseract_common/serialization.h>
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(tesseract_planning::SimplePlannerLVSAssignPlanProfile)
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_planning::SimplePlannerLVSAssignPlanProfile)

0 comments on commit f53935d

Please sign in to comment.