Open UserName-wang opened 6 months ago
Hi @UserName-wang, sorry for the delay.
You can play a wav file using the action CLI
ros2 action send_goal /play robomaster_msgs/action/PlaySound "{file: '<path to the wavfile>'}" --feedback
It will upload the file via FTP, assign it to an ID (printed in the console), and play it.
Btw, I also tried the SDK example https://github.com/dji-sdk/RoboMaster-SDK/blob/master/examples/01_robot/03_play_audio.py and it works.
Hi @UserName-wang, sorry for the delay.
You can play a wav file using the action CLI
ros2 action send_goal /play robomaster_msgs/action/PlaySound "{file: '<path to the wavfile>'}" --feedback
It will upload the file via FTP, assign it to an ID (printed in the console), and play it.
Btw, I also tried the SDK example https://github.com/dji-sdk/RoboMaster-SDK/blob/master/examples/01_robot/03_play_audio.py and it works.
Hi @jeguzzi , the action CLI works!
the speaker.py: cmd_sound cannot play the wav file. I tried demo1.wav. the below code skipped msg.file. just only passed three parameters to the function play: _self.play(sound_id=msg.soundid, times=msg.times, control=msg.control) by using these new code robomaster s1 can play a wav file: if msg.file and msg.control: self.api.play_audio(msg.file).wait_for_completed() else:
self.play(sound_id=msg.sound_id, times=msg.times, control=msg.control) Maybe it's not the best way to play a wav file, Can someone give me any suggestion?
and the action server play didn't start, I only can find /play/_action/cancel_goal in rqt service caller , but the command: ros2 action list can find /play, strange !!!