Skip to content

Commit

Permalink
partially address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Miaofei <[email protected]>
  • Loading branch information
mm318 committed Mar 22, 2020
1 parent d743efa commit b5f7a05
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions rclpy/rclpy/qos_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@
from rclpy.waitable import Waitable


class QoSPolicyKind(IntEnum):
"""
Enum for types of QoS policies that a Publisher or Subscription can set.
This enum matches the one defined in rmw/incompatible_qos_events_statuses.h
"""

RMW_QOS_POLICY_INVALID = 1 << 0
RMW_QOS_POLICY_DURABILITY = 1 << 1
RMW_QOS_POLICY_DEADLINE = 1 << 2
RMW_QOS_POLICY_LIVELINESS = 1 << 3
RMW_QOS_POLICY_RELIABILITY = 1 << 4
RMW_QOS_POLICY_HISTORY = 1 << 5
RMW_QOS_POLICY_LIFESPAN = 1 << 6


class QoSPublisherEventType(IntEnum):
"""
Enum for types of QoS events that a Publisher can receive.
Expand Down Expand Up @@ -83,7 +99,7 @@ class QoSSubscriptionEventType(IntEnum):
'QoSRequestedIncompatibleQoSInfo', [
('total_count', 'int'),
('total_count_change', 'int'),
('last_policy_id', 'int'),
('last_policy_kind', 'int'),
])

"""
Expand Down Expand Up @@ -113,12 +129,7 @@ class QoSSubscriptionEventType(IntEnum):
Mirrors rmw_offered_incompatible_qos_status_t from rmw/types.h
"""
QoSOfferedIncompatibleQoSInfo = NamedTuple(
'QoSOfferedIncompatibleQoSInfo', [
('total_count', 'int'),
('total_count_change', 'int'),
('last_policy_id', 'int'),
])
QoSOfferedIncompatibleQoSInfo = QoSRequestedIncompatibleQoSInfo


class QoSEventHandler(Waitable):
Expand Down

0 comments on commit b5f7a05

Please sign in to comment.