Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 8 -> main #418

Merged
merged 23 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3ace7ae
Support protobuf >= 22 (#351)
traversaro Jun 10, 2023
577b03e
Prepare for 6.7.1 release (#376)
azeey Sep 1, 2023
8741b9b
[backport fortress] camera info topic published with the right data (…
ahcorde Oct 6, 2023
86c3e19
Destroy rendering sensors when sensor is removed (#169)
iche033 Nov 12, 2021
6b8b570
clean up rendering resources (#324)
iche033 Feb 23, 2023
3e16fd9
Merge branch 'ign-sensors3' into scpeters/merge_3_6
scpeters Oct 16, 2023
f188748
Merge pull request #398 from gazebosim/scpeters/merge_3_6
iche033 Oct 17, 2023
67b5b6e
Update github action workflows (#401)
azeey Nov 13, 2023
83ccf19
Merge remote-tracking branch 'origin/ign-sensors3' into azeey/3_to_6
azeey Nov 14, 2023
0ddddae
port: 3 to 6 (#402)
mjcarroll Nov 14, 2023
8637766
Update CI badges in README (#405)
iche033 Dec 20, 2023
d522779
Update CI badges to point to release branch job (#406)
iche033 Dec 21, 2023
b7148d6
Prepare for 3.6.0 release (#407)
iche033 Jan 5, 2024
ff5bbb1
Allow specifying gz_frame_id as an alternative to ignition_frame_id (…
azeey Jan 12, 2024
9b4d0a0
Merge 3 to 6
azeey Jan 12, 2024
2e9a20c
Merge pull request #410 from azeey/3_to_6
azeey Jan 12, 2024
6d1f163
Prepare for 6.8.0 (#411)
azeey Jan 12, 2024
8f6bce6
Merge 6 into 7
azeey Jan 18, 2024
37db629
Merge pull request #412 from azeey/6_to_7
azeey Jan 19, 2024
c082434
DepthCamera and RGBDCamera - optimize RGB point cloud connection (#413)
iche033 Jan 26, 2024
a1e068e
Merge branch 'gz-sensors7' into 7_to_8
caguero Jan 26, 2024
403fb63
Merge pull request #414 from gazebosim/7_to_8
iche033 Jan 29, 2024
941d070
Merge branch 'gz-sensors8' into merge_8_main_20240314
iche033 Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Ubuntu CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- 'ign-sensors[0-9]'
- 'gz-sensors[0-9]?'
- 'main'

jobs:
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
with:
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

59 changes: 59 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,40 @@

## Gazebo Sensors 6

### Gazebo Sensors 6.8.0 (2024-01-12)

1. Allow specifying gz_frame_id as an alternative to ignition_frame_id
* [Pull request #409](https://github.com/gazebosim/gz-sensors/pull/409)

1. [backport fortress] camera info topic published with the right data
* [Pull request #383](https://github.com/gazebosim/gz-sensors/pull/383)

1. Infrastructure
* [Pull request #401](https://github.com/gazebosim/gz-sensors/pull/401)

### Gazebo Sensors 6.7.1 (2023-09-01)

1. Support protobuf >= 22
* [Pull request #351](https://github.com/gazebosim/gz-sensors/pull/351)

1. Infrastructure
* [Pull request #335](https://github.com/gazebosim/gz-sensors/pull/335)

1. Rename COPYING to LICENSE
* [Pull request #334](https://github.com/gazebosim/gz-sensors/pull/334)

1. Fix links in Changelog
* [Pull request #330](https://github.com/gazebosim/gz-sensors/pull/330)

1. Fix Camera info test
* [Pull request #326](https://github.com/gazebosim/gz-sensors/pull/326)

1. clean up rendering resources
* [Pull request #324](https://github.com/gazebosim/gz-sensors/pull/324)

1. Added Camera Info topic support for cameras
* [Pull request #285](https://github.com/gazebosim/gz-sensors/pull/285)

### Gazebo Sensors 6.7.0 (2023-02-13)

1. Disable thermal camera test on MacOS.
Expand Down Expand Up @@ -536,6 +570,31 @@

## Gazebo Sensors 3

### Gazebo Sensors 3.6.0 (2024-01-05)

1. Update github action workflows
* [Pull request #401](https://github.com/gazebosim/gz-sensors/pull/401)
* [Pull request #335](https://github.com/gazebosim/gz-sensors/pull/335)
* [Pull request #334](https://github.com/gazebosim/gz-sensors/pull/334)

1. Clean up rendering resources
* [Pull request #324](https://github.com/gazebosim/gz-sensors/pull/324)

1. Destroy rendering sensors when sensor is removed
* [Pull request #169](https://github.com/gazebosim/gz-sensors/pull/169)

1. Support protobuf >= 22
* [Pull request #351](https://github.com/gazebosim/gz-sensors/pull/351)

1. Fix links in Changelog
* [Pull request #330](https://github.com/gazebosim/gz-sensors/pull/330)

1. Fix Camera info test
* [Pull request #326](https://github.com/gazebosim/gz-sensors/pull/326)

1. Added Camera Info topic support for cameras
* [Pull request #285](https://github.com/gazebosim/gz-sensors/pull/285)

### Gazebo Sensors 3.5.0 (2022-11-30)

1. Add missing DEPENDS_ON_COMPONENTS parameters.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

Build | Status
-- | --
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-sensors/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-sensors/branch/main)
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-sensors/tree/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-sensors/tree/main)
Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_sensors-ci-main-jammy-amd64)](https://build.osrfoundation.org/job/gz_sensors-ci-main-jammy-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_sensors-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_sensors-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/ign_sensors-ci-win/badge/icon)](https://build.osrfoundation.org/job/ign_sensors-ci-win/)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_sensors-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/gz_sensors-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/gz_sensors-main-win/badge/icon)](https://build.osrfoundation.org/job/gz_sensors-main-win/)

Gazebo Sensors, a component of [Gazebo](https://gazebosim.org),
provides numerous sensor models
Expand Down
2 changes: 1 addition & 1 deletion src/CameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "gz/sensors/SensorFactory.hh"
#include "gz/sensors/SensorTypes.hh"

#include "gz/rendering/Utils.hh"
#include <gz/rendering/Utils.hh>

using namespace gz;
using namespace sensors;
Expand Down
19 changes: 13 additions & 6 deletions src/DepthCameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,6 @@
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
std::placeholders::_4, std::placeholders::_5));

this->dataPtr->pointCloudConnection =
this->dataPtr->depthCamera->ConnectNewRgbPointCloud(
std::bind(&DepthCameraSensor::OnNewRgbPointCloud, this,
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
Expand Down Expand Up @@ -609,6 +603,19 @@
return false;
}

if (this->HasPointConnections() && !this->dataPtr->pointCloudConnection)
{
this->dataPtr->pointCloudConnection =
this->dataPtr->depthCamera->ConnectNewRgbPointCloud(
std::bind(&DepthCameraSensor::OnNewRgbPointCloud, this,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
std::placeholders::_4, std::placeholders::_5));
}
else if (!this->HasPointConnections() && this->dataPtr->pointCloudConnection)
{
this->dataPtr->pointCloudConnection.reset();

Check warning on line 616 in src/DepthCameraSensor.cc

View check run for this annotation

Codecov / codecov/patch

src/DepthCameraSensor.cc#L616

Added line #L616 was not covered by tests
}

// generate sensor data
this->Render();

Expand Down
23 changes: 16 additions & 7 deletions src/RgbdCameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,6 @@
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
std::placeholders::_4, std::placeholders::_5));

this->dataPtr->pointCloudConnection =
this->dataPtr->depthCamera->ConnectNewRgbPointCloud(
std::bind(&RgbdCameraSensorPrivate::OnNewRgbPointCloud,
this->dataPtr.get(),
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
std::placeholders::_4, std::placeholders::_5));

// 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());
Expand Down Expand Up @@ -545,6 +538,22 @@
return false;
}

if ((this->HasPointConnections() || HasColorConnections()) &&
!this->dataPtr->pointCloudConnection)
{
this->dataPtr->pointCloudConnection =
this->dataPtr->depthCamera->ConnectNewRgbPointCloud(
std::bind(&RgbdCameraSensorPrivate::OnNewRgbPointCloud,

Check warning on line 546 in src/RgbdCameraSensor.cc

View check run for this annotation

Codecov / codecov/patch

src/RgbdCameraSensor.cc#L546

Added line #L546 was not covered by tests
this->dataPtr.get(),
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
std::placeholders::_4, std::placeholders::_5));
}
else if (!this->HasPointConnections() && !this->HasColorConnections() &&
this->dataPtr->pointCloudConnection)

Check warning on line 552 in src/RgbdCameraSensor.cc

View check run for this annotation

Codecov / codecov/patch

src/RgbdCameraSensor.cc#L552

Added line #L552 was not covered by tests
{
this->dataPtr->pointCloudConnection.reset();

Check warning on line 554 in src/RgbdCameraSensor.cc

View check run for this annotation

Codecov / codecov/patch

src/RgbdCameraSensor.cc#L554

Added line #L554 was not covered by tests
}

unsigned int width = this->dataPtr->depthCamera->ImageWidth();
unsigned int height = this->dataPtr->depthCamera->ImageHeight();
unsigned int depthSamples = height * width;
Expand Down
49 changes: 49 additions & 0 deletions src/Sensor_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,55 @@ TEST(Sensor_TEST, SetRateZeroService)
EXPECT_FLOAT_EQ(20.0, sensor.UpdateRate());
}

//////////////////////////////////////////////////
TEST(Sensor_TEST, FrameIdFromSdf)
{
auto loadSensorWithSdfParam =
[](TestSensor &_testSensor, const std::string &_sensorParam)
{
const std::string sensorSdf = R"(
<sdf version="1.9">
<model name="m1">
<link name="link1">
<sensor name="test" type="imu">)" +
_sensorParam + R"(
</sensor>
</link>
</model>
</sdf>
)";
sdf::Root root;
sdf::Errors errors = root.LoadSdfString(sensorSdf);
ASSERT_TRUE(errors.empty()) << errors;
auto *model = root.Model();
ASSERT_NE(model, nullptr);
auto *link = model->LinkByIndex(0);
ASSERT_NE(link, nullptr);
auto *sensor = link->SensorByIndex(0);
ASSERT_NE(sensor, nullptr);

_testSensor.Load(*sensor);
};

{
TestSensor testSensor;
loadSensorWithSdfParam(testSensor, "");
EXPECT_EQ("test", testSensor.FrameId());
}
{
TestSensor testSensor;
loadSensorWithSdfParam(testSensor,
"<gz_frame_id>custom_frame_id</gz_frame_id>");
EXPECT_EQ("custom_frame_id", testSensor.FrameId());
}
{
TestSensor testSensor;
loadSensorWithSdfParam(testSensor, R"(
<ignition_frame_id>custom_frame_id</ignition_frame_id>
<gz_frame_id>other_custom_frame_id</gz_frame_id>)");
EXPECT_EQ("other_custom_frame_id", testSensor.FrameId());
}
}
//////////////////////////////////////////////////
TEST_F(SensorUpdate, NextDataUpdateTime)
{
Expand Down
2 changes: 2 additions & 0 deletions test/integration/camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@

#include <gz/msgs/camera_info.pb.h>
#include <gz/msgs/image.pb.h>
#include <gz/common/Image.hh>

#include <gz/common/Console.hh>
#include <gz/common/Filesystem.hh>
#include <gz/sensors/Manager.hh>
#include <gz/sensors/CameraSensor.hh>
#include <gz/rendering/Utils.hh>

// TODO(louise) Remove these pragmas once gz-rendering is disabling the
// warnings
Expand Down
Loading