3838#include < fuse_core/fuse_macros.h>
3939#include < fuse_core/transaction.h>
4040#include < fuse_core/variable.h>
41- #include < ros/duration.h>
42- #include < ros/time.h>
41+ #include < rclcpp/time.hpp>
4342
4443#include < boost/range/any_range.hpp>
4544
@@ -65,7 +64,7 @@ namespace fuse_core
6564class TimestampManager
6665{
6766public:
68- FUSE_SMART_PTR_DEFINITIONS (TimestampManager);
67+ FUSE_SMART_PTR_DEFINITIONS (TimestampManager)
6968
7069 /* *
7170 * @brief Function that generates motion model constraints between the requested timestamps
@@ -80,8 +79,8 @@ class TimestampManager
8079 * @param[out] variables One or more variables at both the \p beginning_stamp and \p ending_stamp. The
8180 * variables should include initial values for the optimizer.
8281 */
83- using MotionModelFunction = std::function<void (const ros ::Time& beginning_stamp,
84- const ros ::Time& ending_stamp,
82+ using MotionModelFunction = std::function<void (const rclcpp ::Time& beginning_stamp,
83+ const rclcpp ::Time& ending_stamp,
8584 std::vector<Constraint::SharedPtr>& constraints,
8685 std::vector<Variable::SharedPtr>& variables)>;
8786
@@ -90,9 +89,9 @@ class TimestampManager
9089 *
9190 * An object representing a range defined by two iterators. It has begin() and end() methods (which means it can
9291 * be used in range-based for loops), an empty() method, and a front() method for directly accessing the first
93- * member. When dereferenced, an iterator returns a const ros ::Time&.
92+ * member. When dereferenced, an iterator returns a const rclcpp ::Time&.
9493 */
95- using const_stamp_range = boost::any_range<const ros ::Time, boost::forward_traversal_tag>;
94+ using const_stamp_range = boost::any_range<const rclcpp ::Time, boost::forward_traversal_tag>;
9695
9796 /* *
9897 * @brief Constructor that accepts the motion model generator as a std::function object, probably constructed using
@@ -102,7 +101,7 @@ class TimestampManager
102101 * @param[in] buffer_length The length of the motion model history. If queries arrive involving timestamps
103102 * that are older than the buffer length, an exception will be thrown.
104103 */
105- explicit TimestampManager (MotionModelFunction generator, const ros ::Duration& buffer_length = ros::DURATION_MAX );
104+ explicit TimestampManager (MotionModelFunction generator, const rclcpp ::Duration& buffer_length = rclcpp::Duration::max() );
106105
107106 /* *
108107 * @brief Constructor that accepts the motion model generator as a member function pointer and object pointer
@@ -116,12 +115,12 @@ class TimestampManager
116115 * that are older than the buffer length, an exception will be thrown.
117116 */
118117 template <class T >
119- TimestampManager (void (T::*fp)(const ros ::Time& beginning_stamp,
120- const ros ::Time& ending_stamp,
118+ TimestampManager (void (T::*fp)(const rclcpp ::Time& beginning_stamp,
119+ const rclcpp ::Time& ending_stamp,
121120 std::vector<Constraint::SharedPtr>& constraints,
122121 std::vector<Variable::SharedPtr>& variables),
123122 T* obj,
124- const ros ::Duration& buffer_length = ros::DURATION_MAX );
123+ const rclcpp ::Duration& buffer_length = rclcpp::Duration::max() );
125124
126125 /* *
127126 * @brief Constructor that accepts the motion model generator as a const member function pointer and object pointer
@@ -135,12 +134,12 @@ class TimestampManager
135134 * that are older than the buffer length, an exception will be thrown.
136135 */
137136 template <class T >
138- TimestampManager (void (T::*fp)(const ros ::Time& beginning_stamp,
139- const ros ::Time& ending_stamp,
137+ TimestampManager (void (T::*fp)(const rclcpp ::Time& beginning_stamp,
138+ const rclcpp ::Time& ending_stamp,
140139 std::vector<Constraint::SharedPtr>& constraints,
141140 std::vector<Variable::SharedPtr>& variables) const ,
142141 T* obj,
143- const ros ::Duration& buffer_length = ros::DURATION_MAX );
142+ const rclcpp ::Duration& buffer_length = rclcpp::Duration::max() );
144143
145144 /* *
146145 * @brief Destructor
@@ -150,15 +149,15 @@ class TimestampManager
150149 /* *
151150 * @brief Read-only access to the buffer length
152151 */
153- const ros ::Duration& bufferLength () const
152+ const rclcpp ::Duration& bufferLength () const
154153 {
155154 return buffer_length_;
156155 }
157156
158157 /* *
159158 * @brief Write access to the buffer length
160159 */
161- void bufferLength (const ros ::Duration& buffer_length)
160+ void bufferLength (const rclcpp ::Duration& buffer_length)
162161 {
163162 buffer_length_ = buffer_length;
164163 }
@@ -200,16 +199,16 @@ class TimestampManager
200199 */
201200 struct MotionModelSegment
202201 {
203- ros ::Time beginning_stamp;
204- ros ::Time ending_stamp;
202+ rclcpp ::Time beginning_stamp;
203+ rclcpp ::Time ending_stamp;
205204 std::vector<Constraint::SharedPtr> constraints;
206205 std::vector<Variable::SharedPtr> variables;
207206
208207 MotionModelSegment () = default ;
209208
210209 MotionModelSegment (
211- const ros ::Time& beginning_stamp,
212- const ros ::Time& ending_stamp,
210+ const rclcpp ::Time& beginning_stamp,
211+ const rclcpp ::Time& ending_stamp,
213212 const std::vector<Constraint::SharedPtr>& constraints,
214213 const std::vector<Variable::SharedPtr>& variables) :
215214 beginning_stamp (beginning_stamp),
@@ -226,10 +225,10 @@ class TimestampManager
226225 * The MotionModelHistory will always contain all represented timestamps; the very last entry will be the ending
227226 * time of the previous MotionModelSegment, and the very last entry will be an empty MotionModelSegment.
228227 */
229- using MotionModelHistory = std::map<ros ::Time, MotionModelSegment>;
228+ using MotionModelHistory = std::map<rclcpp ::Time, MotionModelSegment>;
230229
231230 MotionModelFunction generator_; // !< Users upplied function that generates motion model constraints
232- ros ::Duration buffer_length_; // !< The length of the motion model history. Segments older than \p buffer_length_
231+ rclcpp ::Duration buffer_length_; // !< The length of the motion model history. Segments older than \p buffer_length_
233232 // !< will be removed from the motion model history
234233 MotionModelHistory motion_model_history_; // !< Container that stores all previously generated motion models
235234
@@ -243,8 +242,8 @@ class TimestampManager
243242 * @param[out] transaction A transaction object to be updated with the changes caused by addSegment
244243 */
245244 void addSegment (
246- const ros ::Time& beginning_stamp,
247- const ros ::Time& ending_stamp,
245+ const rclcpp ::Time& beginning_stamp,
246+ const rclcpp ::Time& ending_stamp,
248247 Transaction& transaction);
249248
250249 /* *
@@ -271,7 +270,7 @@ class TimestampManager
271270 */
272271 void splitSegment (
273272 MotionModelHistory::iterator& iter,
274- const ros ::Time& stamp,
273+ const rclcpp ::Time& stamp,
275274 Transaction& transaction);
276275
277276 /* *
@@ -281,12 +280,12 @@ class TimestampManager
281280};
282281
283282template <class T >
284- TimestampManager::TimestampManager (void (T::*fp)(const ros ::Time& beginning_stamp,
285- const ros ::Time& ending_stamp,
283+ TimestampManager::TimestampManager (void (T::*fp)(const rclcpp ::Time& beginning_stamp,
284+ const rclcpp ::Time& ending_stamp,
286285 std::vector<Constraint::SharedPtr>& constraints,
287286 std::vector<Variable::SharedPtr>& variables),
288287 T* obj,
289- const ros ::Duration& buffer_length) :
288+ const rclcpp ::Duration& buffer_length) :
290289 TimestampManager(std::bind(fp,
291290 obj,
292291 std::placeholders::_1,
@@ -298,12 +297,12 @@ TimestampManager::TimestampManager(void(T::*fp)(const ros::Time& beginning_stamp
298297}
299298
300299template <class T >
301- TimestampManager::TimestampManager (void (T::*fp)(const ros ::Time& beginning_stamp,
302- const ros ::Time& ending_stamp,
300+ TimestampManager::TimestampManager (void (T::*fp)(const rclcpp ::Time& beginning_stamp,
301+ const rclcpp ::Time& ending_stamp,
303302 std::vector<Constraint::SharedPtr>& constraints,
304303 std::vector<Variable::SharedPtr>& variables) const ,
305304 T* obj,
306- const ros ::Duration& buffer_length) :
305+ const rclcpp ::Duration& buffer_length) :
307306 TimestampManager(std::bind(fp,
308307 obj,
309308 std::placeholders::_1,
0 commit comments