17
17
#include < glog/logging.h>
18
18
#include < gtest/gtest.h>
19
19
20
- TEST (objectToVertices,
21
- test_objectToVertices)
20
+ TEST (objectToVertices, test_objectToVertices)
22
21
{
23
22
// Test `boundingBoxToVertices()` and `cylinderToVertices()` simultaneously
24
23
// Test at Shape::BOUNDING_BOX
@@ -71,14 +70,16 @@ test_objectToVertices)
71
70
EXPECT_TRUE (vertices.empty ());
72
71
}
73
72
74
- TEST (transformPoints,
75
- test_transformPoints)
73
+ TEST (transformPoints, test_transformPoints)
76
74
{
77
75
std::vector<Eigen::Vector3d> input_points;
78
76
Eigen::Vector3d point (0.0 , 0.0 , 0.0 );
79
77
input_points.push_back (point);
80
78
Eigen::Translation<double , 3 > translation (1.0 , 1.0 , 1.0 );
81
- Eigen::Matrix3d rotation = (Eigen::AngleAxisd (M_PI/4 , Eigen::Vector3d::UnitX ()) * Eigen::AngleAxisd (M_PI/4 , Eigen::Vector3d::UnitY ()) * Eigen::AngleAxisd (M_PI/4 , Eigen::Vector3d::UnitZ ())).toRotationMatrix ();
79
+ Eigen::Matrix3d rotation = (Eigen::AngleAxisd (M_PI / 4 , Eigen::Vector3d::UnitX ()) *
80
+ Eigen::AngleAxisd (M_PI / 4 , Eigen::Vector3d::UnitY ()) *
81
+ Eigen::AngleAxisd (M_PI / 4 , Eigen::Vector3d::UnitZ ()))
82
+ .toRotationMatrix ();
82
83
Eigen::Affine3d affine_transform = rotation * translation;
83
84
std::vector<Eigen::Vector3d> output_points;
84
85
@@ -90,8 +91,7 @@ test_transformPoints)
90
91
EXPECT_NEAR (output_points.at (0 ).z (), 1.5 , 1e-6 );
91
92
}
92
93
93
- TEST (is_inside,
94
- test_is_inside)
94
+ TEST (is_inside, test_is_inside)
95
95
{
96
96
// Test default pattern
97
97
sensor_msgs::msg::RegionOfInterest outer;
@@ -129,17 +129,16 @@ test_is_inside)
129
129
EXPECT_FALSE (inside_flag);
130
130
}
131
131
132
- TEST (sanitizeROI,
133
- test_sanitizeROI)
132
+ TEST (sanitizeROI, test_sanitizeROI)
134
133
{
135
134
// Test default pattern
136
135
sensor_msgs::msg::RegionOfInterest roi;
137
136
roi.x_offset = 10 ;
138
137
roi.y_offset = 20 ;
139
138
roi.height = 200 ;
140
139
roi.width = 100 ;
141
- int height_ = 400 ; // image height
142
- int width_ = 300 ; // image width
140
+ int height_ = 400 ; // image height
141
+ int width_ = 300 ; // image width
143
142
144
143
image_projection_based_fusion::sanitizeROI (roi, width_, height_);
145
144
@@ -156,7 +155,7 @@ test_sanitizeROI)
156
155
157
156
EXPECT_EQ (roi.height , 0 );
158
157
EXPECT_EQ (roi.width , 0 );
159
-
158
+
160
159
// Test patten that roi does not fit within image
161
160
roi.x_offset = 10 ;
162
161
roi.y_offset = 20 ;
0 commit comments