Skip to content

Commit c6f7d19

Browse files
Janosch MachowinskiJanosch Machowinski
authored andcommitted
chore: uncrustify
Signed-off-by: Janosch Machowinski <j.machowinski@nospam.org>
1 parent 6ac28d6 commit c6f7d19

File tree

9 files changed

+541
-578
lines changed

9 files changed

+541
-578
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

@@ -76,19 +78,17 @@ TEST(tf2_ros, buffer_client)
7678
p1.point.y = 0.0;
7779
p1.point.z = 0.0;
7880

79-
try
80-
{
81+
try {
8182
geometry_msgs::msg::PointStamped p2 = client->transform(p1, "b");
82-
RCLCPP_INFO(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);
83+
RCLCPP_INFO(
84+
node->get_logger(),
85+
"p1: (%.2f, %.2f, %.2f), p2: (%.2f, %.2f, %.2f)", p1.point.x,
86+
p1.point.y, p1.point.z, p2.point.x, p2.point.y, p2.point.z);
8587

8688
EXPECT_NEAR(p2.point.x, -5.0, EPS);
8789
EXPECT_NEAR(p2.point.y, -6.0, EPS);
8890
EXPECT_NEAR(p2.point.z, -7.0, EPS);
89-
}
90-
catch(tf2::TransformException& ex)
91-
{
91+
} catch (tf2::TransformException & ex) {
9292
RCLCPP_ERROR(node->get_logger(), "Failed to transform: %s", ex.what());
9393
ASSERT_FALSE("Should not get here");
9494
}
@@ -100,7 +100,9 @@ TEST(tf2_ros, buffer_client)
100100
TEST(tf2_ros, buffer_client_different_types)
101101
{
102102
rclcpp::Node::SharedPtr node = std::make_shared<rclcpp::Node>("tf_action_node");
103-
std::unique_ptr<tf2_ros::BufferClient> client = std::make_unique<tf2_ros::BufferClient>(node, "tf_action");
103+
std::unique_ptr<tf2_ros::BufferClient> client = std::make_unique<tf2_ros::BufferClient>(
104+
node,
105+
"tf_action");
104106

105107
rclcpp::executors::SingleThreadedExecutor executor;
106108

@@ -117,8 +119,7 @@ TEST(tf2_ros, buffer_client_different_types)
117119

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

120-
try
121-
{
122+
try {
122123
tf2::Stamped<btVector3> b1;
123124
client->transform(k1, b1, "b");
124125
RCLCPP_ERROR(node->get_logger(), "Bullet: (%.4f, %.4f, %.4f)", b1[0], b1[1], b1[2]);
@@ -128,9 +129,7 @@ TEST(tf2_ros, buffer_client_different_types)
128129
EXPECT_NEAR(b1[2], -7.0, EPS);
129130
EXPECT_EQ(b1.frame_id_, "b");
130131
EXPECT_EQ(k1.frame_id_, "a");
131-
}
132-
catch(tf2::TransformException& ex)
133-
{
132+
} catch (tf2::TransformException & ex) {
134133
RCLCPP_ERROR(node->get_logger(), "Failed to transform: %s", ex.what());
135134
ASSERT_FALSE("Should not get here");
136135
}
@@ -140,7 +139,7 @@ TEST(tf2_ros, buffer_client_different_types)
140139

141140
}
142141

143-
int main(int argc, char** argv)
142+
int main(int argc, char ** argv)
144143
{
145144
// This is needed because we need to wait a little bit for the other nodes
146145
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)