32 std_msgs::String done_msg;
40 done_msg.data =
"play_sound_fail";
41 g_done_msg_pub.
publish(done_msg);
53 fprintf(stderr,
"Fork Failed!! \n");
54 done_msg.data =
"play_sound_fail";
55 g_done_msg_pub.
publish(done_msg);
58 execl(
"/usr/bin/madplay",
"madplay", (
g_sound_file_path + msg->data).c_str(),
"-Q", (
char*)0);
61 done_msg.data =
"play_sound";
62 g_done_msg_pub.
publish(done_msg);
68 int main(
int argc,
char** argv)
70 ros::init(argc, argv,
"ros_madplay_player");
78 g_done_msg_pub = nh.
advertise<std_msgs::String>(
"/robotis/movement_done", 5);
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
std::string g_sound_file_path
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
ros::Publisher g_done_msg_pub
void play_sound_callback(const std_msgs::String::ConstPtr &msg)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)