Skip to content

Commit 0bb6b9e

Browse files
committed
Fix roslint issues
1 parent 8039b70 commit 0bb6b9e

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

fuse_models/test/test_imu_2d.cpp

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@
4545

4646
#include <gtest/gtest.h>
4747

48+
#include <algorithm>
4849
#include <chrono>
4950
#include <mutex>
5051
#include <string>
5152
#include <thread>
5253
#include <utility>
54+
#include <vector>
5355

5456
/**
5557
* @brief Imu2D test fixture
@@ -131,7 +133,7 @@ TEST_F(Imu2DTestFixture, BaseFrameYawAngularVelocity)
131133

132134
setCmdVel(twist);
133135

134-
using namespace std::chrono_literals;
136+
using namespace std::chrono_literals; // NOLINT(build/namespaces)
135137
std::this_thread::sleep_for(3s);
136138

137139
// Confirm the last transaction has the expect number of variables and constraints generated by the imu sensor model
@@ -175,9 +177,10 @@ TEST_F(Imu2DTestFixture, BaseFrameYawAngularVelocity)
175177
const auto& w = last_odom.twist.twist.angular.z;
176178

177179
// That is, ensure there is one fuse_variables::VelocityAngular2DStamped variable
178-
EXPECT_EQ(1, std::count_if(added_variables.begin(), added_variables.end(), [](const auto& variable) -> bool {
179-
return dynamic_cast<const fuse_variables::VelocityAngular2DStamped*>(&variable);
180-
}));
180+
EXPECT_EQ(1, std::count_if(added_variables.begin(), added_variables.end(),
181+
[](const auto& variable) -> bool { // NOLINT(whitespace/braces)
182+
return dynamic_cast<const fuse_variables::VelocityAngular2DStamped*>(&variable);
183+
})); // NOLINT(whitespace/braces)
181184

182185
// And iterate over all added variables to process it
183186
for (const auto& variable : added_variables)
@@ -197,9 +200,11 @@ TEST_F(Imu2DTestFixture, BaseFrameYawAngularVelocity)
197200
// wheel odometry twist angular velocity along the z axis
198201

199202
// That is, ensure there is one fuse_constraints::AbsoluteVelocityAngular2DStampedConstraint constraint
200-
EXPECT_EQ(1, std::count_if(added_constraints.begin(), added_constraints.end(), [](const auto& constraint) -> bool {
201-
return dynamic_cast<const fuse_constraints::AbsoluteVelocityAngular2DStampedConstraint*>(&constraint);
202-
}));
203+
EXPECT_EQ(1, std::count_if(added_constraints.begin(), added_constraints.end(),
204+
[](const auto& constraint) -> bool { // NOLINT(whitespace/braces)
205+
return dynamic_cast<const fuse_constraints::AbsoluteVelocityAngular2DStampedConstraint*>(
206+
&constraint);
207+
})); // NOLINT(whitespace/braces)
203208

204209
// And iterate over all added constraints to process it
205210
for (const auto& constraint : added_constraints)
@@ -223,9 +228,10 @@ TEST_F(Imu2DTestFixture, BaseFrameYawAngularVelocity)
223228
// axis
224229

225230
// That is, ensure there are two fuse_variables::Orientation2DStamped variables
226-
EXPECT_EQ(2, std::count_if(added_variables.begin(), added_variables.end(), [](const auto& variable) -> bool {
227-
return dynamic_cast<const fuse_variables::Orientation2DStamped*>(&variable);
228-
}));
231+
EXPECT_EQ(2, std::count_if(added_variables.begin(), added_variables.end(),
232+
[](const auto& variable) -> bool { // NOLINT(whitespace/braces)
233+
return dynamic_cast<const fuse_variables::Orientation2DStamped*>(&variable);
234+
})); // NOLINT(whitespace/braces)
229235

230236
// Iterate over all added variables to process retrieve the fuse_variables::Orientation2DStamped variables
231237
std::vector<const fuse_variables::Orientation2DStamped*> orientations;
@@ -259,9 +265,11 @@ TEST_F(Imu2DTestFixture, BaseFrameYawAngularVelocity)
259265
// odometry twist angular velocity along the z axis
260266

261267
// That is, ensure there is one fuse_constraints::RelativePose2DStampedConstraint constraint
262-
EXPECT_EQ(1, std::count_if(added_constraints.begin(), added_constraints.end(), [](const auto& constraint) -> bool {
263-
return dynamic_cast<const fuse_constraints::RelativePose2DStampedConstraint*>(&constraint);
264-
}));
268+
EXPECT_EQ(1,
269+
std::count_if(added_constraints.begin(), added_constraints.end(),
270+
[](const auto& constraint) -> bool { // NOLINT(whitespace/braces)
271+
return dynamic_cast<const fuse_constraints::RelativePose2DStampedConstraint*>(&constraint);
272+
})); // NOLINT(whitespace/braces)
265273

266274
// And iterate over all added constraints to process it
267275
for (const auto& constraint : added_constraints)

0 commit comments

Comments
 (0)