Skip to content

Commit 28089ab

Browse files
Minor cleanup - lint, typos (#352)
* Change remaining ignerr to gzerr * Add one missing header * Ensure parameter names match in function declaration and definition --------- Signed-off-by: Shameek Ganguly <[email protected]>
1 parent 32576a8 commit 28089ab

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

include/gz/sensors/DepthCameraSensor.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ namespace gz
105105
const std::string &/*_format*/);
106106

107107
/// \brief Point cloud data callback used to get the data from the sensor
108-
/// \param[in] _data pointer to the data from the sensor
108+
/// \param[in] _scan pointer to the data from the sensor
109109
/// \param[in] _width width of the point cloud image
110110
/// \param[in] _height height of the point cloud image
111111
/// \param[in] _channel bytes used for the point cloud data
112112
/// \param[in] _format string with the format
113-
public: void OnNewRgbPointCloud(const float *_data,
113+
public: void OnNewRgbPointCloud(const float *_scan,
114114
unsigned int _width, unsigned int _height,
115115
unsigned int /*_channels*/,
116116
const std::string &/*_format*/);

src/CameraSensor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ bool CameraSensor::Update(const std::chrono::steady_clock::duration &_now)
671671
}
672672
catch(...)
673673
{
674-
ignerr << "Exception thrown in an image callback.\n";
674+
gzerr << "Exception thrown in an image callback.\n";
675675
}
676676
}
677677

src/GpuLidarSensor.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ bool GpuLidarSensor::CreateLidar()
239239
}
240240

241241
/////////////////////////////////////////////////
242-
void GpuLidarSensor::OnNewLidarFrame(const float *_data,
242+
void GpuLidarSensor::OnNewLidarFrame(const float *_scan,
243243
unsigned int _width, unsigned int _height, unsigned int _channels,
244244
const std::string &_format)
245245
{
@@ -251,11 +251,11 @@ void GpuLidarSensor::OnNewLidarFrame(const float *_data,
251251
if (!this->laserBuffer)
252252
this->laserBuffer = new float[samples];
253253

254-
memcpy(this->laserBuffer, _data, lidarBufferSize);
254+
memcpy(this->laserBuffer, _scan, lidarBufferSize);
255255

256256
if (this->dataPtr->lidarEvent.ConnectionCount() > 0)
257257
{
258-
this->dataPtr->lidarEvent(_data, _width, _height, _channels, _format);
258+
this->dataPtr->lidarEvent(_scan, _width, _height, _channels, _format);
259259
}
260260
}
261261

src/NavSatSensor.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*
1616
*/
1717

18+
#include <unordered_map>
19+
1820
#ifdef _WIN32
1921
#pragma warning(push)
2022
#pragma warning(disable: 4005)

src/SegmentationCameraSensor.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,12 @@ rendering::SegmentationCameraPtr SegmentationCameraSensor::SegmentationCamera()
406406

407407
/////////////////////////////////////////////////
408408
void SegmentationCameraSensor::OnNewSegmentationFrame(const uint8_t * _data,
409-
unsigned int _width, unsigned int _height, unsigned int _channles,
409+
unsigned int _width, unsigned int _height, unsigned int _channels,
410410
const std::string &/*_format*/)
411411
{
412412
std::lock_guard<std::mutex> lock(this->dataPtr->mutex);
413413

414-
unsigned int bufferSize = _width * _height * _channles;
414+
unsigned int bufferSize = _width * _height * _channels;
415415

416416
if (!this->dataPtr->segmentationColoredBuffer)
417417
this->dataPtr->segmentationColoredBuffer = new uint8_t[bufferSize];

src/Sensor.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ void SensorPrivate::PublishMetrics(const std::chrono::duration<double> &_now)
345345
}
346346

347347
// Computes simulation update rate and real update rate.
348-
double simUpdateRate;
349-
double realUpdateRate;
348+
double simUpdateRate = 0;
349+
double realUpdateRate = 0;
350350
const auto clockNow = std::chrono::steady_clock::now();
351351
// If lastUpdateTime == 0 means it wasn't initialized yet.
352352
if (this->lastUpdateTime.count() > 0)

0 commit comments

Comments
 (0)