Acoustic Touch Recognition
Classes | Public Member Functions | Private Attributes | List of all members
AcousticTouchInterface Class Reference

This class describes an audio client. More...

#include <libacoustic_touch.h>

Inheritance diagram for AcousticTouchInterface:

Classes

class  ChucKPacketListener
 This nested class describes a chuck packet listener. A nested class is also a member variable of the enclosing class and has the same access rights as the other members. More...
 

Public Member Functions

 AcousticTouchInterface (string, bool)
 Initiatializes the clients, then has a different behavior depending on the mode selected. More...
 
 ~AcousticTouchInterface ()
 Destroy the Acoustic Touch Interface:: Acoustic Touch Interface object. More...
 
void oscCallback (int)
 This function is meant to be in a thread. It initializes the OSC protocol listeners and waits for messages to process. More...
 
void capacitiveCallback (const arduino_msgs::sensorStates::ConstPtr &)
 Receives and parses a ROS message containing the capacitive sensors' state. More...
 
void classifReadyCallback (const std_msgs::Empty::ConstPtr &)
 Changes once the classifier node has finished building its estimators. More...
 
void sendOscMsg (string, int)
 Sends an osc message to ALL ChucK nodes. More...
 
void loadSettings ()
 Loads settings and serves as a secondary initialization of attributes, after the constructor. More...
 
void showMenu ()
 Shows the main menu. More...
 
void setTrainLabels (string)
 Sets the service attributes. More...
 
void sendSrv ()
 Sends a service. More...
 
void shutDown ()
 Sends a shutdown signal to all the system. More...
 
vector< std::string > getShellOutput (const std::string)
 Returns the output of a shell command as a vector. More...
 

Private Attributes

ros::NodeHandle nh_
 
ros::AsyncSpinner aspin_
 
ros::Rate loop_rate_
 
ros::Subscriber capacitive_sub_
 
ros::Subscriber classif_ready_sub_
 
ros::Publisher gesture_end_pub_
 
ros::Publisher gesture_start_pub_
 
ros::Publisher loud_noise_pub_
 
ros::ServiceClient client_
 
acoustic_touch_recognition::MenuOptions srv_
 
string robot_
 
const string mode_
 
bool with_GUI_
 
int cap_state_
 
bool classif_state_
 
int mic_amount_
 
XmlRpc::XmlRpcValue mics_
 
XmlRpc::XmlRpcValue class_labels_
 
vector< string > label_names_
 
ChucKHandlerchuck_handler_
 
mutex osc_mutex_
 
vector< thread > osc_threads_
 
vector< IpEndpointNameip_endpoints_
 
vector< ChucKPacketListenerchuck_listeners_
 
vector< UdpListeningReceiveSocket * > udp_sockets_
 

Detailed Description

This class describes an audio client.

Constructor & Destructor Documentation

◆ AcousticTouchInterface()

AcousticTouchInterface::AcousticTouchInterface ( string  mde,
bool  withGUI 
)

Initiatializes the clients, then has a different behavior depending on the mode selected.

Parameters
[in]mdeThe mode of the system. Options are 'train', 'classify' or just 'touch_activity'.
[in]amountThe amount of microphones.
[in]withGUITo use or not Graphical interface to plot the features in real time.

◆ ~AcousticTouchInterface()

AcousticTouchInterface::~AcousticTouchInterface ( )

Destroy the Acoustic Touch Interface:: Acoustic Touch Interface object.

Member Function Documentation

◆ capacitiveCallback()

void AcousticTouchInterface::capacitiveCallback ( const arduino_msgs::sensorStates::ConstPtr &  msg)

Receives and parses a ROS message containing the capacitive sensors' state.

Parameters
[in]msgThe ROS message

◆ classifReadyCallback()

void AcousticTouchInterface::classifReadyCallback ( const std_msgs::Empty::ConstPtr &  msg)

Changes once the classifier node has finished building its estimators.

Parameters
msg

◆ getShellOutput()

vector< std::string > AcousticTouchInterface::getShellOutput ( const std::string  cmd)

Returns the output of a shell command as a vector.

Parameters
[in]cmdThe command
Returns
The shell output.

◆ loadSettings()

void AcousticTouchInterface::loadSettings ( )

Loads settings and serves as a secondary initialization of attributes, after the constructor.

◆ oscCallback()

void AcousticTouchInterface::oscCallback ( int  mic_num)

This function is meant to be in a thread. It initializes the OSC protocol listeners and waits for messages to process.

Parameters
[in]mic_numThe mic number

◆ sendOscMsg()

void AcousticTouchInterface::sendOscMsg ( string  address,
int  msg 
)

Sends an osc message to ALL ChucK nodes.

Parameters
[in]addressThe url address (e.g. "acoustic_touch/capacitive")
[in]msgAn integer containing the message

◆ sendSrv()

void AcousticTouchInterface::sendSrv ( )

Sends a service.

◆ setTrainLabels()

void AcousticTouchInterface::setTrainLabels ( string  label_name)

Sets the service attributes.

Parameters
[in]label_nameThe label name

◆ showMenu()

void AcousticTouchInterface::showMenu ( )

Shows the main menu.

◆ shutDown()

void AcousticTouchInterface::shutDown ( )

Sends a shutdown signal to all the system.

Member Data Documentation

◆ aspin_

ros::AsyncSpinner AcousticTouchInterface::aspin_
private

◆ cap_state_

int AcousticTouchInterface::cap_state_
private

◆ capacitive_sub_

ros::Subscriber AcousticTouchInterface::capacitive_sub_
private

◆ chuck_handler_

ChucKHandler* AcousticTouchInterface::chuck_handler_
private

◆ chuck_listeners_

vector<ChucKPacketListener> AcousticTouchInterface::chuck_listeners_
private

◆ class_labels_

XmlRpc::XmlRpcValue AcousticTouchInterface::class_labels_
private

◆ classif_ready_sub_

ros::Subscriber AcousticTouchInterface::classif_ready_sub_
private

◆ classif_state_

bool AcousticTouchInterface::classif_state_
private

◆ client_

ros::ServiceClient AcousticTouchInterface::client_
private

◆ gesture_end_pub_

ros::Publisher AcousticTouchInterface::gesture_end_pub_
private

◆ gesture_start_pub_

ros::Publisher AcousticTouchInterface::gesture_start_pub_
private

◆ ip_endpoints_

vector<IpEndpointName> AcousticTouchInterface::ip_endpoints_
private

◆ label_names_

vector<string> AcousticTouchInterface::label_names_
private

◆ loop_rate_

ros::Rate AcousticTouchInterface::loop_rate_
private

◆ loud_noise_pub_

ros::Publisher AcousticTouchInterface::loud_noise_pub_
private

◆ mic_amount_

int AcousticTouchInterface::mic_amount_
private

◆ mics_

XmlRpc::XmlRpcValue AcousticTouchInterface::mics_
private

◆ mode_

const string AcousticTouchInterface::mode_
private

◆ nh_

ros::NodeHandle AcousticTouchInterface::nh_
private

◆ osc_mutex_

mutex AcousticTouchInterface::osc_mutex_
private

◆ osc_threads_

vector<thread> AcousticTouchInterface::osc_threads_
private

◆ robot_

string AcousticTouchInterface::robot_
private

◆ srv_

acoustic_touch_recognition::MenuOptions AcousticTouchInterface::srv_
private

◆ udp_sockets_

vector<UdpListeningReceiveSocket*> AcousticTouchInterface::udp_sockets_
private

◆ with_GUI_

bool AcousticTouchInterface::with_GUI_
private

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