Skip to content

Commit

Permalink
Merge pull request #412 from derkmed/dialog_utterance
Browse files Browse the repository at this point in the history
Add modular DialogueUtterance msg for upcoming Node Refactoring.
  • Loading branch information
hdefazio authored May 15, 2024
2 parents bfee4df + 4e6df05 commit 9969700
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 0 deletions.
1 change: 1 addition & 0 deletions ros/angel_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ set( message_files
msg/AruiObject3d.msg
msg/AruiUpdate.msg
msg/AruiUserNotification.msg
msg/DialogueUtterance.msg
msg/EyeGazeData.msg
msg/HandJointPose.msg
msg/HandJointPosesUpdate.msg
Expand Down
24 changes: 24 additions & 0 deletions ros/angel_msgs/msg/DialogueUtterance.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Dialogue Utterance with additional information about the environmental state
# and user model.
#

# The header primarily encapsulates when this message was emitted.
# The time component of this may be utilized as an identifier for this user
# intent and utterance.
std_msgs/Header header

# Speech-to-text of the user utterance we have interpreted
string utterance_text

# Below are optional fields

# Canonical user intent that has been interpreted. "Canonical" in this context
# is to mean that this string may be used as an identifier of this type of
# user intent. Should be in the range [0,1] where 1.0 means absolute confidence.
string intent
float64 intent_confidence_score

# Emotion classification. Should be in the range [0,1] where 1.0 means absolute confidence.
string emotion
float64 emotion_confidence_score
99 changes: 99 additions & 0 deletions unity/ARUI/Assets/RosMessages/Angel/msg/DialogueUtteranceMsg.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
//Do not edit! This file was generated by Unity-ROS MessageGeneration.
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Unity.Robotics.ROSTCPConnector.MessageGeneration;

namespace RosMessageTypes.Angel
{
[Serializable]
public class DialogueUtteranceMsg : Message
{
public const string k_RosMessageName = "angel_msgs/DialogueUtterance";
public override string RosMessageName => k_RosMessageName;

//
// Dialogue Utterance with additional information about the environmental state
// and user model.
//
// The header primarily encapsulates when this message was emitted.
// The time component of this may be utilized as an identifier for this user
// intent and utterance.
public Std.HeaderMsg header;
// Speech-to-text of the user utterance we have interpreted
public string utterance_text;
// Below are optional fields
// Canonical user intent that has been interpreted. "Canonical" in this context
// is to mean that this string may be used as an identifier of this type of
// user intent. Should be in the range [0,1] where 1.0 means absolute confidence.
public string intent;
public double intent_confidence_score;
// Emotion classification. Should be in the range [0,1] where 1.0 means absolute confidence.
public string emotion;
public double emotion_confidence_score;

public DialogueUtteranceMsg()
{
this.header = new Std.HeaderMsg();
this.utterance_text = "";
this.intent = "";
this.intent_confidence_score = 0.0;
this.emotion = "";
this.emotion_confidence_score = 0.0;
}

public DialogueUtteranceMsg(Std.HeaderMsg header, string utterance_text, string intent, double intent_confidence_score, string emotion, double emotion_confidence_score)
{
this.header = header;
this.utterance_text = utterance_text;
this.intent = intent;
this.intent_confidence_score = intent_confidence_score;
this.emotion = emotion;
this.emotion_confidence_score = emotion_confidence_score;
}

public static DialogueUtteranceMsg Deserialize(MessageDeserializer deserializer) => new DialogueUtteranceMsg(deserializer);

private DialogueUtteranceMsg(MessageDeserializer deserializer)
{
this.header = Std.HeaderMsg.Deserialize(deserializer);
deserializer.Read(out this.utterance_text);
deserializer.Read(out this.intent);
deserializer.Read(out this.intent_confidence_score);
deserializer.Read(out this.emotion);
deserializer.Read(out this.emotion_confidence_score);
}

public override void SerializeTo(MessageSerializer serializer)
{
serializer.Write(this.header);
serializer.Write(this.utterance_text);
serializer.Write(this.intent);
serializer.Write(this.intent_confidence_score);
serializer.Write(this.emotion);
serializer.Write(this.emotion_confidence_score);
}

public override string ToString()
{
return "DialogueUtteranceMsg: " +
"\nheader: " + header.ToString() +
"\nutterance_text: " + utterance_text.ToString() +
"\nintent: " + intent.ToString() +
"\nintent_confidence_score: " + intent_confidence_score.ToString() +
"\nemotion: " + emotion.ToString() +
"\nemotion_confidence_score: " + emotion_confidence_score.ToString();
}

#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]
#else
[UnityEngine.RuntimeInitializeOnLoadMethod]
#endif
public static void Register()
{
MessageRegistry.Register(k_RosMessageName, Deserialize);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9969700

Please sign in to comment.