Skip to content

Commit 538cb09

Browse files
authored
Merge branch 'main' into feature/cpu-lidar
2 parents 0c40b53 + 50e14bd commit 538cb09

File tree

10 files changed

+56
-16
lines changed

10 files changed

+56
-16
lines changed

.github/ci/packages.apt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
libgz-cmake5-dev
2-
libgz-common7-dev
3-
libgz-math9-dev
4-
libgz-msgs12-dev
5-
libgz-rendering10-dev
6-
libgz-tools2-dev
7-
libgz-transport15-dev
8-
libsdformat16-dev
1+
libgz-rotary-cmake-dev
2+
libgz-rotary-common-dev
3+
libgz-rotary-math-dev
4+
libgz-rotary-msgs-dev
5+
libgz-rotary-rendering-dev
6+
libgz-rotary-tools-dev
7+
libgz-rotary-transport-dev
8+
libgz-rotary-sdformat-dev
99
xvfb

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
id: ci
2020
uses: gazebo-tooling/action-gz-ci@noble
2121
with:
22+
gzdev-project-name: rotary
2223
# codecov-enabled: true
2324
cppcheck-enabled: true
2425
cpplint-enabled: true

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
33
#============================================================================
44
# Initialize the project
55
#============================================================================
6-
project(gz-sensors VERSION 10.0.0)
6+
project(gz-sensors VERSION 11.0.0)
77

88
#============================================================================
99
# Find gz-cmake

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Gazebo Sensors 11.x
2+
3+
### Gazebo Sensors 11.0.0 (20XX-XX-XX)
4+
15
## Gazebo Sensors 10
26

37
### Gazebo Sensors 10.0.0 (2025-09-30)

Migration.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Deprecated code produces compile-time warnings. These warning serve as
55
notification to users that their code should be upgraded. The next major
66
release will remove the deprecated code.
77

8+
9+
## Gz Sensors 10.X to 11.X
10+
11+
812
## Gazebo Sensors 6.X to 7.X
913

1014
1. The `ignition` namespace is deprecated and will be removed in future versions. Use `gz` instead.
@@ -136,4 +140,4 @@ ImageNoise.hh.
136140

137141
1. **include/sensors/Noise.hh**
138142
+ ***Deprecation:*** public: virtual void SetCamera(rendering::CameraPtr)
139-
+ ***Replacement:*** TODO (to be implemented in ImageGaussianNoiseModel)
143+
+ ***Replacement:*** TODO (to be implemented in ImageGaussianNoiseModel)

package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="2">
44
<name>gz-sensors</name>
5-
<version>10.0.0</version>
5+
<version>11.0.0</version>
66
<description>Gazebo Sensors : Sensor models for simulation</description>
77
<maintainer email="ichen@openrobotics.org">Ian Chen</maintainer>
88
<license>Apache License 2.0</license>

src/ThermalCameraSensor.cc

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#include "gz/sensors/ThermalCameraSensor.hh"
3535
#include "gz/sensors/ImageGaussianNoiseModel.hh"
36+
#include "gz/sensors/ImageNoise.hh"
3637
#include "gz/sensors/RenderingEvents.hh"
3738
#include "gz/sensors/SensorFactory.hh"
3839

@@ -319,12 +320,20 @@ bool ThermalCameraSensor::CreateCamera()
319320
// Add gaussian noise to camera sensor
320321
if (noiseSdf.Type() == sdf::NoiseType::GAUSSIAN)
321322
{
322-
this->dataPtr->noises[noiseType] =
323-
NoiseFactory::NewNoiseModel(noiseSdf, "camera");
323+
// Skip applying noise if mean and stddev are 0 - this avoids
324+
// doing an extra render pass in gz-rendering
325+
// Note ImageGaussianNoiseModel only uses mean and stddev and does not
326+
// use bias parameters.
327+
if (!math::equal(noiseSdf.Mean(), 0.0) ||
328+
!math::equal(noiseSdf.StdDev(), 0.0))
329+
{
330+
this->dataPtr->noises[noiseType] =
331+
ImageNoiseFactory::NewNoiseModel(noiseSdf, "thermal_camera");
324332

325-
std::dynamic_pointer_cast<ImageGaussianNoiseModel>(
326-
this->dataPtr->noises[noiseType])->SetCamera(
327-
this->dataPtr->thermalCamera);
333+
std::dynamic_pointer_cast<ImageGaussianNoiseModel>(
334+
this->dataPtr->noises[noiseType])->SetCamera(
335+
this->dataPtr->thermalCamera);
336+
}
328337
}
329338
else if (noiseSdf.Type() != sdf::NoiseType::NONE)
330339
{

test/integration/thermal_camera.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ void ThermalCameraSensorTest::ImagesWithBuiltinSDF(
132132
auto imagePtr = cameraPtr->GetElement("image");
133133
ASSERT_TRUE(cameraPtr->HasElement("clip"));
134134
auto clipPtr = cameraPtr->GetElement("clip");
135+
ASSERT_TRUE(cameraPtr->HasElement("noise"));
136+
auto noisePtr = cameraPtr->GetElement("noise");
137+
138+
EXPECT_EQ("gaussian", noisePtr->Get<std::string>("type"));
139+
EXPECT_FLOAT_EQ(0.0, noisePtr->Get<double>("mean"));
140+
EXPECT_DOUBLE_EQ(0.007, noisePtr->Get<double>("stddev"));
135141

136142
int imgWidth = imagePtr->Get<int>("width");
137143
int imgHeight = imagePtr->Get<int>("height");
@@ -392,6 +398,12 @@ void ThermalCameraSensorTest::Images8BitWithBuiltinSDF(
392398
auto cameraPtr = sensorPtr->GetElement("camera");
393399
ASSERT_TRUE(cameraPtr->HasElement("image"));
394400
auto imagePtr = cameraPtr->GetElement("image");
401+
ASSERT_TRUE(cameraPtr->HasElement("noise"));
402+
auto noisePtr = cameraPtr->GetElement("noise");
403+
404+
EXPECT_EQ("gaussian", noisePtr->Get<std::string>("type"));
405+
EXPECT_FLOAT_EQ(0.0, noisePtr->Get<double>("mean"));
406+
EXPECT_DOUBLE_EQ(0.007, noisePtr->Get<double>("stddev"));
395407

396408
std::string format = imagePtr->Get<std::string>("format");
397409
EXPECT_EQ("L8", format);

test/sdf/thermal_camera_sensor_8bit_builtin.sdf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
<near>0.1</near>
1717
<far>10.0</far>
1818
</clip>
19+
<noise>
20+
<type>gaussian</type>
21+
<mean>0.0</mean>
22+
<stddev>0.007</stddev>
23+
</noise>
1924
</camera>
2025
</sensor>
2126
</link>

test/sdf/thermal_camera_sensor_builtin.sdf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
<near>0.1</near>
1717
<far>10.0</far>
1818
</clip>
19+
<noise>
20+
<type>gaussian</type>
21+
<mean>0.0</mean>
22+
<stddev>0.007</stddev>
23+
</noise>
1924
</camera>
2025
</sensor>
2126
</link>

0 commit comments

Comments
 (0)