From 9c55096a14cae14c76548f202a6edc152577ad79 Mon Sep 17 00:00:00 2001 From: Stefano Bernagozzi Date: Tue, 11 Jan 2022 14:16:58 +0100 Subject: [PATCH 1/4] updated correct timestamp GazeboYarpLaserSensorDriver --- plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h | 1 - plugins/lasersensor/src/LaserSensorDriver.cpp | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h b/plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h index 1efaca21d..bee7f11d1 100644 --- a/plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h +++ b/plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h @@ -83,7 +83,6 @@ class yarp::dev::GazeboYarpLaserSensorDriver: double m_gazebo_scan_rate; bool m_first_run; - yarp::os::Stamp m_lastTimestamp; //buffer for last timestamp data gazebo::sensors::RaySensor* m_parentSensor; gazebo::event::ConnectionPtr m_updateConnection; diff --git a/plugins/lasersensor/src/LaserSensorDriver.cpp b/plugins/lasersensor/src/LaserSensorDriver.cpp index d6addd594..5d10fc328 100644 --- a/plugins/lasersensor/src/LaserSensorDriver.cpp +++ b/plugins/lasersensor/src/LaserSensorDriver.cpp @@ -52,7 +52,8 @@ void GazeboYarpLaserSensorDriver::onUpdate(const gazebo::common::UpdateInfo& _in #endif this->applyLimitsOnLaserData(); - m_lastTimestamp.update(_info.simTime.Double()); + m_timestamp.update(_info.simTime.Double()); + m_first_run = false; return; } @@ -114,7 +115,7 @@ bool GazeboYarpLaserSensorDriver::acquireDataFromHW() //PRECISELY TIMED yarp::os::Stamp GazeboYarpLaserSensorDriver::getLastInputStamp() { - return m_lastTimestamp; + return m_timestamp; } bool GazeboYarpLaserSensorDriver::setDistanceRange (double min, double max) From 3630a4c20765b93455c388b8c0b7bd921eb6aaff Mon Sep 17 00:00:00 2001 From: Stefano Bernagozzi Date: Tue, 25 Jan 2022 11:38:10 +0100 Subject: [PATCH 2/4] removed ipreciselytimed from lasersensor --- plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h | 6 ------ plugins/lasersensor/src/LaserSensorDriver.cpp | 6 ------ 2 files changed, 12 deletions(-) diff --git a/plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h b/plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h index bee7f11d1..23fe3d584 100644 --- a/plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h +++ b/plugins/lasersensor/include/yarp/dev/LaserSensorDriver.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -64,11 +63,6 @@ class yarp::dev::GazeboYarpLaserSensorDriver: virtual bool setHorizontalResolution (double step) override; virtual bool setScanRate (double rate) override; - //PRECISELY TIMED - // TODO(traversaro): Remove once we require YARP 3.6 - // See https://github.com/robotology/gazebo-yarp-plugins/issues/598 - virtual yarp::os::Stamp getLastInputStamp(); - public: //Lidar2DDeviceBase bool acquireDataFromHW() override final; diff --git a/plugins/lasersensor/src/LaserSensorDriver.cpp b/plugins/lasersensor/src/LaserSensorDriver.cpp index 5d10fc328..85cf4f477 100644 --- a/plugins/lasersensor/src/LaserSensorDriver.cpp +++ b/plugins/lasersensor/src/LaserSensorDriver.cpp @@ -112,12 +112,6 @@ bool GazeboYarpLaserSensorDriver::acquireDataFromHW() return true; } -//PRECISELY TIMED -yarp::os::Stamp GazeboYarpLaserSensorDriver::getLastInputStamp() -{ - return m_timestamp; -} - bool GazeboYarpLaserSensorDriver::setDistanceRange (double min, double max) { std::lock_guard guard(m_mutex); From 7172678823c50c9d65b89c3eeffd92d486740ea2 Mon Sep 17 00:00:00 2001 From: Stefano Bernagozzi Date: Tue, 25 Jan 2022 16:14:22 +0100 Subject: [PATCH 3/4] added changelog and updated cmake to require yarp 3.6 --- CHANGELOG.md | 2 ++ CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e78c6683e..f1ef1c4d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format of this document is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Fixed +- Removed IPreciselyTimed from LaserSensorDriver and fixed bug in it (used the correct variable `m_timestamp` inherited from `yarp::dev::Lidar2DDeviceBase`) (https://github.com/robotology/gazebo-yarp-plugins/pull/604). ## [4.1.2] - 2022-01-19 diff --git a/CMakeLists.txt b/CMakeLists.txt index c981d9cf4..4ad9bf3a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ if(GAZEBO_YARP_PLUGINS_HAS_YARP_ROBOTINTERFACE) list(APPEND YARP_ADDITIONAL_COMPONENTS_REQUIRED "robotinterface") endif() -find_package(YARP 3.4.102 REQUIRED COMPONENTS os sig dev math idl_tools ${YARP_ADDITIONAL_COMPONENTS_REQUIRED}) +find_package(YARP 3.6 REQUIRED COMPONENTS os sig dev math idl_tools ${YARP_ADDITIONAL_COMPONENTS_REQUIRED}) find_package(Gazebo REQUIRED) if (Gazebo_VERSION_MAJOR LESS 11.0) message(status "Gazebo version : " ${Gazebo_VERSION_MAJOR}.${Gazebo_VERSION_MINOR}.${Gazebo_VERSION_PATCH}) From 861e4b7c12749311b378dd939d9e301b08521b0b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 25 Jan 2022 16:30:26 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1ef1c4d3..c850fa2ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file. The format of this document is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] + ### Fixed -- Removed IPreciselyTimed from LaserSensorDriver and fixed bug in it (used the correct variable `m_timestamp` inherited from `yarp::dev::Lidar2DDeviceBase`) (https://github.com/robotology/gazebo-yarp-plugins/pull/604). +- Removed `getLastInputStamp` method from `LaserSensorDriver` class in `gazebo_yarp_lasersensor`. Furthermore, fix bug in `gazebo_yarp_lasersensor`, by adding the update to the variable `m_timestamp` inherited from `yarp::dev::Lidar2DDeviceBase` (https://github.com/robotology/gazebo-yarp-plugins/pull/604). ## [4.1.2] - 2022-01-19