Skip to content

Commit

Permalink
Add Ruckig composite profile serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoomen committed Dec 18, 2024
1 parent 9e90254 commit deebf72
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ struct RuckigTrajectorySmoothingCompositeProfile : public Profile

/** @brief max_jerk_scaling_factor The max jerk scaling factor passed to the solver */
double max_jerk_scaling_factor{ 1.0 };

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

struct RuckigTrajectorySmoothingMoveProfile : public Profile
Expand Down Expand Up @@ -96,6 +101,7 @@ struct RuckigTrajectorySmoothingMoveProfile : public Profile
};
} // namespace tesseract_planning

BOOST_CLASS_EXPORT_KEY(tesseract_planning::RuckigTrajectorySmoothingCompositeProfile)
BOOST_CLASS_EXPORT_KEY(tesseract_planning::RuckigTrajectorySmoothingMoveProfile)

#endif // TESSERACT_TASK_COMPOSER_RUCKIG_TRAJECTORY_SMOOTHING_PROFILE_H
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ std::size_t RuckigTrajectorySmoothingCompositeProfile::getStaticKey()
return std::type_index(typeid(RuckigTrajectorySmoothingCompositeProfile)).hash_code();
}

template <class Archive>
void RuckigTrajectorySmoothingCompositeProfile::serialize(Archive& ar, const unsigned int /*version*/)
{
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Profile);
ar& BOOST_SERIALIZATION_NVP(duration_extension_fraction);
ar& BOOST_SERIALIZATION_NVP(max_duration_extension_factor);
ar& BOOST_SERIALIZATION_NVP(max_velocity_scaling_factor);
ar& BOOST_SERIALIZATION_NVP(max_acceleration_scaling_factor);
ar& BOOST_SERIALIZATION_NVP(max_jerk_scaling_factor);
}

RuckigTrajectorySmoothingMoveProfile::RuckigTrajectorySmoothingMoveProfile()
: Profile(RuckigTrajectorySmoothingMoveProfile::getStaticKey())
{
Expand Down Expand Up @@ -81,5 +92,7 @@ void RuckigTrajectorySmoothingMoveProfile::serialize(Archive& ar, const unsigned
} // namespace tesseract_planning

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

0 comments on commit deebf72

Please sign in to comment.