-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #418 from derkmed/dialog_refactor
Refactor all dialogue system nodes to inherit from same abstract class
- Loading branch information
Showing
11 changed files
with
55 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
ros/angel_system_nodes/angel_system_nodes/audio/dialogue.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from rclpy.node import Node | ||
|
||
from angel_msgs.msg import DialogueUtterance | ||
|
||
|
||
class AbstractDialogueNode(Node): | ||
def __init__(self): | ||
super().__init__(self.__class__.__name__) | ||
self.log = self.get_logger() | ||
|
||
def _copy_dialogue_utterance( | ||
src_msg: DialogueUtterance, node_name: str, copy_time | ||
) -> DialogueUtterance: | ||
msg = DialogueUtterance() | ||
|
||
msg.header.frame_id = node_name | ||
msg.header.stamp = copy_time | ||
|
||
msg.utterance_text = src_msg.utterance_text | ||
|
||
# Copy all optional fields below. | ||
|
||
# Copy over intent classification information if present. | ||
if src_msg.intent: | ||
msg.intent = src_msg.intent | ||
msg.intent_confidence_score = src_msg.intent_confidence_score | ||
|
||
# Copy over emotion classification information if present. | ||
if msg.emotion: | ||
msg.emotion = src_msg.emotion | ||
msg.emotion_confidence_score = src_msg.emotion_confidence_score | ||
|
||
return msg |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters