Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ruckig composite profile serialization #550

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading