diff --git a/example/go2/audiohub/example.mp3 b/example/go2/audiohub/example.mp3 new file mode 100644 index 0000000..50e25de Binary files /dev/null and b/example/go2/audiohub/example.mp3 differ diff --git a/example/go2/audiohub/example.wav b/example/go2/audiohub/example.wav new file mode 100644 index 0000000..1b85bdb Binary files /dev/null and b/example/go2/audiohub/example.wav differ diff --git a/example/go2/audiohub/megaphone_example.py b/example/go2/audiohub/megaphone_example.py new file mode 100644 index 0000000..89bd610 --- /dev/null +++ b/example/go2/audiohub/megaphone_example.py @@ -0,0 +1,42 @@ +import time +import sys + +from unitree_sdk2py.core.channel import ChannelFactoryInitialize +from unitree_sdk2py.go2.audiohub.audiohub_client import AudioHubClient + +#from unitree_sdk2py.idl.idl_dataclass import IDLDataClass +#from unitree_sdk2py.utils.logger import setup_logging +#from unitree_sdk2py.sdk.sdk import create_standard_sdk + +if __name__ == "__main__": + + if len(sys.argv) < 2: + print(f"Usage: python3 {sys.argv[0]} networkInterface") + sys.exit(-1) + + ChannelFactoryInitialize(0, sys.argv[1]) + + # Initialize the SDK with a custom name, which is used to identify the SDK instance and its associated logs. + #sdk = create_standard_sdk('UnitreeGo2SDK') + + # Create a robot instance using the DDS protocol. + # `domainId=0` is used as it is currently the standard for all Go2 robots, although a script to change this on the robot is planned. + # `interface="eth0"` specifies the network interface the DDS should use. + # Each robot is uniquely identified by a serial number, allowing for multiple robots to be managed by the SDK. + # Check if the network interface argument is provided + + + client = AudioHubClient() + client.SetTimeout(3.0) + client.Init() + + # Enable Megaphone + client.MegaphoneEnter() + + # uploading mp3/wav + #client.MegaphoneUpload("oiia-oiia-sound.mp3") + client.MegaphoneUpload("oiia-oiia-sound.wav") + time.sleep(5) + + # Disable Megaphone + client.MegaphoneExit() \ No newline at end of file diff --git a/example/go2/audiohub/oiia-oiia-sound.mp3 b/example/go2/audiohub/oiia-oiia-sound.mp3 new file mode 100644 index 0000000..e00db44 Binary files /dev/null and b/example/go2/audiohub/oiia-oiia-sound.mp3 differ diff --git a/example/go2/audiohub/oiia-oiia-sound.wav b/example/go2/audiohub/oiia-oiia-sound.wav new file mode 100644 index 0000000..df14f9b Binary files /dev/null and b/example/go2/audiohub/oiia-oiia-sound.wav differ diff --git a/example/go2/audiohub/sound_1.mp3 b/example/go2/audiohub/sound_1.mp3 new file mode 100644 index 0000000..bedef40 Binary files /dev/null and b/example/go2/audiohub/sound_1.mp3 differ diff --git a/example/go2/audiohub/sound_1.wav b/example/go2/audiohub/sound_1.wav new file mode 100644 index 0000000..75bffbc Binary files /dev/null and b/example/go2/audiohub/sound_1.wav differ