YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
AudioRecorder_nws_ros2.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_ROS2_AUDIORECORDER_NWS_ROS2_H
7#define YARP_ROS2_AUDIORECORDER_NWS_ROS2_H
8
9#include <rclcpp/rclcpp.hpp>
10#include <std_msgs/msg/int16_multi_array.hpp>
11
14#include <yarp/os/Stamp.h>
17
19
20#define DEFAULT_THREAD_PERIOD 0.02 //s
21
27{
28public:
31
32 // DeviceDriver
33 bool open(yarp::os::Searchable &params) override;
34 bool close() override;
35
36 // WrapperSingle
37 bool attach(yarp::dev::PolyDriver* driver) override;
38 bool detach() override;
39
40 // PeriodicThread
41 bool threadInit() override;
42 void threadRelease() override;
43 void run() override;
44
45
46private:
47 // stamp count for timestamp
48 yarp::os::Stamp m_timeStamp;
49
50 //ros2 node
51 rclcpp::Node::SharedPtr m_node;
52 rclcpp::Publisher<std_msgs::msg::Int16MultiArray>::SharedPtr m_ros2Publisher_status;
53
54 //interfaces
55 yarp::dev::PolyDriver m_driver;
56 yarp::dev::IAudioGrabberSound* m_audioRecorder_interface{nullptr};
57};
58
59#endif // YARP_ROS2_AUDIORECORDER_NWS_ROS2_H
This class is the parameters parser for class AudioRecorder_nws_ros2.
bool attach(yarp::dev::PolyDriver *driver) override
Attach to another object.
bool detach() override
Detach the object (you must have first called attach).
void run() override
Loop function.
bool open(yarp::os::Searchable &params) override
Open the DeviceDriver.
void threadRelease() override
Release method.
bool threadInit() override
Initialization method.
bool close() override
Close the DeviceDriver.
Interface implemented by all device drivers.
Read a YARP-format sound block from a device.
A container for a device driver.
Definition PolyDriver.h:23
Helper interface for an object that can wrap/or "attach" to a single other device.
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition Searchable.h:31
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:18