diff --git a/projects/opendr_ws_2/src/opendr_interface/CMakeLists.txt b/projects/opendr_ws_2/src/opendr_interface/CMakeLists.txt index 9c158812e5..21356f6664 100644 --- a/projects/opendr_ws_2/src/opendr_interface/CMakeLists.txt +++ b/projects/opendr_ws_2/src/opendr_interface/CMakeLists.txt @@ -31,6 +31,8 @@ rosidl_generate_interfaces(${PROJECT_NAME} "msg/OpenDRPose2DKeypoint.msg" "msg/OpenDRPose3D.msg" "msg/OpenDRPose3DKeypoint.msg" + "msg/AudioData.msg" + "msg/AudioInfo.msg" "srv/OpenDRSingleObjectTracking.srv" "srv/ImgToMesh.srv" DEPENDENCIES std_msgs shape_msgs sensor_msgs vision_msgs diff --git a/projects/opendr_ws_2/src/opendr_interface/msg/AudioData.msg b/projects/opendr_ws_2/src/opendr_interface/msg/AudioData.msg new file mode 100644 index 0000000000..dd2331bbe6 --- /dev/null +++ b/projects/opendr_ws_2/src/opendr_interface/msg/AudioData.msg @@ -0,0 +1 @@ +uint8[] data diff --git a/projects/opendr_ws_2/src/opendr_interface/msg/AudioInfo.msg b/projects/opendr_ws_2/src/opendr_interface/msg/AudioInfo.msg new file mode 100644 index 0000000000..ca4b55e34f --- /dev/null +++ b/projects/opendr_ws_2/src/opendr_interface/msg/AudioInfo.msg @@ -0,0 +1,12 @@ +# This message contains the audio meta data + +# Number of channels +uint8 channels +# Sampling rate [Hz] +uint32 sample_rate +# Audio format (e.g. S16LE) +string sample_format +# Amount of audio data per second [bits/s] +uint32 bitrate +# Audio coding format (e.g. WAVE, MP3) +string coding_format diff --git a/projects/opendr_ws_2/src/opendr_perception/opendr_perception/audiovisual_emotion_recognition_node.py b/projects/opendr_ws_2/src/opendr_perception/opendr_perception/audiovisual_emotion_recognition_node.py index 008b51d7b7..78c1b09629 100644 --- a/projects/opendr_ws_2/src/opendr_perception/opendr_perception/audiovisual_emotion_recognition_node.py +++ b/projects/opendr_ws_2/src/opendr_perception/opendr_perception/audiovisual_emotion_recognition_node.py @@ -25,7 +25,10 @@ from rclpy.node import Node import message_filters from sensor_msgs.msg import Image as ROS_Image -from audio_common_msgs.msg import AudioData +if os.environ.get('ROS_DISTRO').lower() in ['foxy', 'humble']: + from opendr_interface.msg import AudioData +else: + from audio_common_msgs.msg import AudioData from vision_msgs.msg import Classification2D from opendr_bridge import ROS2Bridge diff --git a/projects/opendr_ws_2/src/opendr_perception/opendr_perception/speech_command_recognition_node.py b/projects/opendr_ws_2/src/opendr_perception/opendr_perception/speech_command_recognition_node.py index 98344922bf..47a38b8d19 100755 --- a/projects/opendr_ws_2/src/opendr_perception/opendr_perception/speech_command_recognition_node.py +++ b/projects/opendr_ws_2/src/opendr_perception/opendr_perception/speech_command_recognition_node.py @@ -17,10 +17,14 @@ import argparse import torch import numpy as np +import os import rclpy from rclpy.node import Node -from audio_common_msgs.msg import AudioData +if os.environ.get('ROS_DISTRO').lower() in ['foxy', 'humble']: + from opendr_interface.msg import AudioData +else: + from audio_common_msgs.msg import AudioData from vision_msgs.msg import Classification2D from opendr_bridge import ROS2Bridge diff --git a/src/opendr/perception/facial_expression_recognition/landmark_based_facial_expression_recognition/progressive_spatio_temporal_bln_learner.py b/src/opendr/perception/facial_expression_recognition/landmark_based_facial_expression_recognition/progressive_spatio_temporal_bln_learner.py index 0f591adc89..e75aeaa558 100644 --- a/src/opendr/perception/facial_expression_recognition/landmark_based_facial_expression_recognition/progressive_spatio_temporal_bln_learner.py +++ b/src/opendr/perception/facial_expression_recognition/landmark_based_facial_expression_recognition/progressive_spatio_temporal_bln_learner.py @@ -315,7 +315,7 @@ def eval(self, val_dataset, val_loader=None, epoch=0, monte_carlo_dropout=True, :type val_data_filename: str, optional :param val_labels_filename: the file name of val labels which is placed in the dataset path. :type val_labels_filename: str, optional - :param save_score: if set to True, it saves the classification score of all samples in differenc classes + :param save_score: if set to True, it saves the classification score of all samples in different classes in a log file. Default to False. :type save_score: bool, optional :param wrong_file: if set to True, it saves the results of wrongly classified samples. Default to False.