23#ifndef AUDIO_COMMON__MUSIC_NODE
24#define AUDIO_COMMON__MUSIC_NODE
31#include <ament_index_cpp/get_package_share_directory.hpp>
32#include <audio_common_msgs/msg/audio_stamped.hpp>
33#include <audio_common_msgs/srv/music_play.hpp>
34#include <rclcpp/rclcpp.hpp>
35#include <std_srvs/srv/trigger.hpp>
61 rclcpp::Publisher<audio_common_msgs::msg::AudioStamped>::SharedPtr
63 rclcpp::Service<audio_common_msgs::srv::MusicPlay>::SharedPtr
play_service_;
71 const std::shared_ptr<audio_common_msgs::srv::MusicPlay::Request> request,
72 std::shared_ptr<audio_common_msgs::srv::MusicPlay::Response> response);
74 pause_callback(
const std::shared_ptr<std_srvs::srv::Trigger::Request> request,
75 std::shared_ptr<std_srvs::srv::Trigger::Response> response);
77 const std::shared_ptr<std_srvs::srv::Trigger::Request> request,
78 std::shared_ptr<std_srvs::srv::Trigger::Response> response);
80 stop_callback(
const std::shared_ptr<std_srvs::srv::Trigger::Request> request,
81 std::shared_ptr<std_srvs::srv::Trigger::Response> response);
void pause_callback(const std::shared_ptr< std_srvs::srv::Trigger::Request > request, std::shared_ptr< std_srvs::srv::Trigger::Response > response)
Definition music_node.cpp:165
std::atomic< bool > pause_music_
Definition music_node.hpp:50
std::mutex pause_mutex_
Definition music_node.hpp:57
MusicNode()
Definition music_node.cpp:43
std::condition_variable pause_cv_
Definition music_node.hpp:58
std::thread publish_thread_
Definition music_node.hpp:56
std::string frame_id_
Definition music_node.hpp:47
~MusicNode() override
Definition music_node.cpp:72
rclcpp::Service< std_srvs::srv::Trigger >::SharedPtr stop_service_
Definition music_node.hpp:64
rclcpp::Service< std_srvs::srv::Trigger >::SharedPtr pause_service_
Definition music_node.hpp:65
void play_callback(const std::shared_ptr< audio_common_msgs::srv::MusicPlay::Request > request, std::shared_ptr< audio_common_msgs::srv::MusicPlay::Response > response)
Definition music_node.cpp:130
std::atomic< bool > is_thread_alive_
Definition music_node.hpp:53
bool audio_loop_
Definition music_node.hpp:52
void resume_callback(const std::shared_ptr< std_srvs::srv::Trigger::Request > request, std::shared_ptr< std_srvs::srv::Trigger::Response > response)
Definition music_node.cpp:180
void stop_callback(const std::shared_ptr< std_srvs::srv::Trigger::Request > request, std::shared_ptr< std_srvs::srv::Trigger::Response > response)
Definition music_node.cpp:196
int chunk_
Definition music_node.hpp:46
rclcpp::Service< audio_common_msgs::srv::MusicPlay >::SharedPtr play_service_
Definition music_node.hpp:63
rclcpp::Publisher< audio_common_msgs::msg::AudioStamped >::SharedPtr player_pub_
Definition music_node.hpp:62
std::atomic< bool > stop_music_
Definition music_node.hpp:51
rclcpp::Service< std_srvs::srv::Trigger >::SharedPtr resume_service_
Definition music_node.hpp:66
void publish_audio(const std::string &file_path)
Definition music_node.cpp:79
Definition audio_capturer_node.hpp:32