@@ -33,6 +33,7 @@ extern "C"
3333#include "rmw/ret_types.h"
3434#include "rmw/security_options.h"
3535#include "rmw/serialized_message.h"
36+ #include "rmw/time.h"
3637#include "rmw/visibility_control.h"
3738
3839// 24 bytes is the most memory needed to represent the GID by any current
@@ -318,53 +319,6 @@ typedef struct RMW_PUBLIC_TYPE rmw_request_id_t
318319 int64_t sequence_number ;
319320} rmw_request_id_t ;
320321
321- /// Struct representing a time point for rmw
322- typedef struct RMW_PUBLIC_TYPE rmw_time_t
323- {
324- /// Seconds since the epoch
325- uint64_t sec ;
326-
327- /// Nanoseconds component of this time point
328- uint64_t nsec ;
329- } rmw_time_t ;
330-
331- typedef rcutils_time_point_value_t rmw_time_point_value_t ;
332- typedef rcutils_duration_value_t rmw_duration_t ;
333-
334- /// Constant representing an infinite duration. Use rmw_time_equal for comparisons.
335- /**
336- * Different RMW implementations have different representations for infinite durations.
337- * This value is reported for QoS policy durations that are left unspecified.
338- * Do not directly comparee `sec == sec && nsec == nsec`, because we don't want to be sensitive
339- * to non-normalized values (nsec > 1 second) - use rmw_time_equal instead.
340- * This value is INT64_MAX nanoseconds = 0x7FFF FFFF FFFF FFFF = d 9 223 372 036 854 775 807
341- */
342- #define RMW_DURATION_INFINITE {9223372036LL, 854775807LL}
343-
344- /// Check whether two rmw_time_t represent the same time.
345- RMW_PUBLIC
346- RMW_WARN_UNUSED
347- bool
348- rmw_time_equal (const rmw_time_t left , const rmw_time_t right );
349-
350- /// Return the total nanosecond representation of a time.
351- RMW_PUBLIC
352- RMW_WARN_UNUSED
353- rmw_duration_t
354- rmw_time_total_nsec (const rmw_time_t time );
355-
356- /// Construct rmw_time_t from a total nanoseconds representation.
357- RMW_PUBLIC
358- RMW_WARN_UNUSED
359- rmw_time_t
360- rmw_time_from_nsec (const rmw_duration_t nanoseconds );
361-
362- /// Ensure that an rmw_time_t does not have nanoseconds > 1 second.
363- RMW_PUBLIC
364- RMW_WARN_UNUSED
365- rmw_time_t
366- rmw_time_normalize (const rmw_time_t time );
367-
368322/// Meta-data for a service-related take.
369323typedef struct RMW_PUBLIC_TYPE rmw_service_info_t
370324{
@@ -459,16 +413,17 @@ enum RMW_PUBLIC_TYPE rmw_qos_liveliness_policy_t
459413 RMW_QOS_POLICY_LIVELINESS_UNKNOWN = 4
460414};
461415
462- #define RMW_QOS_DURATION_UNSPECIFIED {0, 0}
463-
464- /// QoS Deadline default, 0s indicates deadline policies are not tracked or enforced
465- #define RMW_QOS_DEADLINE_DEFAULT RMW_QOS_DURATION_UNSPECIFIED
416+ /// QoS Deadline default - when unspecified the RMW implementation default is used
417+ /// In most implementations, this is "infinity" meaning that the deadline is not enforced
418+ #define RMW_QOS_DEADLINE_DEFAULT RMW_DURATION_UNSPECIFIED
466419
467- /// QoS Lifespan default, 0s indicate lifespan policies are not tracked or enforced
468- #define RMW_QOS_LIFESPAN_DEFAULT RMW_QOS_DURATION_UNSPECIFIED
420+ /// QoS Lifespan default - when unspecified the RMW implementation default is used
421+ /// In most implementations, this is "infinity" meaning that the deadline is not enforced
422+ #define RMW_QOS_LIFESPAN_DEFAULT RMW_DURATION_UNSPECIFIED
469423
470- /// QoS Liveliness lease duration default, 0s indicate lease durations are not tracked or enforced
471- #define RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT RMW_QOS_DURATION_UNSPECIFIED
424+ /// QoS liveliness lease duration default - when unspecified the RMW implementation default is used
425+ /// In most implementations, this is "infinity" meaning that the deadline is not enforced
426+ #define RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT RMW_DURATION_UNSPECIFIED
472427
473428/// ROS MiddleWare quality of service profile.
474429typedef struct RMW_PUBLIC_TYPE rmw_qos_profile_t
@@ -481,12 +436,27 @@ typedef struct RMW_PUBLIC_TYPE rmw_qos_profile_t
481436 /// Durability QoS policy setting
482437 enum rmw_qos_durability_policy_t durability ;
483438 /// The period at which messages are expected to be sent/received
439+ /**
440+ * RMW_DURATION_UNSPEFICIED will use the RMW implementation's default value,
441+ * which may or may not be infinite.
442+ * RMW_DURATION_INFINITE explicitly states that messages never miss a deadline expectation.
443+ */
484444 struct rmw_time_t deadline ;
485445 /// The age at which messages are considered expired and no longer valid
446+ /**
447+ * RMW_DURATION_UNSPEFICIED will use the RMW implementation's default value,
448+ * which may or may not be infinite.
449+ * RMW_DURATION_INFINITE explicitly states that messages do not expire.
450+ */
486451 struct rmw_time_t lifespan ;
487452 /// Liveliness QoS policy setting
488453 enum rmw_qos_liveliness_policy_t liveliness ;
489454 /// The time within which the RMW node or publisher must show that it is alive
455+ /**
456+ * RMW_DURATION_UNSPEFICIED will use the RMW implementation's default value,
457+ * which may or may not be infinite.
458+ * RMW_DURATION_INFINITE explicitly states that liveliness is not enforced.
459+ */
490460 struct rmw_time_t liveliness_lease_duration ;
491461
492462 /// If true, any ROS specific namespacing conventions will be circumvented.
0 commit comments