Skip to content

Commit 3e4b414

Browse files
authored
4 ➡️ 5 (#98)
Signed-off-by: Louise Poubel <louise@openrobotics.org>
2 parents a8f6bd7 + eb92342 commit 3e4b414

File tree

18 files changed

+862
-91
lines changed

18 files changed

+862
-91
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Report a bug
4+
labels: bug
5+
---
6+
7+
<!-- If you're not sure whether your problem is a bug, please ask a question at
8+
http://answers.gazebosim.org instead.-->
9+
10+
## Environment
11+
* OS Version: <!-- e.g, Ubuntu 20.04 -->
12+
* Source or binary build?
13+
<!-- If binary, which version? -->
14+
<!-- If source, which branch and what is the latest commit? -->
15+
16+
## Description
17+
* Expected behavior: <!-- Tell us what you expected to happen -->
18+
* Actual behavior: <!-- What happened instead -->
19+
20+
## Steps to reproduce
21+
<!-- Provide steps so we can try to reproduce this issue -->
22+
23+
1.
24+
2.
25+
3.
26+
27+
## Output
28+
<!-- Provide screenshots, console logs, backtraces, and/or anything that could
29+
be useful to us resolving this issue -->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Request a new feature
4+
labels: enhancement
5+
---
6+
7+
<!-- If you're not sure on the specifics of the feature or would like a broader
8+
discussion, please ask consider posting a proposal to
9+
http://community.gazebosim.org/ instead.-->
10+
11+
## Desired behavior
12+
<!-- Describe the current problem and the feature you want implemented.-->
13+
14+
## Alternatives considered
15+
<!-- Describe alternate solutions or features you've considered.-->
16+
17+
## Implementation suggestion
18+
<!-- Provide a suggestion on how to implement this feature, which could help us
19+
expedite this implementation.-->
20+
21+
## Additional context
22+
<!-- Provide any other additional context (e.g., screenshots) about your feature
23+
request.-->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!-- Please remove the appropriate section.
2+
For example, if this is a new feature, remove the "Bug Report" section -->
3+
4+
# Bug Report
5+
6+
Fixes issue #<NUMBER>
7+
8+
## Summary
9+
<!-- Describe your fix, including an explanation of how to reproduce the bug
10+
before and after the PR.-->
11+
12+
## Checklist
13+
- [ ] Signed all commits for DCO
14+
- [ ] Added tests
15+
- [ ] Updated documentation (as needed)
16+
- [ ] Updated migration guide (as needed)
17+
- [ ] `codecheck` passed (See
18+
[contributing](https://ignitionrobotics.org/docs/all/contributing#contributing-code))
19+
- [ ] All tests passed (See
20+
[test coverage](https://ignitionrobotics.org/docs/all/contributing#test-coverage))
21+
- [ ] While waiting for a review on your PR, please help review
22+
[another open pull request](https://github.com/pulls?q=is%3Aopen+is%3Apr+user%3Aignitionrobotics+archived%3Afalse+)
23+
to support the maintainers
24+
25+
**Note to maintainers**: Remember to use **Squash-Merge**
26+
27+
---
28+
29+
# New feature
30+
31+
Closes #<NUMBER>
32+
33+
## Summary
34+
<!--Explain changes made, the expected behavior, and provide any other additional
35+
context (e.g., screenshots, gifs) if appropriate.-->
36+
37+
## Test it
38+
<!--Explain how reviewers can test this new feature manually.-->
39+
40+
## Checklist
41+
- [ ] Signed all commits for DCO
42+
- [ ] Added tests
43+
- [ ] Added example world and/or tutorial
44+
- [ ] Updated documentation (as needed)
45+
- [ ] Updated migration guide (as needed)
46+
- [ ] `codecheck` passed (See [contributing](https://ignitionrobotics.org/docs/all/contributing#contributing-code))
47+
- [ ] All tests passed (See [test coverage](https://ignitionrobotics.org/docs/all/contributing#test-coverage))
48+
- [ ] While waiting for a review on your PR, please help review
49+
[another open pull request](https://github.com/pulls?q=is%3Aopen+is%3Apr+user%3Aignitionrobotics+archived%3Afalse+)
50+
to support the maintainers
51+
52+
**Note to maintainers**: Remember to use **Squash-Merge**
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Port <FROM_BRANCH> to <TO_BRANCH>
2+
3+
Branch comparison: https://github.com/ignitionrobotics/ign-sensors/compare/<FROM_BRANCH>...<TO_BRANCH>
4+
5+
**Note to maintainers**: Remember to **Merge** with commit (not squash-merge
6+
or rebase)

.github/workflows/macos.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
uses: Homebrew/actions/setup-homebrew@master
1616
- run: brew config
1717

18-
# Needed for X11Requirement
19-
- run: brew cask install xquartz
2018
- name: Install base dependencies
2119
run: |
2220
brew tap osrf/simulation;

Changelog.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
### Ignition Sensors 4.X.X
44

5+
### Ignition Sensors 4.1.0 (2021-02-10)
6+
7+
1. Added issue and PR templates.
8+
* [Pull request 91](https://github.com/ignitionrobotics/ign-sensors/pull/91)
9+
10+
1. Added `set_rate` service to all sensors.
11+
* [Pull request 95](https://github.com/ignitionrobotics/ign-sensors/pull/95)
12+
13+
1. Added support for 8 bit thermal camera image format.
14+
* [Pull request 92](https://github.com/ignitionrobotics/ign-sensors/pull/92)
15+
16+
1. All features up to version 3.2.0.
17+
518
### Ignition Sensors 4.0.0 (2020-09-30)
619

720
1. Fix link in README.md
@@ -32,7 +45,25 @@
3245

3346
## Ignition Sensors 3
3447

35-
### Ignition Sensors 3.X.X (20XX-XX-XX)
48+
### Ignition Sensors 3.2.0 (2021-02-08)
49+
50+
1. Apply noise to lidar point cloud.
51+
* [Pull request 86](https://github.com/ignitionrobotics/ign-sensors/pull/86)
52+
53+
1. Add Windows Installation.
54+
* [Pull request 82](https://github.com/ignitionrobotics/ign-sensors/pull/82)
55+
56+
1. Added thermal camera tutorial.
57+
* [Pull request 61](https://github.com/ignitionrobotics/ign-sensors/pull/61)
58+
59+
1. Prevent segfaults on test failures, make tests verbose.
60+
* [Pull request 56](https://github.com/ignitionrobotics/ign-sensors/pull/56)
61+
62+
1. Resolve updated codecheck issues.
63+
* [Pull request 57](https://github.com/ignitionrobotics/ign-sensors/pull/57)
64+
65+
1. Improve fork experience.
66+
* [Pull request 54](https://github.com/ignitionrobotics/ign-sensors/pull/54)
3667

3768
### Ignition Sensors 3.1.0 (2020-09-03)
3869

README.md

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ designed to generate realistic data from simulation environments. Ignition Senso
3434

3535
[Usage](#usage)
3636

37-
[Documentation](#documentation)
38-
39-
[Testing](#testing)
40-
4137
[Folder Structure](#folder-structure)
4238

4339
[Code of Conduct](#code-of-conduct)
@@ -63,54 +59,6 @@ See the [installation tutorial](https://ignitionrobotics.org/api/sensors/4.0/ins
6359

6460
Please refer to the [examples directory](https://github.com/ignitionrobotics/ign-sensors/raw/master/examples/).
6561

66-
# Documentation
67-
68-
API and tutorials can be found at [https://ignitionrobotics.org/libs/sensors](https://ignitionrobotics.org/libs/sensors).
69-
70-
You can also generate the documentation from a clone of this repository by following these steps.
71-
72-
1. You will need Doxygen. On Ubuntu Doxygen can be installed using
73-
74-
```
75-
sudo apt-get install doxygen
76-
```
77-
78-
2. Clone the repository
79-
80-
```
81-
git clone https://github.com/ignitionrobotics/ign-sensors
82-
```
83-
84-
3. Configure and build the documentation.
85-
86-
```
87-
cd ign-sensors; mkdir build; cd build; cmake ../; make doc
88-
```
89-
90-
4. View the documentation by running the following command from the build directory.
91-
92-
```
93-
firefox doxygen/html/index.html
94-
```
95-
96-
# Testing
97-
98-
Follow these steps to run tests and static code analysis in your clone of this repository.
99-
100-
1. Follow the [source install instruction](#source-install).
101-
102-
2. Run tests.
103-
104-
```
105-
make test
106-
```
107-
108-
3. Static code checker.
109-
110-
```
111-
make codecheck
112-
```
113-
11462
# Folder Structure
11563

11664
Refer to the following table for information about important directories and files in this repository.

include/ignition/sensors/Lidar.hh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ namespace ignition
7272
public: virtual bool IGN_DEPRECATED(4) PublishLidarScan(
7373
const ignition::common::Time &_now);
7474

75+
/// \brief Apply noise to the laser buffer, if noise has been
76+
/// configured. This should be called before PublishLidarScan if you
77+
/// want the scan data to contain noise.
78+
public: void ApplyNoise();
79+
7580
/// \brief Publish LaserScan message
7681
/// \param[in] _now The current time
7782
/// \return true if the update was successfull

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
4343
sdformat${SDF_VER}::sdformat${SDF_VER}
4444
PRIVATE
4545
ignition-common${IGN_COMMON_VER}::profiler
46+
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
4647
)
4748
target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC DepthPoints_EXPORTS)
4849

src/GpuLidarSensor.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ using namespace ignition::sensors;
3939
class ignition::sensors::GpuLidarSensorPrivate
4040
{
4141
/// \brief Fill the point cloud packed message
42-
public: void FillPointCloudMsg();
42+
/// \param[in] _laserBuffer Lidar data buffer.
43+
public: void FillPointCloudMsg(const float *_laserBuffer);
4344

4445
/// \brief Rendering camera
4546
public: ignition::rendering::GpuRaysPtr gpuRays;
@@ -248,6 +249,9 @@ bool GpuLidarSensor::Update(const std::chrono::steady_clock::duration &_now)
248249
/// \todo(anyone) It would be nice to remove this copy.
249250
this->dataPtr->gpuRays->Copy(this->laserBuffer);
250251

252+
// Apply noise before publishing the data.
253+
this->ApplyNoise();
254+
251255
this->PublishLidarScan(_now);
252256

253257
if (this->dataPtr->pointPub.HasConnections())
@@ -257,7 +261,7 @@ bool GpuLidarSensor::Update(const std::chrono::steady_clock::duration &_now)
257261
msgs::Convert(_now);
258262
this->dataPtr->pointMsg.set_is_dense(true);
259263

260-
this->dataPtr->FillPointCloudMsg();
264+
this->dataPtr->FillPointCloudMsg(this->laserBuffer);
261265

262266
{
263267
this->AddSequence(this->dataPtr->pointMsg.mutable_header());
@@ -302,7 +306,7 @@ ignition::math::Angle GpuLidarSensor::VFOV() const
302306
}
303307

304308
//////////////////////////////////////////////////
305-
void GpuLidarSensorPrivate::FillPointCloudMsg()
309+
void GpuLidarSensorPrivate::FillPointCloudMsg(const float *_laserBuffer)
306310
{
307311
IGN_PROFILE("GpuLidarSensorPrivate::FillPointCloudMsg");
308312
uint32_t width = this->pointMsg.width();
@@ -335,8 +339,8 @@ void GpuLidarSensorPrivate::FillPointCloudMsg()
335339
{
336340
// Index of current point, and the depth value at that point
337341
auto index = j * width * channels + i * channels;
338-
float depth = this->gpuRays->Data()[index];
339-
float intensity = this->gpuRays->Data()[index + 1];
342+
float depth = _laserBuffer[index];
343+
float intensity = _laserBuffer[index + 1];
340344
uint16_t ring = j;
341345

342346
int fieldIndex = 0;

0 commit comments

Comments
 (0)