| 22 | using robotis::turtlebot3::devices::Sound; |
| 23 | |
| 24 | Sound::Sound( |
| 25 | std::shared_ptr<rclcpp::Node> & nh, |
| 26 | std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper, |
| 27 | const std::string & server_name) |
| 28 | : Devices(nh, dxl_sdk_wrapper) |
| 29 | { |
| 30 | RCLCPP_INFO(nh_->get_logger(), "Succeeded to create sound server"); |
| 31 | srv_ = nh_->create_service<turtlebot3_msgs::srv::Sound>( |
| 32 | server_name, |
| 33 | [this]( |
| 34 | const std::shared_ptr<turtlebot3_msgs::srv::Sound::Request> request, |
| 35 | std::shared_ptr<turtlebot3_msgs::srv::Sound::Response> response) -> void |
| 36 | { |
| 37 | this->command(static_cast<void *>(request.get()), static_cast<void *>(response.get())); |
| 38 | } |
| 39 | ); |
| 40 | } |
| 41 | |
| 42 | void Sound::command(const void * request, void * response) |
| 43 | { |