Skip to content

Commit

Permalink
Merge branch 'master' into feature/new-descartes-profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong authored Dec 18, 2024
2 parents a69dffe + 51f87af commit 5f46358
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ class Profile

Profile() = default;
Profile(std::size_t key);
Profile(const Profile&) = delete;
Profile& operator=(const Profile&) = delete;
Profile(Profile&&) = delete;
Profile&& operator=(Profile&&) = delete;
virtual ~Profile() = default;

/**
Expand All @@ -56,6 +52,11 @@ class Profile
std::size_t getKey() const;

protected:
Profile(const Profile&) = default;
Profile& operator=(const Profile&) = default;
Profile(Profile&&) = default;
Profile& operator=(Profile&&) = default;

std::size_t key_{ 0 };
friend class boost::serialization::access;
template <class Archive>
Expand Down
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 5f46358

Please sign in to comment.