Hi Everyone
I am new to ROS and cpp so please be patient ;)
I work with Ubuntu 18.04.4 LTS and ROS Melodic. I installed audio_commen with command sudo apt-get install ros-melodic-audio-common according the side link
After some hours of trying I created completely new package just for this function to eliminate other factors and at the moment it looks pretty simple.
node code:
#include "ros/ros.h"
#include <sound_play/sound_play.h>
int main(int argc, char **argv) {
ros::init(argc,argv,"audio_common_tutorial");
ros::NodeHandle n;
sound_play::SoundClient sc;
sc.playWaveFromPkg("sound_play", "sounds/BACKINGUP.ogg");
sc.playWave( "/home/ntuser/catkin_ws/src/audio_common_tutorial/doc/file.wav");
ros::spin();
return 0;
}
I am starting the nodes with launch file:
<launch>
<include file="$(find sound_play)/soundplay_node.launch"> </include>
<node pkg="order_receiver" type="order_receiver" name="order_receiver" output="screen">
<rosparam command="load" file="$(find order_receiver)/config/default.yaml" />
</node>
</launch>
both sounds command failed
[ WARN] [1587131813.785943539]: Sound command issued, but no node is subscribed to the topic. Perhaps you forgot to run soundplay_node.py
even thouth the node is listed by launching and after command rosnode list
The package WORKS good from command line e.g rosrun sound_play play.py "path" or roslaunch sound_play test.launch
Any ideas and recommendation?
regards
Originally posted by eliza on ROS Answers with karma: 16 on 2020-04-17
Post score: 0