Skip to content

Commit df011c9

Browse files
Janosch MachowinskiJanosch Machowinski
authored andcommitted
chore: uncrustify
Signed-off-by: Janosch Machowinski <[email protected]>
1 parent 24ed996 commit df011c9

File tree

10 files changed

+542
-579
lines changed

10 files changed

+542
-579
lines changed

test_tf2/test/buffer_core_test.cpp

Lines changed: 416 additions & 501 deletions
Large diffs are not rendered by default.

test_tf2/test/permuter.hpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PermuteOptionBase
4646
public:
4747
virtual void reset() = 0;
4848
virtual bool step() = 0;
49-
virtual ~PermuteOptionBase() {};
49+
virtual ~PermuteOptionBase() {}
5050
};
5151

5252

@@ -57,14 +57,14 @@ template<class T>
5757
class PermuteOption : public PermuteOptionBase
5858
{
5959
public:
60-
PermuteOption(const std::vector<T>& options, T* output)
60+
PermuteOption(const std::vector<T> & options, T * output)
6161
{
6262
options_ = options;
6363
output_ = output;
6464
reset();
6565
}
6666

67-
virtual ~PermuteOption(){};
67+
virtual ~PermuteOption() {}
6868

6969
void reset()
7070
{
@@ -77,8 +77,9 @@ class PermuteOption : public PermuteOptionBase
7777
{
7878
std::lock_guard<std::mutex> lock(access_mutex_);
7979
current_element_++;
80-
if (current_element_ == options_.end())
80+
if (current_element_ == options_.end()) {
8181
return false;
82+
}
8283
*output_ = *current_element_;
8384
return true;
8485
}
@@ -87,7 +88,7 @@ class PermuteOption : public PermuteOptionBase
8788
/// Local storage of the possible values
8889
std::vector<T> options_;
8990
/// The output variable
90-
T* output_;
91+
T * output_;
9192
typedef typename std::vector<T>::iterator V_T_iterator;
9293
/// The last updated element
9394
V_T_iterator current_element_;
@@ -104,15 +105,15 @@ class Permuter
104105
{
105106
public:
106107
/** \brief Destructor to clean up allocated data */
107-
virtual ~Permuter(){ clearAll();};
108+
virtual ~Permuter() {clearAll();}
108109

109110

110111
/** \brief Add a set of values and an output to the iteration
111112
* @param values The set of possible values for this output
112113
* @param output The value to set at each iteration
113114
*/
114115
template<class T>
115-
void addOptionSet(const std::vector<T>& values, T* output)
116+
void addOptionSet(const std::vector<T> & values, T * output)
116117
{
117118
std::lock_guard<std::mutex> lock(access_mutex_);
118119
options_.emplace_back(std::make_unique<PermuteOption<T>>(values, output));
@@ -123,8 +124,7 @@ class Permuter
123124
/** \brief Reset the internal counters */
124125
void reset()
125126
{
126-
for (unsigned int level= 0; level < options_.size(); level++)
127-
{
127+
for (unsigned int level = 0; level < options_.size(); level++) {
128128
options_[level]->reset();
129129
}
130130
}
@@ -136,15 +136,11 @@ class Permuter
136136
{
137137
std::lock_guard<std::mutex> lock(access_mutex_);
138138
// base case just iterating
139-
for (size_t level = 0; level < options_.size(); level++)
140-
{
141-
if(options_[level]->step())
142-
{
139+
for (size_t level = 0; level < options_.size(); level++) {
140+
if (options_[level]->step()) {
143141
//printf("stepping level %d returning true \n", level);
144142
return true;
145-
}
146-
else
147-
{
143+
} else {
148144
//printf("reseting level %d\n", level);
149145
options_[level]->reset();
150146
}

test_tf2/test/test_buffer_client.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ static const double EPS = 1e-3;
5252
TEST(tf2_ros, buffer_client)
5353
{
5454
rclcpp::Node::SharedPtr node = std::make_shared<rclcpp::Node>("tf_action_node");
55-
std::unique_ptr<tf2_ros::BufferClient> client = std::make_unique<tf2_ros::BufferClient>(node, "tf_action");
55+
std::unique_ptr<tf2_ros::BufferClient> client = std::make_unique<tf2_ros::BufferClient>(
56+
node,
57+
"tf_action");
5658

5759
rclcpp::executors::SingleThreadedExecutor executor;
5860

@@ -74,19 +76,17 @@ TEST(tf2_ros, buffer_client)
7476
p1.point.y = 0.0;
7577
p1.point.z = 0.0;
7678

77-
try
78-
{
79+
try {
7980
geometry_msgs::msg::PointStamped p2 = client->transform(p1, "b");
80-
RCLCPP_INFO(node->get_logger(),
81-
"p1: (%.2f, %.2f, %.2f), p2: (%.2f, %.2f, %.2f)", p1.point.x,
82-
p1.point.y, p1.point.z, p2.point.x, p2.point.y, p2.point.z);
81+
RCLCPP_INFO(
82+
node->get_logger(),
83+
"p1: (%.2f, %.2f, %.2f), p2: (%.2f, %.2f, %.2f)", p1.point.x,
84+
p1.point.y, p1.point.z, p2.point.x, p2.point.y, p2.point.z);
8385

8486
EXPECT_NEAR(p2.point.x, -5.0, EPS);
8587
EXPECT_NEAR(p2.point.y, -6.0, EPS);
8688
EXPECT_NEAR(p2.point.z, -7.0, EPS);
87-
}
88-
catch(tf2::TransformException& ex)
89-
{
89+
} catch (tf2::TransformException & ex) {
9090
RCLCPP_ERROR(node->get_logger(), "Failed to transform: %s", ex.what());
9191
ASSERT_FALSE("Should not get here");
9292
}
@@ -98,7 +98,9 @@ TEST(tf2_ros, buffer_client)
9898
TEST(tf2_ros, buffer_client_different_types)
9999
{
100100
rclcpp::Node::SharedPtr node = std::make_shared<rclcpp::Node>("tf_action_node");
101-
std::unique_ptr<tf2_ros::BufferClient> client = std::make_unique<tf2_ros::BufferClient>(node, "tf_action");
101+
std::unique_ptr<tf2_ros::BufferClient> client = std::make_unique<tf2_ros::BufferClient>(
102+
node,
103+
"tf_action");
102104

103105
rclcpp::executors::SingleThreadedExecutor executor;
104106

@@ -115,8 +117,7 @@ TEST(tf2_ros, buffer_client_different_types)
115117

116118
tf2::Stamped<KDL::Vector> k1(KDL::Vector(0, 0, 0), tf2::TimePoint(), "a");
117119

118-
try
119-
{
120+
try {
120121
tf2::Stamped<btVector3> b1;
121122
client->transform(k1, b1, "b");
122123
RCLCPP_ERROR(node->get_logger(), "Bullet: (%.4f, %.4f, %.4f)", b1[0], b1[1], b1[2]);
@@ -126,9 +127,7 @@ TEST(tf2_ros, buffer_client_different_types)
126127
EXPECT_NEAR(b1[2], -7.0, EPS);
127128
EXPECT_EQ(b1.frame_id_, "b");
128129
EXPECT_EQ(k1.frame_id_, "a");
129-
}
130-
catch(tf2::TransformException& ex)
131-
{
130+
} catch (tf2::TransformException & ex) {
132131
RCLCPP_ERROR(node->get_logger(), "Failed to transform: %s", ex.what());
133132
ASSERT_FALSE("Should not get here");
134133
}
@@ -138,7 +137,7 @@ TEST(tf2_ros, buffer_client_different_types)
138137

139138
}
140139

141-
int main(int argc, char** argv)
140+
int main(int argc, char ** argv)
142141
{
143142
// This is needed because we need to wait a little bit for the other nodes
144143
std::this_thread::sleep_for(std::chrono::milliseconds(1000));

test_tf2/test/test_buffer_server.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include <rclcpp/rclcpp.hpp>
4141
#include <memory>
4242

43-
int main(int argc, char** argv)
43+
int main(int argc, char ** argv)
4444
{
4545
rclcpp::init(argc, argv);
4646

@@ -49,7 +49,10 @@ int main(int argc, char** argv)
4949
rclcpp::Clock::SharedPtr clock = std::make_shared<rclcpp::Clock>(RCL_SYSTEM_TIME);
5050
tf2_ros::Buffer buffer(clock);
5151
tf2_ros::TransformListener tfl(buffer, node, false);
52-
std::unique_ptr<tf2_ros::BufferServer> server = std::make_unique<tf2_ros::BufferServer>(buffer, node, "tf_action");
52+
std::unique_ptr<tf2_ros::BufferServer> server = std::make_unique<tf2_ros::BufferServer>(
53+
buffer,
54+
node,
55+
"tf_action");
5356

5457
rclcpp::spin(node);
5558
}

0 commit comments

Comments
 (0)