-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/event options #11
Conversation
mkabtoul
commented
Oct 13, 2024
- Adds options to Event for handling the event only once during the node lifetime or adding a delay between consecutive event handling instances
- Adds support for list values in Event source values
- Fixes sending service requests from the monitor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with suggested changes.
ros_sugar/config/base_config.py
Outdated
@@ -36,7 +36,7 @@ class QoSConfig(BaseAttrs): | |||
|
|||
# used only honored if the “history” policy was set to “keep last” |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment needs correction
ros_sugar/core/event.py
Outdated
@@ -151,7 +177,7 @@ def __init__(self, ros_message: Any, attributes: List[str]) -> None: | |||
self._message = ros_message | |||
self._attrs = attributes | |||
# Get attribute from ros message | |||
self.value: Union[float, int, bool, str] = _access_attribute( | |||
self.value: Union[float, int, bool, str, list] = _access_attribute( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List from typing should be used for 3.8 compatibility
ros_sugar/core/event.py
Outdated
@@ -284,25 +324,32 @@ def __init__( | |||
self, | |||
event_name: str, | |||
event_source: Union[Topic, str, Dict], | |||
trigger_value: Union[float, int, bool, str, None], | |||
trigger_value: Union[float, int, bool, str, list, None], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List from typing should be used for 3.8 compatibility
ros_sugar/events.py
Outdated
@@ -153,7 +156,7 @@ def __init__( | |||
self, | |||
event_name: str, | |||
event_source: Union[Topic, str, Dict], | |||
trigger_value: Union[float, int, bool, str], | |||
trigger_value: Union[float, int, bool, str, list], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List from typing should be used
ros_sugar/events.py
Outdated
@@ -164,7 +167,7 @@ def __init__( | |||
:param event_source: | |||
:type event_source: Union[Topic, str, Dict] | |||
:param trigger_value: | |||
:type trigger_value: Union[float, int, bool, str] | |||
:type trigger_value: Union[float, int, bool, str, list] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List from typing
ros_sugar/events.py
Outdated
@@ -210,7 +213,7 @@ def __init__( | |||
self, | |||
event_name: str, | |||
event_source: Union[Topic, str, Dict], | |||
trigger_value: Union[float, int, bool, str], | |||
trigger_value: Union[float, int, bool, str, list], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List from typing
ros_sugar/events.py
Outdated
@@ -221,7 +224,7 @@ def __init__( | |||
:param event_source: | |||
:type event_source: Union[Topic, str, Dict] | |||
:param trigger_value: | |||
:type trigger_value: Union[float, int, bool, str] | |||
:type trigger_value: Union[float, int, bool, str, list] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List from typing
ros_sugar/events.py
Outdated
@@ -245,7 +323,7 @@ def __init__( | |||
self, | |||
event_name: str, | |||
event_source: Union[Topic, str, Dict], | |||
trigger_value: Union[float, int, bool, str], | |||
trigger_value: Union[float, int, bool, str, list], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List from typing
ros_sugar/events.py
Outdated
@@ -256,7 +334,7 @@ def __init__( | |||
:param event_source: | |||
:type event_source: Union[Topic, str, Dict] | |||
:param trigger_value: | |||
:type trigger_value: Union[float, int, bool, str] | |||
:type trigger_value: Union[float, int, bool, str, list] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List from typing