From a0c4c1792e1caa53fee2bf12fc166c49fe0557af Mon Sep 17 00:00:00 2001 From: Marco Randazzo Date: Tue, 3 Sep 2024 13:29:58 +0200 Subject: [PATCH] The following dataTypes have been migrated from yarp_dev to yarp_sig library: AudioPlayerStatus, AudioRecorderStatus, AudioBufferSize, AudioBufferSizeData, LaserMeasurementData, LaserScan2D. Interfaces and devices have been fixed accordingly. --- .../laserFromExternalPort.cpp | 6 ++-- .../laserFromExternalPort.h | 18 +++++----- .../laserFromPointCloud.cpp | 2 ++ src/devices/laserHokuyo/laserHokuyo.cpp | 1 + src/devices/laserHokuyo/laserHokuyo.h | 2 +- .../IAudioGrabberMsgs.thrift | 10 +++--- .../Rangefinder2DClient.cpp | 8 ++--- .../Rangefinder2DClient/Rangefinder2DClient.h | 14 ++++---- .../Rangefinder2D_nwc_yarp.cpp | 8 ++--- .../Rangefinder2D_nwc_yarp.h | 14 ++++---- .../Rangefinder2D_nws_yarp.cpp | 2 +- .../Rangefinder2D_nws_yarp.h | 4 +-- .../audioPlayerWrapper/AudioPlayerWrapper.cpp | 4 +-- .../audioPlayerWrapper/AudioPlayerWrapper.h | 4 +-- .../AudioRecorderWrapper.cpp | 8 ++--- .../AudioRecorder_nwc_yarp.cpp | 4 +-- .../AudioRecorder_nwc_yarp.h | 4 +-- .../AudioRecorder_nws_yarp.cpp | 8 ++--- src/libYARP_dev/src/CMakeLists.txt | 10 ++---- .../src/yarp/dev/AudioPlayerDeviceBase.cpp | 5 +-- .../src/yarp/dev/AudioPlayerDeviceBase.h | 4 +-- .../src/yarp/dev/AudioRecorderDeviceBase.cpp | 5 +-- .../src/yarp/dev/AudioRecorderDeviceBase.h | 4 +-- .../src/yarp/dev/CircularAudioBuffer.h | 12 +++---- .../src/yarp/dev/IAudioGrabberSound.h | 6 ++-- src/libYARP_dev/src/yarp/dev/IAudioRender.h | 6 ++-- src/libYARP_dev/src/yarp/dev/IRangefinder2D.h | 4 +-- .../src/yarp/dev/LaserMeasurementData.cpp | 34 ------------------ .../src/yarp/dev/LaserMeasurementData.h | 36 ------------------- .../src/yarp/dev/Lidar2DDeviceBase.cpp | 1 + .../src/yarp/dev/Lidar2DDeviceBase.h | 2 +- .../src/yarp/dev/tests/IRangefinder2DTest.h | 2 +- src/libYARP_sig/src/CMakeLists.txt | 36 +++++++++++++++++++ .../src/idl/AudioPlayerStatus.thrift | 6 ++-- .../src/idl/AudioRecorderStatus.thrift | 6 ++-- .../src/idl/LaserScan2D.thrift | 6 ++-- .../src/idl/audioBufferSizeData.thrift | 6 ++-- .../yarp/sig}/AudioPlayerStatus.cpp | 0 .../yarp/sig}/AudioPlayerStatus.h | 0 .../yarp/sig}/AudioPlayerStatus_common.h | 0 .../yarp/sig}/AudioRecorderStatus.cpp | 0 .../yarp/sig}/AudioRecorderStatus.h | 0 .../yarp/sig}/AudioRecorderStatus_common.h | 0 .../yarp/sig}/audioBufferSizeData.cpp | 0 .../yarp/sig}/audioBufferSizeData.h | 0 .../src/yarp/sig}/AudioBufferSize.cpp | 6 ++-- .../src/yarp/sig}/AudioBufferSize.h | 16 ++++----- src/yarplaserscannergui/main.cpp | 4 +-- 48 files changed, 152 insertions(+), 186 deletions(-) delete mode 100644 src/libYARP_dev/src/yarp/dev/LaserMeasurementData.cpp delete mode 100644 src/libYARP_dev/src/yarp/dev/LaserMeasurementData.h rename src/{libYARP_dev => libYARP_sig}/src/idl/AudioPlayerStatus.thrift (86%) rename src/{libYARP_dev => libYARP_sig}/src/idl/AudioRecorderStatus.thrift (86%) rename src/{libYARP_dev => libYARP_sig}/src/idl/LaserScan2D.thrift (90%) rename src/{libYARP_dev => libYARP_sig}/src/idl/audioBufferSizeData.thrift (70%) rename src/{libYARP_dev/src/idl_generated_code/yarp/dev => libYARP_sig/src/idl_generated_code/yarp/sig}/AudioPlayerStatus.cpp (100%) rename src/{libYARP_dev/src/idl_generated_code/yarp/dev => libYARP_sig/src/idl_generated_code/yarp/sig}/AudioPlayerStatus.h (100%) rename src/{libYARP_dev/src/idl_generated_code/yarp/dev => libYARP_sig/src/idl_generated_code/yarp/sig}/AudioPlayerStatus_common.h (100%) rename src/{libYARP_dev/src/idl_generated_code/yarp/dev => libYARP_sig/src/idl_generated_code/yarp/sig}/AudioRecorderStatus.cpp (100%) rename src/{libYARP_dev/src/idl_generated_code/yarp/dev => libYARP_sig/src/idl_generated_code/yarp/sig}/AudioRecorderStatus.h (100%) rename src/{libYARP_dev/src/idl_generated_code/yarp/dev => libYARP_sig/src/idl_generated_code/yarp/sig}/AudioRecorderStatus_common.h (100%) rename src/{libYARP_dev/src/idl_generated_code/yarp/dev => libYARP_sig/src/idl_generated_code/yarp/sig}/audioBufferSizeData.cpp (100%) rename src/{libYARP_dev/src/idl_generated_code/yarp/dev => libYARP_sig/src/idl_generated_code/yarp/sig}/audioBufferSizeData.h (100%) rename src/{libYARP_dev/src/yarp/dev => libYARP_sig/src/yarp/sig}/AudioBufferSize.cpp (67%) rename src/{libYARP_dev/src/yarp/dev => libYARP_sig/src/yarp/sig}/AudioBufferSize.h (81%) diff --git a/src/devices/laserFromExternalPort/laserFromExternalPort.cpp b/src/devices/laserFromExternalPort/laserFromExternalPort.cpp index e09ce94030d..e2e0a92477d 100644 --- a/src/devices/laserFromExternalPort/laserFromExternalPort.cpp +++ b/src/devices/laserFromExternalPort/laserFromExternalPort.cpp @@ -47,7 +47,7 @@ InputPortProcessor::InputPortProcessor() m_contains_data=false; } -void InputPortProcessor::onRead(yarp::dev::LaserScan2D& b) +void InputPortProcessor::onRead(yarp::sig::LaserScan2D& b) { m_port_mutex.lock(); m_lastScan = b; @@ -56,7 +56,7 @@ void InputPortProcessor::onRead(yarp::dev::LaserScan2D& b) m_port_mutex.unlock(); } -inline void InputPortProcessor::getLast(yarp::dev::LaserScan2D& data, Stamp& stmp) +inline void InputPortProcessor::getLast(yarp::sig::LaserScan2D& data, Stamp& stmp) { //this blocks untils the first data is received; size_t counter =0; @@ -292,7 +292,7 @@ bool LaserFromExternalPort::threadInit() return true; } -void LaserFromExternalPort::calculate(yarp::dev::LaserScan2D scan_data, yarp::sig::Matrix m) +void LaserFromExternalPort::calculate(yarp::sig::LaserScan2D scan_data, yarp::sig::Matrix m) { yarp::sig::Vector temp(3); temp = yarp::math::dcm2rpy(m); diff --git a/src/devices/laserFromExternalPort/laserFromExternalPort.h b/src/devices/laserFromExternalPort/laserFromExternalPort.h index 412401122cf..cbff397de11 100644 --- a/src/devices/laserFromExternalPort/laserFromExternalPort.h +++ b/src/devices/laserFromExternalPort/laserFromExternalPort.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -34,16 +34,16 @@ enum base_enum }; class InputPortProcessor : - public yarp::os::BufferedPort + public yarp::os::BufferedPort { std::mutex m_port_mutex; - yarp::dev::LaserScan2D m_lastScan; + yarp::sig::LaserScan2D m_lastScan; yarp::os::Stamp m_lastStamp; bool m_contains_data; public: InputPortProcessor(const InputPortProcessor& alt) : - yarp::os::BufferedPort(), + yarp::os::BufferedPort(), m_lastScan(alt.m_lastScan), m_lastStamp(alt.m_lastStamp), m_contains_data(alt.m_contains_data) @@ -51,9 +51,9 @@ class InputPortProcessor : } InputPortProcessor(); - using yarp::os::BufferedPort::onRead; - void onRead(yarp::dev::LaserScan2D& v) override; - void getLast(yarp::dev::LaserScan2D& data, yarp::os::Stamp& stmp); + using yarp::os::BufferedPort::onRead; + void onRead(yarp::sig::LaserScan2D& v) override; + void getLast(yarp::sig::LaserScan2D& data, yarp::os::Stamp& stmp); }; /** @@ -93,7 +93,7 @@ class LaserFromExternalPort : public yarp::dev::Lidar2DDeviceBase, std::vector m_port_names; std::vector m_input_ports; std::vector m_last_stamp; - std::vector m_last_scan_data; + std::vector m_last_scan_data; yarp::dev::PolyDriver m_tc_driver; yarp::dev::IFrameTransform* m_iTc = nullptr; @@ -102,7 +102,7 @@ class LaserFromExternalPort : public yarp::dev::Lidar2DDeviceBase, yarp::sig::Vector m_empty_laser_data; base_enum m_base_type; - void calculate(yarp::dev::LaserScan2D scan, yarp::sig::Matrix m); + void calculate(yarp::sig::LaserScan2D scan, yarp::sig::Matrix m); public: LaserFromExternalPort(double period = 0.01) : Lidar2DDeviceBase(), PeriodicThread(period) diff --git a/src/devices/laserFromPointCloud/laserFromPointCloud.cpp b/src/devices/laserFromPointCloud/laserFromPointCloud.cpp index a8aea827a06..848c558214e 100644 --- a/src/devices/laserFromPointCloud/laserFromPointCloud.cpp +++ b/src/devices/laserFromPointCloud/laserFromPointCloud.cpp @@ -25,6 +25,8 @@ #define DEG2RAD M_PI/180.0 #endif +using namespace yarp::sig; + YARP_LOG_COMPONENT(LASER_FROM_POINTCLOUD, "yarp.devices.laserFromPointCloud") /* diff --git a/src/devices/laserHokuyo/laserHokuyo.cpp b/src/devices/laserHokuyo/laserHokuyo.cpp index 7c03e52564f..63d2fb9cf34 100644 --- a/src/devices/laserHokuyo/laserHokuyo.cpp +++ b/src/devices/laserHokuyo/laserHokuyo.cpp @@ -21,6 +21,7 @@ #define DEG2RAD M_PI/180.0 #endif +using namespace yarp::sig; namespace { YARP_LOG_COMPONENT(LASERHOKUYO, "yarp.devices.laserHokuyo") diff --git a/src/devices/laserHokuyo/laserHokuyo.h b/src/devices/laserHokuyo/laserHokuyo.h index 74b7c96abdf..fd878a860e5 100644 --- a/src/devices/laserHokuyo/laserHokuyo.h +++ b/src/devices/laserHokuyo/laserHokuyo.h @@ -105,7 +105,7 @@ class laserHokuyo : public PeriodicThread, public yarp::dev::IRangefinder2D, pub public: //IRangefinder2D interface bool getRawData(yarp::sig::Vector &data, double* timestamp) override; - bool getLaserMeasurement(std::vector &data, double* timestamp) override; + bool getLaserMeasurement(std::vector &data, double* timestamp) override; bool getDeviceStatus (Device_status &status) override; bool getDeviceInfo (std::string &device_info) override; bool getDistanceRange (double& min, double& max) override; diff --git a/src/devices/messages/IAudioGrabberMsgs/IAudioGrabberMsgs.thrift b/src/devices/messages/IAudioGrabberMsgs/IAudioGrabberMsgs.thrift index f80ff96687f..1e80bc3e8a1 100644 --- a/src/devices/messages/IAudioGrabberMsgs/IAudioGrabberMsgs.thrift +++ b/src/devices/messages/IAudioGrabberMsgs/IAudioGrabberMsgs.thrift @@ -10,10 +10,10 @@ struct return_isRecording { 2: bool isRecording = false; } -struct yarp_dev_AudioBufferSize { +struct yarp_sig_AudioBufferSize { } ( - yarp.name = "yarp::dev::AudioBufferSize" - yarp.includefile = "yarp/dev/AudioBufferSize.h" + yarp.name = "yarp::sig::AudioBufferSize" + yarp.includefile = "yarp/sig/AudioBufferSize.h" ) struct yarp_sig_Sound { @@ -29,12 +29,12 @@ struct return_getSound { struct return_getRecordingAudioBufferCurrentSize { 1: bool ret = false; - 2: yarp_dev_AudioBufferSize bufsize; + 2: yarp_sig_AudioBufferSize bufsize; } struct return_getRecordingAudioBufferMaxSize { 1: bool ret = false; - 2: yarp_dev_AudioBufferSize bufsize; + 2: yarp_sig_AudioBufferSize bufsize; } typedef i32 ( yarp.type = "size_t" ) size_t diff --git a/src/devices/networkWrappers/Rangefinder2DClient/Rangefinder2DClient.cpp b/src/devices/networkWrappers/Rangefinder2DClient/Rangefinder2DClient.cpp index 785e4cc907b..7fd7951819f 100644 --- a/src/devices/networkWrappers/Rangefinder2DClient/Rangefinder2DClient.cpp +++ b/src/devices/networkWrappers/Rangefinder2DClient/Rangefinder2DClient.cpp @@ -48,7 +48,7 @@ Rangefinder2DInputPortProcessor::Rangefinder2DInputPortProcessor() resetStat(); } -void Rangefinder2DInputPortProcessor::onRead(yarp::dev::LaserScan2D&b) +void Rangefinder2DInputPortProcessor::onRead(yarp::sig::LaserScan2D& b) { now=SystemClock::nowSystem(); mutex.lock(); @@ -102,7 +102,7 @@ void Rangefinder2DInputPortProcessor::onRead(yarp::dev::LaserScan2D&b) mutex.unlock(); } -inline int Rangefinder2DInputPortProcessor::getLast(yarp::dev::LaserScan2D&data, Stamp &stmp) +inline int Rangefinder2DInputPortProcessor::getLast(yarp::sig::LaserScan2D& data, Stamp& stmp) { mutex.lock(); int ret=state; @@ -286,7 +286,7 @@ bool Rangefinder2DClient::close() bool Rangefinder2DClient::getRawData(yarp::sig::Vector &data, double* timestamp) { - yarp::dev::LaserScan2D scan; + yarp::sig::LaserScan2D scan; inputPort.getLast(scan, lastTs); data = scan.scans; @@ -300,7 +300,7 @@ bool Rangefinder2DClient::getRawData(yarp::sig::Vector &data, double* timestamp) bool Rangefinder2DClient::getLaserMeasurement(std::vector &data, double* timestamp) { - yarp::dev::LaserScan2D scan; + yarp::sig::LaserScan2D scan; inputPort.getLast(scan, lastTs); size_t size = scan.scans.size(); data.resize(size); diff --git a/src/devices/networkWrappers/Rangefinder2DClient/Rangefinder2DClient.h b/src/devices/networkWrappers/Rangefinder2DClient/Rangefinder2DClient.h index 64d86b306eb..2b8a3fd3477 100644 --- a/src/devices/networkWrappers/Rangefinder2DClient/Rangefinder2DClient.h +++ b/src/devices/networkWrappers/Rangefinder2DClient/Rangefinder2DClient.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -25,9 +25,9 @@ const int LASER_TIMEOUT=100; //ms class Rangefinder2DInputPortProcessor : - public yarp::os::BufferedPort + public yarp::os::BufferedPort { - yarp::dev::LaserScan2D lastScan; + yarp::sig::LaserScan2D lastScan; std::mutex mutex; yarp::os::Stamp lastStamp; double deltaT; @@ -45,10 +45,10 @@ class Rangefinder2DInputPortProcessor : Rangefinder2DInputPortProcessor(); - using yarp::os::BufferedPort::onRead; - void onRead(yarp::dev::LaserScan2D&v) override; + using yarp::os::BufferedPort::onRead; + void onRead(yarp::sig::LaserScan2D& v) override; - inline int getLast(yarp::dev::LaserScan2D &data, yarp::os::Stamp &stmp); + inline int getLast(yarp::sig::LaserScan2D& data, yarp::os::Stamp& stmp); inline int getIterations(); @@ -105,7 +105,7 @@ class Rangefinder2DClient: * @param data a vector containing the measurement data, expressed in cartesian/polar format * @return true/false.. */ - bool getLaserMeasurement(std::vector &data, double* timestamp = nullptr) override; + bool getLaserMeasurement(std::vector &data, double* timestamp = nullptr) override; /** * Get the device measurements diff --git a/src/devices/networkWrappers/Rangefinder2D_nwc_yarp/Rangefinder2D_nwc_yarp.cpp b/src/devices/networkWrappers/Rangefinder2D_nwc_yarp/Rangefinder2D_nwc_yarp.cpp index f5e1536009f..96c7a0bca86 100644 --- a/src/devices/networkWrappers/Rangefinder2D_nwc_yarp/Rangefinder2D_nwc_yarp.cpp +++ b/src/devices/networkWrappers/Rangefinder2D_nwc_yarp/Rangefinder2D_nwc_yarp.cpp @@ -49,7 +49,7 @@ Rangefinder2DInputPortProcessor::Rangefinder2DInputPortProcessor() resetStat(); } -void Rangefinder2DInputPortProcessor::onRead(yarp::dev::LaserScan2D&b) +void Rangefinder2DInputPortProcessor::onRead(yarp::sig::LaserScan2D& b) { now=SystemClock::nowSystem(); mutex.lock(); @@ -103,7 +103,7 @@ void Rangefinder2DInputPortProcessor::onRead(yarp::dev::LaserScan2D&b) mutex.unlock(); } -inline int Rangefinder2DInputPortProcessor::getLast(yarp::dev::LaserScan2D&data, Stamp &stmp) +inline int Rangefinder2DInputPortProcessor::getLast(yarp::sig::LaserScan2D& data, Stamp& stmp) { mutex.lock(); int ret=state; @@ -204,7 +204,7 @@ bool Rangefinder2D_nwc_yarp::close() bool Rangefinder2D_nwc_yarp::getRawData(yarp::sig::Vector &data, double* timestamp) { - yarp::dev::LaserScan2D scan; + yarp::sig::LaserScan2D scan; m_inputPort.getLast(scan, m_lastTs); data = scan.scans; @@ -218,7 +218,7 @@ bool Rangefinder2D_nwc_yarp::getRawData(yarp::sig::Vector &data, double* timesta bool Rangefinder2D_nwc_yarp::getLaserMeasurement(std::vector &data, double* timestamp) { - yarp::dev::LaserScan2D scan; + yarp::sig::LaserScan2D scan; m_inputPort.getLast(scan, m_lastTs); size_t size = scan.scans.size(); data.resize(size); diff --git a/src/devices/networkWrappers/Rangefinder2D_nwc_yarp/Rangefinder2D_nwc_yarp.h b/src/devices/networkWrappers/Rangefinder2D_nwc_yarp/Rangefinder2D_nwc_yarp.h index c2c7fb2f9c7..942a1c1f1f1 100644 --- a/src/devices/networkWrappers/Rangefinder2D_nwc_yarp/Rangefinder2D_nwc_yarp.h +++ b/src/devices/networkWrappers/Rangefinder2D_nwc_yarp/Rangefinder2D_nwc_yarp.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -23,9 +23,9 @@ #include "Rangefinder2D_nwc_yarp_ParamsParser.h" class Rangefinder2DInputPortProcessor : - public yarp::os::BufferedPort + public yarp::os::BufferedPort { - yarp::dev::LaserScan2D lastScan; + yarp::sig::LaserScan2D lastScan; std::mutex mutex; yarp::os::Stamp lastStamp; double deltaT; @@ -43,10 +43,10 @@ class Rangefinder2DInputPortProcessor : Rangefinder2DInputPortProcessor(); - using yarp::os::BufferedPort::onRead; - void onRead(yarp::dev::LaserScan2D&v) override; + using yarp::os::BufferedPort::onRead; + void onRead(yarp::sig::LaserScan2D& v) override; - inline int getLast(yarp::dev::LaserScan2D &data, yarp::os::Stamp &stmp); + inline int getLast(yarp::sig::LaserScan2D& data, yarp::os::Stamp& stmp); inline int getIterations(); @@ -87,7 +87,7 @@ class Rangefinder2D_nwc_yarp: bool close() override; /* IRangefinder2D methods */ - bool getLaserMeasurement(std::vector &data, double* timestamp = nullptr) override; + bool getLaserMeasurement(std::vector &data, double* timestamp = nullptr) override; bool getRawData(yarp::sig::Vector &data, double* timestamp = nullptr) override; bool getDeviceStatus(Device_status &status) override; bool getDistanceRange(double& min, double& max) override; diff --git a/src/devices/networkWrappers/Rangefinder2D_nws_yarp/Rangefinder2D_nws_yarp.cpp b/src/devices/networkWrappers/Rangefinder2D_nws_yarp/Rangefinder2D_nws_yarp.cpp index ac8b253b581..2a94392a8dd 100644 --- a/src/devices/networkWrappers/Rangefinder2D_nws_yarp/Rangefinder2D_nws_yarp.cpp +++ b/src/devices/networkWrappers/Rangefinder2D_nws_yarp/Rangefinder2D_nws_yarp.cpp @@ -339,7 +339,7 @@ void Rangefinder2D_nws_yarp::run() int ranges_size = ranges.size(); YARP_UNUSED(ranges_size); - yarp::dev::LaserScan2D& b = streamingPort.prepare(); + yarp::sig::LaserScan2D& b = streamingPort.prepare(); //b.clear(); b.scans=ranges; b.angle_min= minAngle; diff --git a/src/devices/networkWrappers/Rangefinder2D_nws_yarp/Rangefinder2D_nws_yarp.h b/src/devices/networkWrappers/Rangefinder2D_nws_yarp/Rangefinder2D_nws_yarp.h index 05e8844c657..003a0a2733d 100644 --- a/src/devices/networkWrappers/Rangefinder2D_nws_yarp/Rangefinder2D_nws_yarp.h +++ b/src/devices/networkWrappers/Rangefinder2D_nws_yarp/Rangefinder2D_nws_yarp.h @@ -25,7 +25,7 @@ #include -#include +#include #include #include #include @@ -70,7 +70,7 @@ class Rangefinder2D_nws_yarp : private: yarp::os::Port rpcPort; - yarp::os::BufferedPort streamingPort; + yarp::os::BufferedPort streamingPort; //interfaces yarp::dev::IRangefinder2D *sens_p; diff --git a/src/devices/networkWrappers/audioPlayerWrapper/AudioPlayerWrapper.cpp b/src/devices/networkWrappers/audioPlayerWrapper/AudioPlayerWrapper.cpp index 573716a7c96..7208a601141 100644 --- a/src/devices/networkWrappers/audioPlayerWrapper/AudioPlayerWrapper.cpp +++ b/src/devices/networkWrappers/audioPlayerWrapper/AudioPlayerWrapper.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -254,7 +254,7 @@ void AudioPlayerWrapper::run() m_irender->isPlaying(m_isPlaying); //status port - yarp::dev::AudioPlayerStatus status; + yarp::sig::AudioPlayerStatus status; status.enabled = m_isPlaying; status.current_buffer_size = m_current_buffer_size.getSamples(); status.max_buffer_size = m_max_buffer_size.getSamples(); diff --git a/src/devices/networkWrappers/audioPlayerWrapper/AudioPlayerWrapper.h b/src/devices/networkWrappers/audioPlayerWrapper/AudioPlayerWrapper.h index 874b3fd20d1..481b86d1a28 100644 --- a/src/devices/networkWrappers/audioPlayerWrapper/AudioPlayerWrapper.h +++ b/src/devices/networkWrappers/audioPlayerWrapper/AudioPlayerWrapper.h @@ -89,8 +89,8 @@ class AudioPlayerWrapper : yarp::dev::IAudioRender *m_irender = nullptr; yarp::os::Stamp m_lastStateStamp; - yarp::dev::AudioBufferSize m_current_buffer_size; - yarp::dev::AudioBufferSize m_max_buffer_size; + yarp::sig::AudioBufferSize m_current_buffer_size; + yarp::sig::AudioBufferSize m_max_buffer_size; std::queue m_sound_buffer; bool m_isPlaying = false; diff --git a/src/devices/networkWrappers/audioRecorderWrapper/AudioRecorderWrapper.cpp b/src/devices/networkWrappers/audioRecorderWrapper/AudioRecorderWrapper.cpp index 3ae0e61e1e7..7bbc4c3dc48 100644 --- a/src/devices/networkWrappers/audioRecorderWrapper/AudioRecorderWrapper.cpp +++ b/src/devices/networkWrappers/audioRecorderWrapper/AudioRecorderWrapper.cpp @@ -5,7 +5,7 @@ #include "AudioRecorderWrapper.h" #include -#include +#include using namespace yarp::dev; using namespace yarp::os; @@ -246,8 +246,8 @@ bool AudioRecorderWrapper::detach() void AudioRecorderStatusThread::run() { - yarp::dev::AudioBufferSize device_buffer_current_size; - yarp::dev::AudioBufferSize device_buffer_max_size; + yarp::sig::AudioBufferSize device_buffer_current_size; + yarp::sig::AudioBufferSize device_buffer_max_size; m_ARW->m_mic->getRecordingAudioBufferCurrentSize(device_buffer_current_size); m_ARW->m_mic->getRecordingAudioBufferMaxSize(device_buffer_max_size); @@ -265,7 +265,7 @@ void AudioRecorderStatusThread::run() m_ARW->m_mic->isRecording(m_ARW->m_isRecording); //status port - yarp::dev::AudioRecorderStatus status; + yarp::sig::AudioRecorderStatus status; status.enabled = m_ARW->m_isRecording; status.current_buffer_size = device_buffer_current_size.getSamples(); status.max_buffer_size = device_buffer_max_size.getSamples(); diff --git a/src/devices/networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.cpp b/src/devices/networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.cpp index b22f9478a04..b01ca22e55d 100644 --- a/src/devices/networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.cpp +++ b/src/devices/networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.cpp @@ -158,7 +158,7 @@ bool AudioRecorder_nwc_yarp::isRecording(bool& recording_enabled) return true; } -bool AudioRecorder_nwc_yarp::getRecordingAudioBufferMaxSize(yarp::dev::AudioBufferSize& size) +bool AudioRecorder_nwc_yarp::getRecordingAudioBufferMaxSize(yarp::sig::AudioBufferSize& size) { std::lock_guard lg(m_mutex); auto ret = m_audiograb_RPC.getRecordingAudioBufferMaxSize_RPC(); @@ -171,7 +171,7 @@ bool AudioRecorder_nwc_yarp::getRecordingAudioBufferMaxSize(yarp::dev::AudioBu return true; } -bool AudioRecorder_nwc_yarp::getRecordingAudioBufferCurrentSize(yarp::dev::AudioBufferSize& size) +bool AudioRecorder_nwc_yarp::getRecordingAudioBufferCurrentSize(yarp::sig::AudioBufferSize& size) { std::lock_guard lg(m_mutex); auto ret = m_audiograb_RPC.getRecordingAudioBufferCurrentSize_RPC(); diff --git a/src/devices/networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.h b/src/devices/networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.h index bd23cb771ee..718470829e3 100644 --- a/src/devices/networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.h +++ b/src/devices/networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.h @@ -67,8 +67,8 @@ class AudioRecorder_nwc_yarp : virtual bool startRecording() override; virtual bool stopRecording() override; virtual bool isRecording(bool& recording_enabled) override; - virtual bool getRecordingAudioBufferMaxSize(yarp::dev::AudioBufferSize& size) override; - virtual bool getRecordingAudioBufferCurrentSize(yarp::dev::AudioBufferSize& size) override; + virtual bool getRecordingAudioBufferMaxSize(yarp::sig::AudioBufferSize& size) override; + virtual bool getRecordingAudioBufferCurrentSize(yarp::sig::AudioBufferSize& size) override; virtual bool resetRecordingAudioBuffer() override; virtual bool setSWGain(double gain) override; virtual bool setHWGain(double gain) override; diff --git a/src/devices/networkWrappers/audioRecorder_nws_yarp/AudioRecorder_nws_yarp.cpp b/src/devices/networkWrappers/audioRecorder_nws_yarp/AudioRecorder_nws_yarp.cpp index 1d517efa0e7..7affc77e440 100644 --- a/src/devices/networkWrappers/audioRecorder_nws_yarp/AudioRecorder_nws_yarp.cpp +++ b/src/devices/networkWrappers/audioRecorder_nws_yarp/AudioRecorder_nws_yarp.cpp @@ -5,7 +5,7 @@ #include "AudioRecorder_nws_yarp.h" #include -#include +#include using namespace yarp::dev; using namespace yarp::os; @@ -144,8 +144,8 @@ bool AudioRecorder_nws_yarp::detach() void AudioRecorderStatusThread::run() { - yarp::dev::AudioBufferSize device_buffer_current_size; - yarp::dev::AudioBufferSize device_buffer_max_size; + yarp::sig::AudioBufferSize device_buffer_current_size; + yarp::sig::AudioBufferSize device_buffer_max_size; m_ARW->m_mic->getRecordingAudioBufferCurrentSize(device_buffer_current_size); m_ARW->m_mic->getRecordingAudioBufferMaxSize(device_buffer_max_size); @@ -164,7 +164,7 @@ void AudioRecorderStatusThread::run() m_ARW->m_mic->isRecording(isRecording); //status port - yarp::dev::AudioRecorderStatus status; + yarp::sig::AudioRecorderStatus status; status.enabled = isRecording; status.current_buffer_size = device_buffer_current_size.getSamples(); status.max_buffer_size = device_buffer_max_size.getSamples(); diff --git a/src/libYARP_dev/src/CMakeLists.txt b/src/libYARP_dev/src/CMakeLists.txt index 917b85c7a27..6156dce1610 100644 --- a/src/libYARP_dev/src/CMakeLists.txt +++ b/src/libYARP_dev/src/CMakeLists.txt @@ -8,7 +8,6 @@ add_library(YARP::YARP_dev ALIAS YARP_dev) set(YARP_dev_HDRS yarp/dev/all.h yarp/dev/api.h - yarp/dev/AudioBufferSize.h yarp/dev/AudioGrabberInterfaces.h yarp/dev/AudioGrabberVocabs.h yarp/dev/AudioPlayerDeviceBase.h @@ -108,7 +107,6 @@ set(YARP_dev_HDRS yarp/dev/ImplementTorqueControl.h yarp/dev/ImplementVelocityControl.h yarp/dev/ImplementVirtualAnalogSensor.h - yarp/dev/LaserMeasurementData.h yarp/dev/Lidar2DDeviceBase.h yarp/dev/MultipleAnalogSensorsInterfaces.h yarp/dev/PidEnums.h @@ -158,7 +156,6 @@ set(YARP_dev_IMPL_HDRS ) set(YARP_dev_SRCS - yarp/dev/AudioBufferSize.cpp yarp/dev/AudioPlayerDeviceBase.cpp yarp/dev/AudioRecorderDeviceBase.cpp yarp/dev/CanBusInterface.cpp @@ -220,7 +217,6 @@ set(YARP_dev_SRCS yarp/dev/ImplementTorqueControl.cpp yarp/dev/ImplementVelocityControl.cpp yarp/dev/ImplementVirtualAnalogSensor.cpp - yarp/dev/LaserMeasurementData.cpp yarp/dev/Lidar2DDeviceBase.cpp yarp/dev/MultipleAnalogSensorsInterfaces.cpp yarp/dev/PolyDriver.cpp @@ -262,13 +258,11 @@ include(YarpChooseIDL) set(YARP_dev_IDL idl/stateExt.thrift - idl/audioBufferSizeData.thrift + idl/OdometryData.thrift idl/OdometryData6D.thrift - idl/LaserScan2D.thrift idl/MobileBaseVelocity.thrift - idl/AudioPlayerStatus.thrift - idl/AudioRecorderStatus.thrift + idl/LLM_Message.thrift ) diff --git a/src/libYARP_dev/src/yarp/dev/AudioPlayerDeviceBase.cpp b/src/libYARP_dev/src/yarp/dev/AudioPlayerDeviceBase.cpp index bd89c7d6e2c..dde1ae8e22e 100644 --- a/src/libYARP_dev/src/yarp/dev/AudioPlayerDeviceBase.cpp +++ b/src/libYARP_dev/src/yarp/dev/AudioPlayerDeviceBase.cpp @@ -14,6 +14,7 @@ using namespace yarp::os; using namespace yarp::dev; +using namespace yarp::sig; constexpr double c_sleep_time=0.005; @@ -27,7 +28,7 @@ YARP_LOG_COMPONENT(AUDIOPLAYER_BASE, "yarp.devices.AudioPlayerDeviceBase") #define DEFAULT_NUM_CHANNELS (2) #define DEFAULT_SAMPLE_SIZE (2) -bool AudioPlayerDeviceBase::getPlaybackAudioBufferCurrentSize(yarp::dev::AudioBufferSize& size) +bool AudioPlayerDeviceBase::getPlaybackAudioBufferCurrentSize(yarp::sig::AudioBufferSize& size) { if (m_outputBuffer == nullptr) { @@ -39,7 +40,7 @@ bool AudioPlayerDeviceBase::getPlaybackAudioBufferCurrentSize(yarp::dev::AudioBu return true; } -bool AudioPlayerDeviceBase::getPlaybackAudioBufferMaxSize(yarp::dev::AudioBufferSize& size) +bool AudioPlayerDeviceBase::getPlaybackAudioBufferMaxSize(yarp::sig::AudioBufferSize& size) { if (m_outputBuffer == nullptr) { diff --git a/src/libYARP_dev/src/yarp/dev/AudioPlayerDeviceBase.h b/src/libYARP_dev/src/yarp/dev/AudioPlayerDeviceBase.h index e65014ed058..ff63e294b48 100644 --- a/src/libYARP_dev/src/yarp/dev/AudioPlayerDeviceBase.h +++ b/src/libYARP_dev/src/yarp/dev/AudioPlayerDeviceBase.h @@ -64,8 +64,8 @@ class YARP_dev_API AudioPlayerDeviceBase : public yarp::dev::IAudioRender virtual bool startPlayback() override; virtual bool stopPlayback() override; virtual bool isPlaying(bool& playback_enabled) override; - virtual bool getPlaybackAudioBufferMaxSize(yarp::dev::AudioBufferSize& size) override; - virtual bool getPlaybackAudioBufferCurrentSize(yarp::dev::AudioBufferSize& size) override; + virtual bool getPlaybackAudioBufferMaxSize(yarp::sig::AudioBufferSize& size) override; + virtual bool getPlaybackAudioBufferCurrentSize(yarp::sig::AudioBufferSize& size) override; virtual bool resetPlaybackAudioBuffer() override; virtual bool setSWGain(double gain) override; diff --git a/src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.cpp b/src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.cpp index 047626df993..5499143c79b 100644 --- a/src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.cpp +++ b/src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.cpp @@ -11,6 +11,7 @@ using namespace yarp::os; using namespace yarp::dev; +using namespace yarp::sig; constexpr double c_sleep_time=0.005; @@ -122,7 +123,7 @@ bool AudioRecorderDeviceBase::getSound(yarp::sig::Sound& sound, size_t min_numbe return true; } -bool AudioRecorderDeviceBase::getRecordingAudioBufferMaxSize(yarp::dev::AudioBufferSize& size) +bool AudioRecorderDeviceBase::getRecordingAudioBufferMaxSize(yarp::sig::AudioBufferSize& size) { if (m_inputBuffer == nullptr) { @@ -135,7 +136,7 @@ bool AudioRecorderDeviceBase::getRecordingAudioBufferMaxSize(yarp::dev::AudioBuf } -bool AudioRecorderDeviceBase::getRecordingAudioBufferCurrentSize(yarp::dev::AudioBufferSize& size) +bool AudioRecorderDeviceBase::getRecordingAudioBufferCurrentSize(yarp::sig::AudioBufferSize& size) { if (m_inputBuffer == nullptr) { diff --git a/src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.h b/src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.h index 8a5c6c63c6b..12cf5030970 100644 --- a/src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.h +++ b/src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.h @@ -61,8 +61,8 @@ class YARP_dev_API AudioRecorderDeviceBase : public yarp::dev::IAudioGrabberSoun virtual bool startRecording() override; virtual bool stopRecording() override; virtual bool isRecording(bool& recording_enabled) override; - virtual bool getRecordingAudioBufferMaxSize(yarp::dev::AudioBufferSize& size) override; - virtual bool getRecordingAudioBufferCurrentSize(yarp::dev::AudioBufferSize& size) override; + virtual bool getRecordingAudioBufferMaxSize(yarp::sig::AudioBufferSize& size) override; + virtual bool getRecordingAudioBufferCurrentSize(yarp::sig::AudioBufferSize& size) override; virtual bool resetRecordingAudioBuffer() override; virtual bool setSWGain(double gain) override; diff --git a/src/libYARP_dev/src/yarp/dev/CircularAudioBuffer.h b/src/libYARP_dev/src/yarp/dev/CircularAudioBuffer.h index d1523235593..ceab0d1cd92 100644 --- a/src/libYARP_dev/src/yarp/dev/CircularAudioBuffer.h +++ b/src/libYARP_dev/src/yarp/dev/CircularAudioBuffer.h @@ -7,7 +7,7 @@ #define YARP_DEV_CIRCULARAUDIOBUFFER_H #include -#include +#include #include #include @@ -20,7 +20,7 @@ template class CircularAudioBuffer { std::string name; - yarp::dev::AudioBufferSize maxsize; + yarp::sig::AudioBufferSize maxsize; size_t start; size_t end; SAMPLE *elems=nullptr; @@ -52,7 +52,7 @@ class CircularAudioBuffer } } - AudioBufferSize size() + yarp::sig::AudioBufferSize size() { size_t i; if (end > start) { @@ -62,7 +62,7 @@ class CircularAudioBuffer } else { i = maxsize.getBufferElements() - start + end; } - return AudioBufferSize(i/maxsize.getChannels(), maxsize.getChannels(), sizeof(SAMPLE)); + return yarp::sig::AudioBufferSize(i/maxsize.getChannels(), maxsize.getChannels(), sizeof(SAMPLE)); } SAMPLE read() @@ -76,7 +76,7 @@ class CircularAudioBuffer return elem; } - yarp::dev::AudioBufferSize getMaxSize() + yarp::sig::AudioBufferSize getMaxSize() { return maxsize; } @@ -87,7 +87,7 @@ class CircularAudioBuffer end = 0; } - CircularAudioBuffer(std::string buffer_name, yarp::dev::AudioBufferSize bufferSize) : + CircularAudioBuffer(std::string buffer_name, yarp::sig::AudioBufferSize bufferSize) : name{buffer_name}, maxsize{bufferSize}, start{0}, diff --git a/src/libYARP_dev/src/yarp/dev/IAudioGrabberSound.h b/src/libYARP_dev/src/yarp/dev/IAudioGrabberSound.h index 5ad5bca53ad..7d494675987 100644 --- a/src/libYARP_dev/src/yarp/dev/IAudioGrabberSound.h +++ b/src/libYARP_dev/src/yarp/dev/IAudioGrabberSound.h @@ -8,7 +8,7 @@ #define YARP_DEV_IAUDIOGRABBERSOUND_H #include -#include +#include #include namespace yarp::dev { @@ -61,9 +61,9 @@ class YARP_dev_API IAudioGrabberSound */ virtual bool isRecording(bool& recording_enabled) = 0; - virtual bool getRecordingAudioBufferMaxSize(yarp::dev::AudioBufferSize& size) = 0; + virtual bool getRecordingAudioBufferMaxSize(yarp::sig::AudioBufferSize& size) = 0; - virtual bool getRecordingAudioBufferCurrentSize(yarp::dev::AudioBufferSize& size) = 0; + virtual bool getRecordingAudioBufferCurrentSize(yarp::sig::AudioBufferSize& size) = 0; virtual bool resetRecordingAudioBuffer() = 0; diff --git a/src/libYARP_dev/src/yarp/dev/IAudioRender.h b/src/libYARP_dev/src/yarp/dev/IAudioRender.h index 8d53f75879e..ae35d1b3418 100644 --- a/src/libYARP_dev/src/yarp/dev/IAudioRender.h +++ b/src/libYARP_dev/src/yarp/dev/IAudioRender.h @@ -9,7 +9,7 @@ #include #include -#include +#include namespace yarp::dev { @@ -56,9 +56,9 @@ class YARP_dev_API IAudioRender */ virtual bool isPlaying(bool& playback_enabled) = 0; - virtual bool getPlaybackAudioBufferMaxSize(yarp::dev::AudioBufferSize& size) = 0; + virtual bool getPlaybackAudioBufferMaxSize(yarp::sig::AudioBufferSize& size) = 0; - virtual bool getPlaybackAudioBufferCurrentSize(yarp::dev::AudioBufferSize& size) = 0; + virtual bool getPlaybackAudioBufferCurrentSize(yarp::sig::AudioBufferSize& size) = 0; virtual bool resetPlaybackAudioBuffer() = 0; diff --git a/src/libYARP_dev/src/yarp/dev/IRangefinder2D.h b/src/libYARP_dev/src/yarp/dev/IRangefinder2D.h index 2cb85ab1a7a..798f31f7293 100644 --- a/src/libYARP_dev/src/yarp/dev/IRangefinder2D.h +++ b/src/libYARP_dev/src/yarp/dev/IRangefinder2D.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include @@ -48,7 +48,7 @@ class YARP_dev_API yarp::dev::IRangefinder2D * @param timestamp the timestamp of the retrieved data. * @return true/false */ - virtual bool getLaserMeasurement(std::vector &data, double* timestamp = nullptr) = 0; + virtual bool getLaserMeasurement(std::vector &data, double* timestamp = nullptr) = 0; /** * Get the device measurements diff --git a/src/libYARP_dev/src/yarp/dev/LaserMeasurementData.cpp b/src/libYARP_dev/src/yarp/dev/LaserMeasurementData.cpp deleted file mode 100644 index 3c17f7a4953..00000000000 --- a/src/libYARP_dev/src/yarp/dev/LaserMeasurementData.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include -#include - -using namespace yarp::dev; - -LaserMeasurementData::LaserMeasurementData() -{ - stored_x = stored_y = stored_angle = stored_distance = 0; -} - -void LaserMeasurementData::set_cartesian(const double x, const double y) -{ - stored_x = x; stored_y = y; stored_distance = sqrt(x*x + y*y); stored_angle = atan2(y, x); -} - -void LaserMeasurementData::set_polar(const double rho, const double theta) -{ - stored_angle = theta; stored_distance = rho; stored_y = rho*sin(theta); stored_x = rho*cos(theta); -} - -void LaserMeasurementData::get_cartesian(double& x, double& y) -{ - x = stored_x; y = stored_y; -} - -void LaserMeasurementData::get_polar(double& rho, double& theta) -{ - rho = stored_distance; theta = stored_angle; -} diff --git a/src/libYARP_dev/src/yarp/dev/LaserMeasurementData.h b/src/libYARP_dev/src/yarp/dev/LaserMeasurementData.h deleted file mode 100644 index 881eb0d927c..00000000000 --- a/src/libYARP_dev/src/yarp/dev/LaserMeasurementData.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef YARP_DEV_LASERMEASURMENTDATA_H -#define YARP_DEV_LASERMEASURMENTDATA_H - -#include - -/*! - * \file LaserMeasurementData.h - */ - -namespace yarp::dev { -class LaserMeasurementData; -} - -/*! - * \LaserMeasurementData - */ -class YARP_dev_API yarp::dev::LaserMeasurementData -{ - double stored_x; - double stored_y; - double stored_angle; - double stored_distance; -public: - LaserMeasurementData(); - void set_cartesian(const double x, const double y); - void set_polar(const double rho, const double theta); - void get_cartesian(double& x, double& y); - void get_polar(double& rho, double& theta); -}; - -#endif // YARP_DEV_LASERMEASURMENTDATA_H diff --git a/src/libYARP_dev/src/yarp/dev/Lidar2DDeviceBase.cpp b/src/libYARP_dev/src/yarp/dev/Lidar2DDeviceBase.cpp index 5719340939a..5646c06df46 100644 --- a/src/libYARP_dev/src/yarp/dev/Lidar2DDeviceBase.cpp +++ b/src/libYARP_dev/src/yarp/dev/Lidar2DDeviceBase.cpp @@ -13,6 +13,7 @@ using namespace yarp::os; using namespace yarp::dev; +using namespace yarp::sig; #ifndef DEG2RAD #define DEG2RAD M_PI/180.0 diff --git a/src/libYARP_dev/src/yarp/dev/Lidar2DDeviceBase.h b/src/libYARP_dev/src/yarp/dev/Lidar2DDeviceBase.h index 849faf0ff3e..e7cc81323f7 100644 --- a/src/libYARP_dev/src/yarp/dev/Lidar2DDeviceBase.h +++ b/src/libYARP_dev/src/yarp/dev/Lidar2DDeviceBase.h @@ -91,7 +91,7 @@ class YARP_dev_API Lidar2DDeviceBase: public yarp::dev::IRangefinder2D public: //IRangefinder2D interface bool getRawData(yarp::sig::Vector& data, double* timestamp = nullptr) override; - bool getLaserMeasurement(std::vector& data, double* timestamp = nullptr) override; + bool getLaserMeasurement(std::vector& data, double* timestamp = nullptr) override; bool getDeviceStatus(Device_status& status) override; bool getDeviceInfo(std::string& device_info) override; bool getDistanceRange(double& min, double& max) override; diff --git a/src/libYARP_dev/src/yarp/dev/tests/IRangefinder2DTest.h b/src/libYARP_dev/src/yarp/dev/tests/IRangefinder2DTest.h index 15563f08424..18ccb1c2e49 100644 --- a/src/libYARP_dev/src/yarp/dev/tests/IRangefinder2DTest.h +++ b/src/libYARP_dev/src/yarp/dev/tests/IRangefinder2DTest.h @@ -52,7 +52,7 @@ namespace yarp::dev::tests CHECK(min == 0.1); CHECK(max == 8.0); - std::vector las; + std::vector las; double timestamp; b = irf->getLaserMeasurement(las, ×tamp); CHECK(b); diff --git a/src/libYARP_sig/src/CMakeLists.txt b/src/libYARP_sig/src/CMakeLists.txt index 88693784d2e..779cc0b89a5 100644 --- a/src/libYARP_sig/src/CMakeLists.txt +++ b/src/libYARP_sig/src/CMakeLists.txt @@ -9,12 +9,14 @@ add_library(YARP::YARP_sig ALIAS YARP_sig) set(YARP_sig_HDRS yarp/sig/all.h yarp/sig/api.h + yarp/sig/AudioBufferSize.h yarp/sig/Image.h yarp/sig/ImageDraw.h yarp/sig/ImageFile.h yarp/sig/ImageNetworkHeader.h yarp/sig/ImageUtils.h yarp/sig/IntrinsicParams.h + yarp/sig/LaserMeasurementData.h yarp/sig/Matrix.h yarp/sig/PointCloud.h yarp/sig/PointCloudBase.h @@ -37,11 +39,13 @@ if(NOT YARP_NO_DEPRECATED) # Since YARP 3.0.0 endif() set(YARP_sig_SRCS + yarp/sig/AudioBufferSize.cpp yarp/sig/Image.cpp yarp/sig/Image.copyPixels.cpp yarp/sig/ImageFile.cpp yarp/sig/ImageUtils.cpp yarp/sig/IntrinsicParams.cpp + yarp/sig/LaserMeasurementData.cpp yarp/sig/Matrix.cpp yarp/sig/PointCloudBase.cpp yarp/sig/PointCloudUtils.cpp @@ -62,6 +66,31 @@ set(YARP_sig_IMPL_SRCS yarp/sig/impl/DeBayer.cpp yarp/sig/impl/IplImage.cpp ) +# Handle the YARP thrift messages +include(YarpChooseIDL) + +set(YARP_sig_IDL + idl/audioBufferSizeData.thrift + idl/audioBufferSizeData.thrift + idl/AudioPlayerStatus.thrift + idl/AudioRecorderStatus.thrift + idl/LaserScan2D.thrift + +) + +yarp_choose_idl(YARP_sig_idl ${YARP_sig_IDL}) + +unset(YARP_sig_idl_HDRS) +unset(YARP_sig_idl_IMPL_HDRS) +foreach(_f IN LISTS YARP_sig_idl_GEN_FILES) + if("${_f}" MATCHES "\\.h$") + if ("${_f}" MATCHES "yarp/sig" AND NOT "${_f}" MATCHES "yarp/sig/impl") + list(APPEND YARP_sig_idl_HDRS "${_f}") + else() + list(APPEND YARP_sig_idl_IMPL_HDRS ${_f}) + endif() + endif() +endforeach() source_group( TREE "${CMAKE_CURRENT_SOURCE_DIR}" @@ -77,6 +106,11 @@ source_group( ${YARP_sig_HDRS} ${YARP_sig_IMPL_HDRS} ) +source_group( + TREE "${YARP_sig_idl_BUILD_INTERFACE_INCLUDE_DIRS}" + PREFIX "Generated Files" + FILES ${YARP_sig_idl_GEN_FILES} +) target_sources(YARP_sig PRIVATE @@ -84,11 +118,13 @@ target_sources(YARP_sig ${YARP_sig_HDRS} ${YARP_sig_IMPL_SRCS} ${YARP_sig_IMPL_HDRS} + ${YARP_sig_idl_GEN_FILES} ) target_include_directories(YARP_sig PUBLIC $ + $ $ ) target_compile_features(YARP_sig PUBLIC cxx_std_17) diff --git a/src/libYARP_dev/src/idl/AudioPlayerStatus.thrift b/src/libYARP_sig/src/idl/AudioPlayerStatus.thrift similarity index 86% rename from src/libYARP_dev/src/idl/AudioPlayerStatus.thrift rename to src/libYARP_sig/src/idl/AudioPlayerStatus.thrift index 91a9a0a4148..52ae81ab015 100644 --- a/src/libYARP_dev/src/idl/AudioPlayerStatus.thrift +++ b/src/libYARP_sig/src/idl/AudioPlayerStatus.thrift @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -namespace yarp yarp.dev +namespace yarp yarp.sig typedef i32 ( yarp.type = "size_t" ) size_t @@ -23,6 +23,6 @@ struct AudioPlayerStatus 3: size_t max_buffer_size; } ( - yarp.api.include = "yarp/dev/api.h" - yarp.api.keyword = "YARP_dev_API" + yarp.api.include = "yarp/sig/api.h" + yarp.api.keyword = "YARP_sig_API" ) diff --git a/src/libYARP_dev/src/idl/AudioRecorderStatus.thrift b/src/libYARP_sig/src/idl/AudioRecorderStatus.thrift similarity index 86% rename from src/libYARP_dev/src/idl/AudioRecorderStatus.thrift rename to src/libYARP_sig/src/idl/AudioRecorderStatus.thrift index 14f4b51a330..eb6808d57bf 100644 --- a/src/libYARP_dev/src/idl/AudioRecorderStatus.thrift +++ b/src/libYARP_sig/src/idl/AudioRecorderStatus.thrift @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -namespace yarp yarp.dev +namespace yarp yarp.sig typedef i32 ( yarp.type = "size_t" ) size_t @@ -23,6 +23,6 @@ struct AudioRecorderStatus 3: size_t max_buffer_size; } ( - yarp.api.include = "yarp/dev/api.h" - yarp.api.keyword = "YARP_dev_API" + yarp.api.include = "yarp/sig/api.h" + yarp.api.keyword = "YARP_sig_API" ) diff --git a/src/libYARP_dev/src/idl/LaserScan2D.thrift b/src/libYARP_sig/src/idl/LaserScan2D.thrift similarity index 90% rename from src/libYARP_dev/src/idl/LaserScan2D.thrift rename to src/libYARP_sig/src/idl/LaserScan2D.thrift index 9d50ded0614..32e45087462 100644 --- a/src/libYARP_dev/src/idl/LaserScan2D.thrift +++ b/src/libYARP_sig/src/idl/LaserScan2D.thrift @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -namespace yarp yarp.dev +namespace yarp yarp.sig struct YarpVector { 1: list content; @@ -33,6 +33,6 @@ struct LaserScan2D 6: i32 status=3; } ( - yarp.api.include = "yarp/dev/api.h" - yarp.api.keyword = "YARP_dev_API" + yarp.api.include = "yarp/sig/api.h" + yarp.api.keyword = "YARP_sig_API" ) diff --git a/src/libYARP_dev/src/idl/audioBufferSizeData.thrift b/src/libYARP_sig/src/idl/audioBufferSizeData.thrift similarity index 70% rename from src/libYARP_dev/src/idl/audioBufferSizeData.thrift rename to src/libYARP_sig/src/idl/audioBufferSizeData.thrift index ea905c7c421..78a3f9c4995 100644 --- a/src/libYARP_dev/src/idl/audioBufferSizeData.thrift +++ b/src/libYARP_sig/src/idl/audioBufferSizeData.thrift @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -namespace yarp yarp.dev +namespace yarp yarp.sig struct audioBufferSizeData { @@ -12,6 +12,6 @@ struct audioBufferSizeData 3: i32 m_depth; 4: i32 size; } ( - yarp.api.include = "yarp/dev/api.h" - yarp.api.keyword = "YARP_dev_API" + yarp.api.include = "yarp/sig/api.h" + yarp.api.keyword = "YARP_sig_API" ) diff --git a/src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioPlayerStatus.cpp b/src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioPlayerStatus.cpp similarity index 100% rename from src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioPlayerStatus.cpp rename to src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioPlayerStatus.cpp diff --git a/src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioPlayerStatus.h b/src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioPlayerStatus.h similarity index 100% rename from src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioPlayerStatus.h rename to src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioPlayerStatus.h diff --git a/src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioPlayerStatus_common.h b/src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioPlayerStatus_common.h similarity index 100% rename from src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioPlayerStatus_common.h rename to src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioPlayerStatus_common.h diff --git a/src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioRecorderStatus.cpp b/src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioRecorderStatus.cpp similarity index 100% rename from src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioRecorderStatus.cpp rename to src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioRecorderStatus.cpp diff --git a/src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioRecorderStatus.h b/src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioRecorderStatus.h similarity index 100% rename from src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioRecorderStatus.h rename to src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioRecorderStatus.h diff --git a/src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioRecorderStatus_common.h b/src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioRecorderStatus_common.h similarity index 100% rename from src/libYARP_dev/src/idl_generated_code/yarp/dev/AudioRecorderStatus_common.h rename to src/libYARP_sig/src/idl_generated_code/yarp/sig/AudioRecorderStatus_common.h diff --git a/src/libYARP_dev/src/idl_generated_code/yarp/dev/audioBufferSizeData.cpp b/src/libYARP_sig/src/idl_generated_code/yarp/sig/audioBufferSizeData.cpp similarity index 100% rename from src/libYARP_dev/src/idl_generated_code/yarp/dev/audioBufferSizeData.cpp rename to src/libYARP_sig/src/idl_generated_code/yarp/sig/audioBufferSizeData.cpp diff --git a/src/libYARP_dev/src/idl_generated_code/yarp/dev/audioBufferSizeData.h b/src/libYARP_sig/src/idl_generated_code/yarp/sig/audioBufferSizeData.h similarity index 100% rename from src/libYARP_dev/src/idl_generated_code/yarp/dev/audioBufferSizeData.h rename to src/libYARP_sig/src/idl_generated_code/yarp/sig/audioBufferSizeData.h diff --git a/src/libYARP_dev/src/yarp/dev/AudioBufferSize.cpp b/src/libYARP_sig/src/yarp/sig/AudioBufferSize.cpp similarity index 67% rename from src/libYARP_dev/src/yarp/dev/AudioBufferSize.cpp rename to src/libYARP_sig/src/yarp/sig/AudioBufferSize.cpp index 821205bb630..2c6588c79c8 100644 --- a/src/libYARP_dev/src/yarp/dev/AudioBufferSize.cpp +++ b/src/libYARP_sig/src/yarp/sig/AudioBufferSize.cpp @@ -3,11 +3,11 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include +#include -yarp::dev::AudioBufferSize::AudioBufferSize() = default; +yarp::sig::AudioBufferSize::AudioBufferSize() = default; -yarp::dev::AudioBufferSize::AudioBufferSize(size_t samples, size_t channels, size_t depth_in_bytes) +yarp::sig::AudioBufferSize::AudioBufferSize(size_t samples, size_t channels, size_t depth_in_bytes) { this->m_data.m_samples=samples; this->m_data.m_channels = channels; diff --git a/src/libYARP_dev/src/yarp/dev/AudioBufferSize.h b/src/libYARP_sig/src/yarp/sig/AudioBufferSize.h similarity index 81% rename from src/libYARP_dev/src/yarp/dev/AudioBufferSize.h rename to src/libYARP_sig/src/yarp/sig/AudioBufferSize.h index 0789976d7e8..edc74218500 100644 --- a/src/libYARP_dev/src/yarp/dev/AudioBufferSize.h +++ b/src/libYARP_sig/src/yarp/sig/AudioBufferSize.h @@ -3,21 +3,21 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef YARP_DEV_AUDIOBUFFERSIZE_H -#define YARP_DEV_AUDIOBUFFERSIZE_H +#ifndef YARP_SIG_AUDIOBUFFERSIZE_H +#define YARP_SIG_AUDIOBUFFERSIZE_H #include #include #include -#include -#include +#include +#include -namespace yarp::dev { +namespace yarp::sig { template class CircularAudioBuffer; -class YARP_dev_API AudioBufferSize : +class YARP_sig_API AudioBufferSize : public yarp::os::idl::WirePortable { private: @@ -39,6 +39,6 @@ class YARP_dev_API AudioBufferSize : AudioBufferSize(size_t samples, size_t channels, size_t depth_in_bytes); }; -} // namespace yarp::dev +} // namespace yarp::sig -#endif // YARP_DEV_AUDIOBUFFERSIZE_H +#endif // YARP_SIG_AUDIOBUFFERSIZE_H diff --git a/src/yarplaserscannergui/main.cpp b/src/yarplaserscannergui/main.cpp index 620b0af1fa1..51bd74923db 100644 --- a/src/yarplaserscannergui/main.cpp +++ b/src/yarplaserscannergui/main.cpp @@ -203,7 +203,7 @@ void drawNav(const yarp::os::Bottle *display, IplImage *img, double scale) cvCircle(img,cvPoint(img->width/2,img->height/2),(int)(max_obs_dist*scale-1),color_black); } -void drawLaser(const Vector *comp, std::vector *las, std::vector *lmap, IplImage *img, double angle_tot, int scans, double sens_position_x, double sens_position_y, double sens_position_t, double scale, bool absolute, bool verbose, int aspect) +void drawLaser(const Vector *comp, std::vector *las, std::vector *lmap, IplImage *img, double angle_tot, int scans, double sens_position_x, double sens_position_y, double sens_position_t, double scale, bool absolute, bool verbose, int aspect) { cvZero(img); cvRectangle(img, cvPoint(0, 0), cvPoint(img->width, img->height), cvScalar(255, 0, 0), -1); @@ -429,7 +429,7 @@ int main(int argc, char *argv[]) double angle_tot = (angle_max - angle_min); iLas->getHorizontalResolution(angle_step); int scans = (int)(angle_tot / angle_step); - std::vector laser_data; + std::vector laser_data; BufferedPort laserMapInPort; laserMapInPort.open(laser_map_port_name);