From 44c67b08bb4b5c44cff91501de9a23d659af985c Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Fri, 21 Jul 2023 02:16:55 -0600 Subject: [PATCH 1/5] Fix CameraSensor to check if element is null before access (#361) * Fix CameraSensor to check if element is null before access Signed-off-by: Levi Armstrong --- src/CameraSensor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CameraSensor.cc b/src/CameraSensor.cc index e8f99e76..173f2aaf 100644 --- a/src/CameraSensor.cc +++ b/src/CameraSensor.cc @@ -257,7 +257,8 @@ bool CameraSensor::CreateCamera() this->dataPtr->camera->SetAspectRatio(static_cast(width)/height); this->dataPtr->camera->SetHFOV(angle); - if (cameraSdf->Element()->HasElement("distortion")) { + if (cameraSdf->Element() != nullptr && + cameraSdf->Element()->HasElement("distortion")) { this->dataPtr->distortion = ImageDistortionFactory::NewDistortionModel(*cameraSdf, "camera"); this->dataPtr->distortion->Load(*cameraSdf); From 4300c17d47a4eeef9083ae2f8e49d7e8ad8294bf Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Tue, 25 Jul 2023 17:03:44 -0500 Subject: [PATCH 2/5] Expose optical frame in CameraSensor so it can be set in DepthCameraSensor (#362) Signed-off-by: Levi Armstrong --- include/gz/sensors/CameraSensor.hh | 4 ++++ src/CameraSensor.cc | 6 ++++++ src/DepthCameraSensor.cc | 26 +++++++++++++++----------- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/include/gz/sensors/CameraSensor.hh b/include/gz/sensors/CameraSensor.hh index aae0ad45..b4939f7a 100644 --- a/include/gz/sensors/CameraSensor.hh +++ b/include/gz/sensors/CameraSensor.hh @@ -146,6 +146,10 @@ namespace gz /// \todo(iche033) Make this function virtual on Harmonic public: bool HasInfoConnections() const; + /// \brief Get the camera optical frame + /// \return The camera optical frame + public: const std::string& OpticalFrameId() const; + /// \brief Advertise camera info topic. /// \return True if successful. protected: bool AdvertiseInfo(); diff --git a/src/CameraSensor.cc b/src/CameraSensor.cc index 173f2aaf..140d162d 100644 --- a/src/CameraSensor.cc +++ b/src/CameraSensor.cc @@ -921,6 +921,12 @@ bool CameraSensor::HasInfoConnections() const return this->dataPtr->infoPub && this->dataPtr->infoPub.HasConnections(); } +////////////////////////////////////////////////// +const std::string& CameraSensor::OpticalFrameId() const +{ + return this->dataPtr->opticalFrameId; +} + ////////////////////////////////////////////////// math::Matrix4d CameraSensorPrivate::BuildProjectionMatrix( double _imageWidth, double _imageHeight, diff --git a/src/DepthCameraSensor.cc b/src/DepthCameraSensor.cc index e295d0e5..f965e18e 100644 --- a/src/DepthCameraSensor.cc +++ b/src/DepthCameraSensor.cc @@ -299,15 +299,6 @@ bool DepthCameraSensor::Load(const sdf::Sensor &_sdf) gzdbg << "Points for [" << this->Name() << "] advertised on [" << this->Topic() << "/points]" << std::endl; - // Initialize the point message. - // \todo(anyone) The true value in the following function call forces - // the xyz and rgb fields to be aligned to memory boundaries. This is need - // by ROS1: https://github.com/ros/common_msgs/pull/77. Ideally, memory - // alignment should be configured. - msgs::InitPointCloudPacked(this->dataPtr->pointMsg, this->FrameId(), true, - {{"xyz", msgs::PointCloudPacked::Field::FLOAT32}, - {"rgb", msgs::PointCloudPacked::Field::FLOAT32}}); - if (this->Scene()) { this->CreateCamera(); @@ -422,6 +413,18 @@ bool DepthCameraSensor::CreateCamera() std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); + // Initialize the point message. + // \todo(anyone) The true value in the following function call forces + // the xyz and rgb fields to be aligned to memory boundaries. This is need + // by ROS1: https://github.com/ros/common_msgs/pull/77. Ideally, memory + // alignment should be configured. + msgs::InitPointCloudPacked( + this->dataPtr->pointMsg, + this->OpticalFrameId(), + true, + {{"xyz", msgs::PointCloudPacked::Field::FLOAT32}, + {"rgb", msgs::PointCloudPacked::Field::FLOAT32}}); + // Set the values of the point message based on the camera information. this->dataPtr->pointMsg.set_width(this->ImageWidth()); this->dataPtr->pointMsg.set_height(this->ImageHeight()); @@ -549,9 +552,10 @@ bool DepthCameraSensor::Update( rendering::PF_FLOAT32_R)); msg.set_pixel_format_type(msgsFormat); *msg.mutable_header()->mutable_stamp() = msgs::Convert(_now); - auto frame = msg.mutable_header()->add_data(); + + auto* frame = msg.mutable_header()->add_data(); frame->set_key("frame_id"); - frame->add_value(this->FrameId()); + frame->add_value(this->OpticalFrameId()); std::lock_guard lock(this->dataPtr->mutex); msg.set_data(this->dataPtr->depthBuffer, From 4881904675898c16180c1b1fbe62de1b88dc2805 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 1 Aug 2023 16:26:12 -0500 Subject: [PATCH 3/5] Fix Github project automation for new project board (#371) Signed-off-by: Addisu Z. Taddese --- .github/workflows/triage.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 736670e0..152404be 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -1,7 +1,7 @@ on: issues: types: [opened] - pull_request_target: + pull_request: types: [opened] name: Ticket opened jobs: @@ -10,10 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Add ticket to inbox - uses: technote-space/create-project-card-action@v1 + uses: actions/add-to-project@v0.5.0 with: - PROJECT: Core development - COLUMN: Inbox - GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }} - CHECK_ORG_PROJECT: true + project-url: https://github.com/orgs/gazebosim/projects/7 + github-token: ${{ secrets.TRIAGE_TOKEN }} From 7b4387fc64b12f72a39e7c7efafcbc8cc4230766 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Wed, 2 Aug 2023 15:49:30 -0500 Subject: [PATCH 4/5] Use `pull_request_target` for triage workflow (#372) Signed-off-by: Addisu Z. Taddese --- .github/workflows/triage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 152404be..2c94852d 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -1,7 +1,7 @@ on: issues: types: [opened] - pull_request: + pull_request_target: types: [opened] name: Ticket opened jobs: From ec52913e608ce8f64053650bfcced84a70ca12e2 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 26 Sep 2023 08:55:04 -0500 Subject: [PATCH 5/5] 7.3.0 release (#386) Signed-off-by: Addisu Z. Taddese --- CMakeLists.txt | 2 +- Changelog.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4f27393..34b1c6b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) #============================================================================ # Initialize the project #============================================================================ -project(gz-sensors7 VERSION 7.2.0) +project(gz-sensors7 VERSION 7.3.0) #============================================================================ # Find gz-cmake diff --git a/Changelog.md b/Changelog.md index dc0d1bfc..abcbdf53 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,38 @@ ### Gazebo Sensors 7.X.X +### Gazebo Sensors 7.3.0 (2023-09-26) + +1. Infrastructure + * [Pull request #372](https://github.com/gazebosim/gz-sensors/pull/372) + * [Pull request #371](https://github.com/gazebosim/gz-sensors/pull/371) + +1. Expose optical frame in CameraSensor so it can be set in DepthCameraSensor + * [Pull request #362](https://github.com/gazebosim/gz-sensors/pull/362) + +1. Fix CameraSensor to check if element is null before access + * [Pull request #361](https://github.com/gazebosim/gz-sensors/pull/361) + +1. Support protobuf >= 22 + * [Pull request #351](https://github.com/gazebosim/gz-sensors/pull/351) + +1. Minor cleanup - lint, typos + * [Pull request #352](https://github.com/gazebosim/gz-sensors/pull/352) + * [Pull request #344](https://github.com/gazebosim/gz-sensors/pull/344) + +1. Fix frame_id for depth camera point cloud + * [Pull request #350](https://github.com/gazebosim/gz-sensors/pull/350) + +1. Add support for bayer images to camera sensor + * [Pull request #336](https://github.com/gazebosim/gz-sensors/pull/336) + +1. Fix flaky trigger camera test + * [Pull request #346](https://github.com/gazebosim/gz-sensors/pull/346) + +1. Generate default trigger topic name if empty + * [Pull request #343](https://github.com/gazebosim/gz-sensors/pull/343) + + ### Gazebo Sensors 7.2.0 (2023-04-13) 1. Cleanup resources in CameraSensor destructor