Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
niosus committed May 13, 2020
1 parent 75c5729 commit 4a33382
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 26 deletions.
9 changes: 4 additions & 5 deletions src/ground_removal/depth_ground_remover.cpp
Expand Up @@ -24,24 +24,23 @@

#include <algorithm>

#include "utils/velodyne_utils.h"
#include "image_labelers/linear_image_labeler.h"
#include "image_labelers/diff_helpers/angle_diff.h"
#include "image_labelers/diff_helpers/simple_diff.h"
#include "image_labelers/linear_image_labeler.h"
#include "utils/timer.h"
#include "utils/velodyne_utils.h"

namespace depth_clustering {

using cv::Mat;
using cv::DataType;
using cv::Mat;
using std::to_string;
using time_utils::Timer;

const cv::Point ANCHOR_CENTER = cv::Point(-1, -1);
const int SAME_OUTPUT_TYPE = -1;

void DepthGroundRemover::OnNewObjectReceived(const Cloud& cloud,
const int sender_id) {
void DepthGroundRemover::OnNewObjectReceived(const Cloud& cloud, const int) {
// this can be done even faster if we switch to column-major implementation
// thus allowing us to load whole row in L1 cache
if (!cloud.projection_ptr()) {
Expand Down
2 changes: 1 addition & 1 deletion src/qt/widgets/base_viewer_widget.cpp
Expand Up @@ -24,7 +24,7 @@

BaseViewerWidget::BaseViewerWidget(QWidget *parent) : QWidget(parent) {}

bool BaseViewerWidget::eventFilter(QObject *object, QEvent *event) {
bool BaseViewerWidget::eventFilter(QObject *, QEvent *event) {
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_Right || keyEvent->key() == Qt::Key_Left) {
Expand Down
6 changes: 3 additions & 3 deletions src/visualization/cloud_saver.cpp
Expand Up @@ -25,7 +25,7 @@
namespace depth_clustering {

void VectorCloudSaver::OnNewObjectReceived(
const std::unordered_map<uint16_t, Cloud>& clouds, const int id) {
const std::unordered_map<uint16_t, Cloud>& clouds, const int) {
if (_folder_counter++ % _save_every > 0) {
// nope, skip this one
return;
Expand Down Expand Up @@ -53,7 +53,7 @@ std::string VectorCloudSaver::WithLeadingZerosStr(int num) {
}

void DepthMapSaver::OnNewObjectReceived(
const std::unordered_map<uint16_t, cv::Mat>& clusters, const int id) {
const std::unordered_map<uint16_t, cv::Mat>& clusters, const int) {
if (_folder_counter++ % _save_every > 0) {
// nope, skip this one
return;
Expand All @@ -79,7 +79,7 @@ std::string DepthMapSaver::WithLeadingZerosStr(int num) {
.append(counter_str);
}

void CloudSaver::OnNewObjectReceived(const Cloud& cloud, const int id) {
void CloudSaver::OnNewObjectReceived(const Cloud& cloud, const int) {
pcl::io::savePCDFileBinary(
_prefix + "_" + std::to_string(_counter++) + ".pcd", *(cloud.ToPcl()));
}
Expand Down
4 changes: 2 additions & 2 deletions src/visualization/visualizer.cpp
Expand Up @@ -148,7 +148,7 @@ void Visualizer::DrawCube(const Eigen::Vector3f& center,

Visualizer::~Visualizer() {}

void Visualizer::OnNewObjectReceived(const Cloud& cloud, const int id) {
void Visualizer::OnNewObjectReceived(const Cloud& cloud, const int) {
lock_guard<mutex> guard(_cloud_mutex);
_cloud = cloud;
}
Expand All @@ -161,7 +161,7 @@ unordered_map<uint16_t, Cloud> ObjectPtrStorer::object_clouds() const {
}

void ObjectPtrStorer::OnNewObjectReceived(
const unordered_map<uint16_t, Cloud>& clouds, const int id) {
const unordered_map<uint16_t, Cloud>& clouds, const int) {
lock_guard<mutex> guard(_cluster_mutex);
_obj_clouds = clouds;

Expand Down
4 changes: 2 additions & 2 deletions test/test_angle_diff.cpp
Expand Up @@ -51,7 +51,7 @@ TEST(AngleDiff, AlphasRows) {
SpanParams::Direction::HORIZONTAL);
TestAngleDiff angle_diff_helper(&depth_image, &params);
auto alphas_rows = angle_diff_helper.GetRowAlphas();
EXPECT_EQ(4, alphas_rows.size());
EXPECT_EQ(4ul, alphas_rows.size());
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_rows[0], 0.001);
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_rows[1], 0.001);
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_rows[2], 0.001);
Expand All @@ -68,7 +68,7 @@ TEST(AngleDiff, AlphasCols) {
SpanParams::Direction::HORIZONTAL);
TestAngleDiff angle_diff_helper(&depth_image, &params);
auto alphas_cols = angle_diff_helper.GetColAlphas();
EXPECT_EQ(4, alphas_cols.size());
EXPECT_EQ(4ul, alphas_cols.size());
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_cols[0], 0.001);
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_cols[1], 0.001);
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_cols[2], 0.001);
Expand Down
2 changes: 1 addition & 1 deletion test/test_cloud.cpp
Expand Up @@ -40,7 +40,7 @@ TEST(CloudTest, InitEmpty) {
EXPECT_NEAR(0.0, cloud.pose().x(), eps);
EXPECT_NEAR(0.0, cloud.pose().y(), eps);
EXPECT_NEAR(0.0, cloud.pose().theta(), eps);
EXPECT_EQ(0, cloud.size());
EXPECT_EQ(0ul, cloud.size());
}

TEST(CloudTest, InitPose) {
Expand Down
4 changes: 2 additions & 2 deletions test/test_line_dist_diff.cpp
Expand Up @@ -51,7 +51,7 @@ TEST(LineDistDiff, AlphasRows) {
SpanParams::Direction::HORIZONTAL);
TestLineDistDiff angle_diff_helper(&depth_image, &params);
auto alphas_rows = angle_diff_helper.GetRowAlphas();
EXPECT_EQ(4, alphas_rows.size());
EXPECT_EQ(4ul, alphas_rows.size());
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_rows[0], 0.001);
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_rows[1], 0.001);
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_rows[2], 0.001);
Expand All @@ -68,7 +68,7 @@ TEST(LineDistDiff, AlphasCols) {
SpanParams::Direction::HORIZONTAL);
TestLineDistDiff angle_diff_helper(&depth_image, &params);
auto alphas_cols = angle_diff_helper.GetColAlphas();
EXPECT_EQ(4, alphas_cols.size());
EXPECT_EQ(4ul, alphas_cols.size());
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_cols[0], 0.001);
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_cols[1], 0.001);
EXPECT_NEAR(Radians::FromDegrees(1).val(), alphas_cols[2], 0.001);
Expand Down
1 change: 0 additions & 1 deletion test/test_pose.cpp
Expand Up @@ -291,7 +291,6 @@ TEST(PoseTest, V2T2V) {
// More: http://en.cppreference.com/w/cpp/error/assert
#ifndef NDEBUG
TEST(PoseDeathTest, TestLikelihood) {
double eps = 0.000001;
Pose pose;
ASSERT_DEATH(pose.SetLikelihood(2), "");
ASSERT_DEATH(pose.SetLikelihood(-1), "");
Expand Down
18 changes: 9 additions & 9 deletions test/test_sender_client.cpp
Expand Up @@ -47,7 +47,7 @@ class TestClient : public AbstractClient<int> {
: AbstractClient<int>(), _object_received(false), _sender_id(-1) {}
virtual ~TestClient() {}

void OnNewObjectReceived(const int& object, const int sender_id) override {
void OnNewObjectReceived(const int&, const int sender_id) override {
_object_received = true;
_sender_id = sender_id;
}
Expand All @@ -62,7 +62,7 @@ class TestTemplateClient : public AbstractClient<T> {
TestTemplateClient() : AbstractClient<T>(), _object_received(false) {}
virtual ~TestTemplateClient() {}

void OnNewObjectReceived(const T& object, const int sender_id) override {
void OnNewObjectReceived(const T&, const int) override {
_object_received = true;
}

Expand Down Expand Up @@ -100,16 +100,16 @@ TEST(SenderClientTest, SendAndReceive) {
ASSERT_EQ(id + 3, client_simple_2.id());
ASSERT_EQ(id + 4, client_templated.id());

ASSERT_EQ(0, sender.client_count());
ASSERT_EQ(0ul, sender.client_count());
sender.AddClient(&client_simple_1);
ASSERT_EQ(1, sender.client_count());
ASSERT_EQ(1ul, sender.client_count());
sender.AddClient(&client_simple_2);
ASSERT_EQ(2, sender.client_count());
ASSERT_EQ(2ul, sender.client_count());
sender.AddClient(&client_templated);
ASSERT_EQ(3, sender.client_count());
ASSERT_EQ(3ul, sender.client_count());

sender.RemoveClient(client_simple_2.id());
ASSERT_EQ(2, sender.client_count());
ASSERT_EQ(2ul, sender.client_count());
int package = 42;
ASSERT_EQ(false, client_simple_1._object_received);
ASSERT_EQ(false, client_simple_2._object_received);
Expand All @@ -126,7 +126,7 @@ TEST(SenderClientTest, SendAndReceive) {

TEST(SenderClientTest, RemoveNonExistingId) {
TestSender sender;
ASSERT_EQ(0, sender.client_count());
ASSERT_EQ(0ul, sender.client_count());
sender.RemoveClient(42);
ASSERT_EQ(0, sender.client_count());
ASSERT_EQ(0ul, sender.client_count());
}

0 comments on commit 4a33382

Please sign in to comment.