whisper_ros: whisper.cpp for ROS 2
Loading...
Searching...
No Matches
whisper_ros::WhisperServerNode Class Reference

#include <whisper_server_node.hpp>

Inheritance diagram for whisper_ros::WhisperServerNode:
Collaboration diagram for whisper_ros::WhisperServerNode:

Public Member Functions

 WhisperServerNode ()
 
void activate_ros_interfaces ()
 
void deactivate_ros_interfaces ()
 
- Public Member Functions inherited from whisper_ros::WhisperBaseNode
 WhisperBaseNode ()
 
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_configure (const rclcpp_lifecycle::State &)
 
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_activate (const rclcpp_lifecycle::State &)
 
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_deactivate (const rclcpp_lifecycle::State &)
 
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_cleanup (const rclcpp_lifecycle::State &)
 
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_shutdown (const rclcpp_lifecycle::State &)
 

Protected Member Functions

void enable_silero (bool enable)
 
- Protected Member Functions inherited from whisper_ros::WhisperBaseNode
whisper_msgs::msg::Transcription transcribe (const std::vector< float > &audio)
 

Private Types

using STT = whisper_msgs::action::STT
 
using GoalHandleSTT = rclcpp_action::ServerGoalHandle<STT>
 

Private Member Functions

void vad_callback (const std_msgs::msg::Float32MultiArray::SharedPtr msg)
 
void execute (const std::shared_ptr< GoalHandleSTT > goal_handle)
 
rclcpp_action::GoalResponse handle_goal (const rclcpp_action::GoalUUID &uuid, std::shared_ptr< const STT::Goal > goal)
 
rclcpp_action::CancelResponse handle_cancel (const std::shared_ptr< GoalHandleSTT > goal_handle)
 
void handle_accepted (const std::shared_ptr< GoalHandleSTT > goal_handle)
 

Private Attributes

whisper_msgs::msg::Transcription transcription_msg
 
std::mutex transcription_mutex
 
std::condition_variable transcription_cond
 
std::shared_ptr< GoalHandleSTTgoal_handle_
 
rclcpp::Subscription< std_msgs::msg::Float32MultiArray >::SharedPtr subscription_
 
rclcpp::Client< std_srvs::srv::SetBool >::SharedPtr enable_silero_client_
 
rclcpp_action::Server< STT >::SharedPtr action_server_
 

Additional Inherited Members

- Protected Attributes inherited from whisper_ros::WhisperBaseNode
std::string language
 
std::shared_ptr< Whisperwhisper
 

Member Typedef Documentation

◆ GoalHandleSTT

using whisper_ros::WhisperServerNode::GoalHandleSTT = rclcpp_action::ServerGoalHandle<STT>
private

◆ STT

using whisper_ros::WhisperServerNode::STT = whisper_msgs::action::STT
private

Constructor & Destructor Documentation

◆ WhisperServerNode()

WhisperServerNode::WhisperServerNode ( )

Member Function Documentation

◆ activate_ros_interfaces()

void WhisperServerNode::activate_ros_interfaces ( )
virtual

Reimplemented from whisper_ros::WhisperBaseNode.

◆ deactivate_ros_interfaces()

void WhisperServerNode::deactivate_ros_interfaces ( )
virtual

Reimplemented from whisper_ros::WhisperBaseNode.

◆ enable_silero()

void WhisperServerNode::enable_silero ( bool enable)
protected

◆ execute()

void WhisperServerNode::execute ( const std::shared_ptr< GoalHandleSTT > goal_handle)
private

◆ handle_accepted()

void WhisperServerNode::handle_accepted ( const std::shared_ptr< GoalHandleSTT > goal_handle)
private

◆ handle_cancel()

rclcpp_action::CancelResponse WhisperServerNode::handle_cancel ( const std::shared_ptr< GoalHandleSTT > goal_handle)
private

◆ handle_goal()

rclcpp_action::GoalResponse WhisperServerNode::handle_goal ( const rclcpp_action::GoalUUID & uuid,
std::shared_ptr< const STT::Goal > goal )
private

◆ vad_callback()

void WhisperServerNode::vad_callback ( const std_msgs::msg::Float32MultiArray::SharedPtr msg)
private

Member Data Documentation

◆ action_server_

rclcpp_action::Server<STT>::SharedPtr whisper_ros::WhisperServerNode::action_server_
private

◆ enable_silero_client_

rclcpp::Client<std_srvs::srv::SetBool>::SharedPtr whisper_ros::WhisperServerNode::enable_silero_client_
private

◆ goal_handle_

std::shared_ptr<GoalHandleSTT> whisper_ros::WhisperServerNode::goal_handle_
private

◆ subscription_

rclcpp::Subscription<std_msgs::msg::Float32MultiArray>::SharedPtr whisper_ros::WhisperServerNode::subscription_
private

◆ transcription_cond

std::condition_variable whisper_ros::WhisperServerNode::transcription_cond
private

◆ transcription_msg

whisper_msgs::msg::Transcription whisper_ros::WhisperServerNode::transcription_msg
private

◆ transcription_mutex

std::mutex whisper_ros::WhisperServerNode::transcription_mutex
private

The documentation for this class was generated from the following files: