Skip to content

Commit c0dc0e7

Browse files
authored
Merge pull request #114 from ignitionrobotics/chapulina/5/revert_89
Revert "Apply noise evenly to scans and point clouds (#89)" and prep for 5.0.0~pre2
1 parent 2ce3585 commit c0dc0e7

File tree

6 files changed

+12
-41
lines changed

6 files changed

+12
-41
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ find_package(ignition-cmake2 REQUIRED)
1313
#============================================================================
1414
# Configure the project
1515
#============================================================================
16-
ign_configure_project(VERSION_SUFFIX pre1)
16+
ign_configure_project(VERSION_SUFFIX pre2)
1717

1818
#============================================================================
1919
# Set project-specific options

Changelog.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
### Ignition Sensors 5.0.0 (20XX-XX-XX)
66

7-
1. Apply noise evenly to scans and point clouds
8-
* [Pull request #89](https://github.com/ignitionrobotics/ign-sensors/pull/89)
9-
107
1. Bump in edifice: ign-common4
118
* [Pull request #85](https://github.com/ignitionrobotics/ign-sensors/pull/85)
129

include/ignition/sensors/Lidar.hh

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ namespace ignition
6666
public: virtual bool Update(
6767
const std::chrono::steady_clock::duration &_now) override;
6868

69-
/// \brief Apply noise to the laser buffer, if noise has been
70-
/// configured. This should be called before PublishLidarScan if you
71-
/// want the scan data to contain noise.
72-
public: void ApplyNoise();
73-
7469
/// \brief Publish LaserScan message
7570
/// \param[in] _now The current time
7671
/// \return true if the update was successfull
7772
public: virtual bool IGN_DEPRECATED(4) PublishLidarScan(
7873
const ignition::common::Time &_now);
7974

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+
8080
/// \brief Publish LaserScan message
8181
/// \param[in] _now The current time
8282
/// \return true if the update was successfull
@@ -248,14 +248,6 @@ namespace ignition
248248
// Documentation inherited
249249
public: virtual bool IsActive() const;
250250

251-
/// \brief Get the vertical resolution.
252-
/// \return The vertical resolution.
253-
public: double VerticalResolution() const;
254-
255-
/// \brief Get the horizontal resolution.
256-
/// \return The horizontal resolution.
257-
public: double HorizontalResolution() const;
258-
259251
IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
260252
/// \brief Just a mutex for thread safety
261253
public: mutable std::mutex lidarMutex;

src/GpuLidarSensor.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ bool GpuLidarSensor::CreateLidar()
198198
this->dataPtr->gpuRays->SetVerticalRayCount(
199199
this->VerticalRayCount());
200200

201-
this->dataPtr->gpuRays->SetHorizontalResolution(this->HorizontalResolution());
202-
this->dataPtr->gpuRays->SetVerticalResolution(this->VerticalResolution());
203-
204201
this->Scene()->RootVisual()->AddChild(
205202
this->dataPtr->gpuRays);
206203

@@ -239,8 +236,8 @@ bool GpuLidarSensor::Update(const std::chrono::steady_clock::duration &_now)
239236
return false;
240237
}
241238

242-
int len = this->dataPtr->gpuRays->RangeCount() *
243-
this->dataPtr->gpuRays->VerticalRangeCount() * 3;
239+
int len = this->dataPtr->gpuRays->RayCount() *
240+
this->dataPtr->gpuRays->VerticalRayCount() * 3;
244241

245242
if (this->laserBuffer == nullptr)
246243
{

src/Lidar.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -373,18 +373,6 @@ unsigned int Lidar::VerticalRangeCount() const
373373
return 1u;
374374
}
375375

376-
//////////////////////////////////////////////////
377-
double Lidar::HorizontalResolution() const
378-
{
379-
return this->dataPtr->sdfLidar.HorizontalScanResolution();
380-
}
381-
382-
//////////////////////////////////////////////////
383-
double Lidar::VerticalResolution() const
384-
{
385-
return this->dataPtr->sdfLidar.VerticalScanResolution();
386-
}
387-
388376
//////////////////////////////////////////////////
389377
void Lidar::SetParent(const std::string &_parent)
390378
{

src/Lidar_TEST.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ TEST(Lidar_TEST, CreateLaser)
118118
const std::string topic = "/ignition/sensors/test/lidar";
119119
const double update_rate = 30;
120120
const double horz_samples = 640;
121-
const double horz_resolution = 2.0;
121+
const double horz_resolution = 1;
122122
const double horz_min_angle = -1.396263;
123123
const double horz_max_angle = 1.396263;
124-
const double vert_resolution = 0.5;
124+
const double vert_resolution = 1;
125125
const double vert_samples = 1;
126126
const double vert_min_angle = 0;
127127
const double vert_max_angle = 0;
@@ -144,18 +144,15 @@ TEST(Lidar_TEST, CreateLaser)
144144
ASSERT_NE(nullptr, sensor);
145145

146146
double angleRes = (sensor->AngleMax() - sensor->AngleMin()).Radian() /
147-
sensor->RangeCount();
147+
sensor->RayCount();
148148
EXPECT_EQ(sensor->AngleMin(), ignition::math::Angle(-1.396263));
149149
EXPECT_EQ(sensor->AngleMax(), ignition::math::Angle(1.396263));
150150
EXPECT_NEAR(sensor->RangeMin(), 0.08, 1e-6);
151151
EXPECT_NEAR(sensor->RangeMax(), 10.0, 1e-6);
152152
EXPECT_NEAR(sensor->AngleResolution(), angleRes, 1e-3);
153153
EXPECT_NEAR(sensor->RangeResolution(), 0.01, 1e-3);
154154
EXPECT_EQ(sensor->RayCount(), 640u);
155-
EXPECT_EQ(sensor->RangeCount(),
156-
static_cast<unsigned int>(horz_samples * horz_resolution));
157-
EXPECT_NEAR(horz_resolution, sensor->HorizontalResolution(), 1e-3);
158-
EXPECT_NEAR(vert_resolution, sensor->VerticalResolution(), 1e-3);
155+
EXPECT_EQ(sensor->RangeCount(), 640u);
159156

160157
EXPECT_EQ(sensor->VerticalRayCount(), 1u);
161158
EXPECT_EQ(sensor->VerticalRangeCount(), 1u);

0 commit comments

Comments
 (0)