Skip to content

Commit

Permalink
Merge pull request #140 from ignitionrobotics/merge_5_6_062421
Browse files Browse the repository at this point in the history
5 -> 6 (main)
  • Loading branch information
iche033 authored Jun 24, 2021
2 parents 0d2d7d6 + 028b6b7 commit b7097d1
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 6,456 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project(ignition-sensors6 VERSION 6.0.0)
#============================================================================
# Find ignition-cmake
#============================================================================
find_package(ignition-cmake2 REQUIRED)
find_package(ignition-cmake2 2.8.0 REQUIRED)

#============================================================================
# Configure the project
Expand Down
3 changes: 3 additions & 0 deletions include/ignition/sensors/Sensor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ namespace ignition
public: virtual bool Load(sdf::ElementPtr _sdf);

/// \brief Initialize values in the sensor
/// This will set the next update time to zero. This is particularly
/// useful if simulation time has jumped backward, for example during
/// a seek backward in a log file.
public: virtual bool Init();

/// \brief Force the sensor to generate data
Expand Down
5 changes: 4 additions & 1 deletion src/Lidar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,11 @@ void Lidar::ApplyNoise()
int index = j * this->RayCount() + i;
double range = this->laserBuffer[index*3];
range = this->dataPtr->noises[LIDAR_NOISE]->Apply(range);
range = ignition::math::clamp(range,
if (std::isfinite(range))
{
range = ignition::math::clamp(range,
this->RangeMin(), this->RangeMax());
}
this->laserBuffer[index*3] = range;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Sensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Sensor::Sensor() :
//////////////////////////////////////////////////
bool Sensor::Init()
{
this->dataPtr->nextUpdateTime = std::chrono::steady_clock::duration::zero();
return true;
}

Expand Down
6 changes: 5 additions & 1 deletion test/integration/gpu_lidar_sensor_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,11 @@ void GpuLidarSensorTest::TestThreeBoxes(const std::string &_renderEngine)
double expectedRangeAtMidPointBox2 = abs(box02Pose.Pos().Y()) - unitBoxSize/2;

// Sensor 1 should see box01 and box02
EXPECT_NEAR(sensor1->Range(0), expectedRangeAtMidPointBox2, LASER_TOL);
// ign-rendering uses lower resolution textures for lidars with low sample
// count after: https://github.com/ignitionrobotics/ign-rendering/pull/296
// Side effect is the loss of precision in the depth buffer data so we relax
// tolerance for this check in order for test to pass.
EXPECT_NEAR(sensor1->Range(0), expectedRangeAtMidPointBox2, LASER_TOL + 1e-5);
EXPECT_NEAR(sensor1->Range(mid), expectedRangeAtMidPointBox1, LASER_TOL);
#ifndef __APPLE__
// See https://github.com/ignitionrobotics/ign-sensors/issues/66
Expand Down
79 changes: 0 additions & 79 deletions tools/check_test_ran.py

This file was deleted.

146 changes: 0 additions & 146 deletions tools/code_check.sh

This file was deleted.

10 changes: 0 additions & 10 deletions tools/cppcheck_rules/header_guard.rule

This file was deleted.

9 changes: 0 additions & 9 deletions tools/cppcheck_rules/namespace_AZ.rule

This file was deleted.

Loading

0 comments on commit b7097d1

Please sign in to comment.