30 #include <gtest/gtest.h> 33 #include "sensor_msgs/PointCloud.h" 40 #include "rostest/permuter.h" 42 #define PROJECTION_TEST_RANGE_MIN (0.23) 43 #define PROJECTION_TEST_RANGE_MAX (40.0) 49 double ang_min,
double ang_max,
double ang_increment,
52 if (((ang_max - ang_min) / ang_increment) < 0)
55 sensor_msgs::LaserScan scan;
57 scan.header.frame_id =
"laser_frame";
58 scan.angle_min = ang_min;
59 scan.angle_max = ang_max;
60 scan.angle_increment = ang_increment;
61 scan.scan_time = scan_time.
toSec();
65 for(; ang_min + i * ang_increment < ang_max; i++)
67 scan.ranges.push_back(range);
68 scan.intensities.push_back(intensity);
71 scan.time_increment = scan_time.
toSec()/(double)i;
80 const boost::numeric::ublas::matrix<double>&
getUnitVectors(
double angle_min,
82 double angle_increment,
85 return getUnitVectors_(angle_min, angle_max, angle_increment, length);
89 void test_getUnitVectors(
double angle_min,
double angle_max,
double angle_increment,
unsigned int length)
91 double tolerance = 1e-12;
94 const boost::numeric::ublas::matrix<double> & mat = projector.
getUnitVectors(angle_min, angle_max, angle_increment, length);
98 for (
unsigned int i = 0; i < mat.size2(); i++)
101 angle_min + i * angle_increment),
104 EXPECT_NEAR(1.0, mat(1,i)*mat(1,i) + mat(0,i)*mat(0,i), tolerance);
112 double min_angle = -M_PI/2;
113 double max_angle = M_PI/2;
114 double angle_increment = M_PI/180;
116 std::vector<double> min_angles, max_angles, angle_increments;
118 rostest::Permuter permuter;
119 min_angles.push_back(-M_PI);
120 min_angles.push_back(-M_PI/1.5);
121 min_angles.push_back(-M_PI/2);
122 min_angles.push_back(-M_PI/4);
123 min_angles.push_back(-M_PI/8);
124 min_angles.push_back(M_PI);
125 min_angles.push_back(M_PI/1.5);
126 min_angles.push_back(M_PI/2);
127 min_angles.push_back(M_PI/4);
128 min_angles.push_back(M_PI/8);
129 permuter.addOptionSet(min_angles, &min_angle);
131 max_angles.push_back(M_PI);
132 max_angles.push_back(M_PI/1.5);
133 max_angles.push_back(M_PI/2);
134 max_angles.push_back(M_PI/4);
135 max_angles.push_back(M_PI/8);
136 max_angles.push_back(-M_PI);
137 max_angles.push_back(-M_PI/1.5);
138 max_angles.push_back(-M_PI/2);
139 max_angles.push_back(-M_PI/4);
140 max_angles.push_back(-M_PI/8);
141 permuter.addOptionSet(max_angles, &max_angle);
143 angle_increments.push_back(M_PI/180);
144 angle_increments.push_back(M_PI/360);
145 angle_increments.push_back(M_PI/720);
146 angle_increments.push_back(-M_PI/180);
147 angle_increments.push_back(-M_PI/360);
148 angle_increments.push_back(-M_PI/720);
149 permuter.addOptionSet(angle_increments, &angle_increment);
152 while (permuter.step())
154 if ((max_angle - min_angle) / angle_increment > 0.0)
156 unsigned int length = round((max_angle - min_angle)/ angle_increment);
160 test_getUnitVectors(min_angle, max_angle, angle_increment, (max_angle - min_angle)/ angle_increment);
161 test_getUnitVectors(min_angle, max_angle, angle_increment, (max_angle - min_angle)/ angle_increment + 1);
165 if ((max_angle - min_angle) / angle_increment > 0.0)
177 double tolerance = 1e-12;
180 double min_angle = -M_PI/2;
181 double max_angle = M_PI/2;
182 double angle_increment = M_PI/180;
185 double intensity = 1.0;
191 std::vector<double> ranges, intensities, min_angles, max_angles, angle_increments;
192 std::vector<ros::Duration> increment_times, scan_times;
194 rostest::Permuter permuter;
196 ranges.push_back(-1.0);
197 ranges.push_back(1.0);
198 ranges.push_back(2.0);
199 ranges.push_back(3.0);
200 ranges.push_back(4.0);
201 ranges.push_back(5.0);
202 ranges.push_back(100.0);
203 permuter.addOptionSet(ranges, &range);
205 intensities.push_back(1.0);
206 intensities.push_back(2.0);
207 intensities.push_back(3.0);
208 intensities.push_back(4.0);
209 intensities.push_back(5.0);
210 permuter.addOptionSet(intensities, &intensity);
212 min_angles.push_back(-M_PI);
213 min_angles.push_back(-M_PI/1.5);
214 min_angles.push_back(-M_PI/2);
215 min_angles.push_back(-M_PI/4);
216 min_angles.push_back(-M_PI/8);
217 permuter.addOptionSet(min_angles, &min_angle);
219 max_angles.push_back(M_PI);
220 max_angles.push_back(M_PI/1.5);
221 max_angles.push_back(M_PI/2);
222 max_angles.push_back(M_PI/4);
223 max_angles.push_back(M_PI/8);
224 permuter.addOptionSet(max_angles, &max_angle);
227 angle_increments.push_back(M_PI/180);
228 angle_increments.push_back(M_PI/360);
229 angle_increments.push_back(M_PI/720);
230 permuter.addOptionSet(angle_increments, &angle_increment);
235 permuter.addOptionSet(scan_times, &scan_time);
237 while (permuter.step())
242 sensor_msgs::LaserScan scan =
build_constant_scan(range, intensity, min_angle, max_angle, angle_increment, scan_time);
244 sensor_msgs::PointCloud cloud_out;
246 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)1);
248 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)1);
251 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)2);
253 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)2);
256 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)3);
259 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)4);
261 unsigned int valid_points = 0;
262 for (
unsigned int i = 0; i < scan.ranges.size(); i++)
266 EXPECT_EQ(valid_points, cloud_out.points.size());
268 for (
unsigned int i = 0; i < cloud_out.points.size(); i++)
270 EXPECT_NEAR(cloud_out.points[i].x , (
float)((
double)(scan.ranges[i]) *
cos((
double)(scan.angle_min) + i * (
double)(scan.angle_increment))), tolerance);
271 EXPECT_NEAR(cloud_out.points[i].y , (
float)((
double)(scan.ranges[i]) *
sin((
double)(scan.angle_min) + i * (
double)(scan.angle_increment))), tolerance);
272 EXPECT_NEAR(cloud_out.points[i].z, 0, tolerance);
273 EXPECT_NEAR(cloud_out.channels[0].values[i], scan.intensities[i], tolerance);
274 EXPECT_NEAR(cloud_out.channels[1].values[i], i, tolerance);
275 EXPECT_NEAR(cloud_out.channels[2].values[i], scan.ranges[i], tolerance);
276 EXPECT_NEAR(cloud_out.channels[3].values[i], (
float)i * scan.time_increment, tolerance);
281 if ((max_angle - min_angle) / angle_increment > 0.0)
292 double tolerance = 1e-12;
295 double min_angle = -M_PI/2;
296 double max_angle = M_PI/2;
297 double angle_increment = M_PI/180;
300 double intensity = 1.0;
306 std::vector<double> ranges, intensities, min_angles, max_angles, angle_increments;
307 std::vector<ros::Duration> increment_times, scan_times;
309 rostest::Permuter permuter;
311 ranges.push_back(-1.0);
312 ranges.push_back(1.0);
313 ranges.push_back(2.0);
314 ranges.push_back(3.0);
315 ranges.push_back(4.0);
316 ranges.push_back(5.0);
317 ranges.push_back(100.0);
318 permuter.addOptionSet(ranges, &range);
320 intensities.push_back(1.0);
321 intensities.push_back(2.0);
322 intensities.push_back(3.0);
323 intensities.push_back(4.0);
324 intensities.push_back(5.0);
325 permuter.addOptionSet(intensities, &intensity);
327 min_angles.push_back(-M_PI);
328 min_angles.push_back(-M_PI/1.5);
329 min_angles.push_back(-M_PI/2);
330 min_angles.push_back(-M_PI/4);
331 min_angles.push_back(-M_PI/8);
332 permuter.addOptionSet(min_angles, &min_angle);
334 max_angles.push_back(M_PI);
335 max_angles.push_back(M_PI/1.5);
336 max_angles.push_back(M_PI/2);
337 max_angles.push_back(M_PI/4);
338 max_angles.push_back(M_PI/8);
339 permuter.addOptionSet(max_angles, &max_angle);
342 angle_increments.push_back(M_PI/180);
343 angle_increments.push_back(M_PI/360);
344 angle_increments.push_back(M_PI/720);
345 permuter.addOptionSet(angle_increments, &angle_increment);
350 permuter.addOptionSet(scan_times, &scan_time);
352 while (permuter.step())
357 sensor_msgs::LaserScan scan =
build_constant_scan(range, intensity, min_angle, max_angle, angle_increment, scan_time);
359 sensor_msgs::PointCloud2 cloud_out;
361 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)4);
363 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)4);
366 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)5);
368 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)5);
371 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)6);
374 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)7);
376 unsigned int valid_points = 0;
377 for (
unsigned int i = 0; i < scan.ranges.size(); i++)
381 EXPECT_EQ(valid_points, cloud_out.width);
383 uint32_t x_offset = 0;
384 uint32_t y_offset = 0;
385 uint32_t z_offset = 0;
386 uint32_t intensity_offset = 0;
387 uint32_t index_offset = 0;
388 uint32_t distance_offset = 0;
389 uint32_t stamps_offset = 0;
390 for (std::vector<sensor_msgs::PointField>::iterator
f = cloud_out.fields.begin();
f != cloud_out.fields.end();
f++)
392 if (
f->name ==
"x") x_offset =
f->offset;
393 if (
f->name ==
"y") y_offset =
f->offset;
394 if (
f->name ==
"z") z_offset =
f->offset;
395 if (
f->name ==
"intensity") intensity_offset =
f->offset;
396 if (
f->name ==
"index") index_offset =
f->offset;
397 if (
f->name ==
"distances") distance_offset =
f->offset;
398 if (
f->name ==
"stamps") stamps_offset =
f->offset;
401 for (
unsigned int i = 0; i < cloud_out.width; i++)
404 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + x_offset] , (
float)((
double)(scan.ranges[i]) *
cos((
double)(scan.angle_min) + i * (
double)(scan.angle_increment))), tolerance);
405 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + y_offset] , (
float)((
double)(scan.ranges[i]) *
sin((
double)(scan.angle_min) + i * (
double)(scan.angle_increment))), tolerance);
406 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + z_offset] , 0, tolerance);
407 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + intensity_offset] , scan.intensities[i], tolerance);
408 EXPECT_NEAR(*(uint32_t*)&cloud_out.data[i*cloud_out.point_step + index_offset], i, tolerance);
409 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + distance_offset], scan.ranges[i], tolerance);
410 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + stamps_offset], (
float)i * scan.time_increment, tolerance);
415 if ((max_angle - min_angle) / angle_increment > 0.0)
427 double tolerance = 1e-12;
430 double min_angle = -M_PI/2;
431 double max_angle = M_PI/2;
432 double angle_increment = M_PI/180;
435 double intensity = 1.0;
441 std::vector<double> ranges, intensities, min_angles, max_angles, angle_increments;
442 std::vector<ros::Duration> increment_times, scan_times;
444 rostest::Permuter permuter;
446 ranges.push_back(-1.0);
447 ranges.push_back(1.0);
448 ranges.push_back(2.0);
449 ranges.push_back(3.0);
450 ranges.push_back(4.0);
451 ranges.push_back(5.0);
452 ranges.push_back(100.0);
453 permuter.addOptionSet(ranges, &range);
455 intensities.push_back(1.0);
456 intensities.push_back(2.0);
457 intensities.push_back(3.0);
458 intensities.push_back(4.0);
459 intensities.push_back(5.0);
460 permuter.addOptionSet(intensities, &intensity);
462 min_angles.push_back(-M_PI);
463 min_angles.push_back(-M_PI/1.5);
464 min_angles.push_back(-M_PI/2);
465 min_angles.push_back(-M_PI/4);
466 min_angles.push_back(-M_PI/8);
469 max_angles.push_back(M_PI);
470 max_angles.push_back(M_PI/1.5);
471 max_angles.push_back(M_PI/2);
472 max_angles.push_back(M_PI/4);
473 max_angles.push_back(M_PI/8);
475 permuter.addOptionSet(min_angles, &min_angle);
476 permuter.addOptionSet(max_angles, &max_angle);
478 angle_increments.push_back(-M_PI/180);
479 angle_increments.push_back(M_PI/180);
480 angle_increments.push_back(M_PI/360);
481 angle_increments.push_back(M_PI/720);
482 permuter.addOptionSet(angle_increments, &angle_increment);
487 permuter.addOptionSet(scan_times, &scan_time);
489 while (permuter.step())
494 sensor_msgs::LaserScan scan =
build_constant_scan(range, intensity, min_angle, max_angle, angle_increment, scan_time);
495 scan.header.frame_id =
"laser_frame";
497 sensor_msgs::PointCloud cloud_out;
499 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)1);
501 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)1);
504 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)2);
506 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)2);
509 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)3);
512 EXPECT_EQ(cloud_out.channels.size(), (
unsigned int)4);
514 unsigned int valid_points = 0;
515 for (
unsigned int i = 0; i < scan.ranges.size(); i++)
518 EXPECT_EQ(valid_points, cloud_out.points.size());
520 for (
unsigned int i = 0; i < cloud_out.points.size(); i++)
522 EXPECT_NEAR(cloud_out.points[i].x , (
float)((
double)(scan.ranges[i]) *
cos((
double)(scan.angle_min) + i * (
double)(scan.angle_increment))), tolerance);
523 EXPECT_NEAR(cloud_out.points[i].y , (
float)((
double)(scan.ranges[i]) *
sin((
double)(scan.angle_min) + i * (
double)(scan.angle_increment))), tolerance);
524 EXPECT_NEAR(cloud_out.points[i].z, 0, tolerance);
525 EXPECT_NEAR(cloud_out.channels[0].values[i], scan.intensities[i], tolerance);
526 EXPECT_NEAR(cloud_out.channels[1].values[i], i, tolerance);
527 EXPECT_NEAR(cloud_out.channels[2].values[i], scan.ranges[i], tolerance);
528 EXPECT_NEAR(cloud_out.channels[3].values[i], (
float)i * scan.time_increment, tolerance);
533 if ((max_angle - min_angle) / angle_increment > 0.0)
545 double tolerance = 1e-12;
548 double min_angle = -M_PI/2;
549 double max_angle = M_PI/2;
550 double angle_increment = M_PI/180;
553 double intensity = 1.0;
558 std::vector<double> ranges, intensities, min_angles, max_angles, angle_increments;
559 std::vector<ros::Duration> increment_times, scan_times;
561 rostest::Permuter permuter;
563 ranges.push_back(-1.0);
564 ranges.push_back(1.0);
565 ranges.push_back(2.0);
566 ranges.push_back(3.0);
567 ranges.push_back(4.0);
568 ranges.push_back(5.0);
569 ranges.push_back(100.0);
570 permuter.addOptionSet(ranges, &range);
572 intensities.push_back(1.0);
573 intensities.push_back(2.0);
574 intensities.push_back(3.0);
575 intensities.push_back(4.0);
576 intensities.push_back(5.0);
577 permuter.addOptionSet(intensities, &intensity);
579 min_angles.push_back(-M_PI);
580 min_angles.push_back(-M_PI/1.5);
581 min_angles.push_back(-M_PI/2);
582 min_angles.push_back(-M_PI/4);
583 min_angles.push_back(-M_PI/8);
586 max_angles.push_back(M_PI);
587 max_angles.push_back(M_PI/1.5);
588 max_angles.push_back(M_PI/2);
589 max_angles.push_back(M_PI/4);
590 max_angles.push_back(M_PI/8);
592 permuter.addOptionSet(min_angles, &min_angle);
593 permuter.addOptionSet(max_angles, &max_angle);
595 angle_increments.push_back(-M_PI/180);
596 angle_increments.push_back(M_PI/180);
597 angle_increments.push_back(M_PI/360);
598 angle_increments.push_back(M_PI/720);
599 permuter.addOptionSet(angle_increments, &angle_increment);
604 permuter.addOptionSet(scan_times, &scan_time);
606 while (permuter.step())
611 sensor_msgs::LaserScan scan =
build_constant_scan(range, intensity, min_angle, max_angle, angle_increment, scan_time);
612 scan.header.frame_id =
"laser_frame";
614 sensor_msgs::PointCloud2 cloud_out;
616 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)3);
618 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)3);
620 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)4);
622 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)4);
624 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)4);
626 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)4);
629 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)5);
631 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)5);
633 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)5);
635 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)5);
638 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)6);
640 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)6);
643 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)7);
645 EXPECT_EQ(cloud_out.fields.size(), (
unsigned int)7);
647 EXPECT_EQ(cloud_out.is_dense,
false);
649 unsigned int valid_points = 0;
650 for (
unsigned int i = 0; i < scan.ranges.size(); i++)
653 EXPECT_EQ(valid_points, cloud_out.width);
655 uint32_t x_offset = 0;
656 uint32_t y_offset = 0;
657 uint32_t z_offset = 0;
658 uint32_t intensity_offset = 0;
659 uint32_t index_offset = 0;
660 uint32_t distance_offset = 0;
661 uint32_t stamps_offset = 0;
662 for (std::vector<sensor_msgs::PointField>::iterator
f = cloud_out.fields.begin();
f != cloud_out.fields.end();
f++)
664 if (
f->name ==
"x") x_offset =
f->offset;
665 if (
f->name ==
"y") y_offset =
f->offset;
666 if (
f->name ==
"z") z_offset =
f->offset;
667 if (
f->name ==
"intensity") intensity_offset =
f->offset;
668 if (
f->name ==
"index") index_offset =
f->offset;
669 if (
f->name ==
"distances") distance_offset =
f->offset;
670 if (
f->name ==
"stamps") stamps_offset =
f->offset;
673 for (
unsigned int i = 0; i < cloud_out.width; i++)
675 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + x_offset] , (
float)((
double)(scan.ranges[i]) *
cos((
double)(scan.angle_min) + i * (
double)(scan.angle_increment))), tolerance);
676 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + y_offset] , (
float)((
double)(scan.ranges[i]) *
sin((
double)(scan.angle_min) + i * (
double)(scan.angle_increment))), tolerance);
677 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + z_offset] , 0, tolerance);
678 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + intensity_offset] , scan.intensities[i], tolerance);
679 EXPECT_NEAR(*(uint32_t*)&cloud_out.data[i*cloud_out.point_step + index_offset], i, tolerance);
680 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + distance_offset], scan.ranges[i], tolerance);
681 EXPECT_NEAR(*(
float*)&cloud_out.data[i*cloud_out.point_step + stamps_offset], (
float)i * scan.time_increment, tolerance);
687 if ((max_angle - min_angle) / angle_increment > 0.0)
709 geometry_msgs::TransformStamped
t;
710 t.header.frame_id =
"fixed";
711 t.child_frame_id =
"laser";
715 t.transform.translation.x = 1;
716 t.transform.rotation.z = -
sin(M_PI/8);
717 t.transform.rotation.w =
cos(M_PI/8);
721 t.transform.translation.x = 2;
722 t.transform.rotation.z = 0;
723 t.transform.rotation.w = 1;
727 t.transform.translation.x = 3;
728 t.transform.rotation.z =
sin(M_PI/8);
729 t.transform.rotation.w =
cos(M_PI/8);
733 const auto tolerance = 1e-6;
735 const auto min_angle = -M_PI/4;
736 const auto max_angle = M_PI/4;
737 const auto angle_increment = M_PI/4;
739 const auto range = 1.0;
740 const auto intensity = 1.0;
745 sensor_msgs::LaserScan scan;
746 scan.header.frame_id =
"laser";
748 scan.scan_time = scan_time.toSec();
749 scan.time_increment = increment_time.toSec();
750 scan.angle_increment = angle_increment;
751 scan.angle_min = min_angle;
752 scan.angle_max = max_angle;
753 scan.range_min = 0.1;
754 scan.range_max = 2.0;
756 for (
size_t i = 0; i < 3; ++i)
758 scan.ranges.push_back(range);
759 scan.intensities.push_back(intensity);
762 sensor_msgs::PointCloud2 cloud_out;
765 EXPECT_EQ(cloud_out.header.stamp,
ros::Time(10));
766 EXPECT_EQ(cloud_out.header.frame_id,
"fixed");
768 ASSERT_EQ(cloud_out.width, 3);
769 ASSERT_EQ(cloud_out.fields.size(), 4);
777 x = *x_it; y = *y_it; z = *z_it; i = *i_it; ++x_it; ++y_it; ++z_it; ++i_it;
778 EXPECT_NEAR(x, 1, tolerance);
779 EXPECT_NEAR(y, -1, tolerance);
780 EXPECT_NEAR(z, 0, tolerance);
781 EXPECT_NEAR(i, 1, tolerance);
783 x = *x_it; y = *y_it; z = *z_it; i = *i_it; ++x_it; ++y_it; ++z_it; ++i_it;
784 EXPECT_NEAR(x, 3, tolerance);
785 EXPECT_NEAR(y, 0, tolerance);
786 EXPECT_NEAR(z, 0, tolerance);
787 EXPECT_NEAR(i, intensity, tolerance);
789 x = *x_it; y = *y_it; z = *z_it; i = *i_it; ++x_it; ++y_it; ++z_it; ++i_it;
790 EXPECT_NEAR(x, 3, tolerance);
791 EXPECT_NEAR(y, 1, tolerance);
792 EXPECT_NEAR(z, 0, tolerance);
793 EXPECT_NEAR(i, intensity, tolerance);
797 int main(
int argc,
char **argv){
799 testing::InitGoogleTest(&argc, argv);
800 return RUN_ALL_TESTS();
void projectLaser(const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud &cloud_out, double range_cutoff=-1.0, int channel_options=channel_option::Default)
Project a sensor_msgs::LaserScan into a sensor_msgs::PointCloud.
A Class to Project Laser Scan.
sensor_msgs::LaserScan build_constant_scan(double range, double intensity, double ang_min, double ang_max, double ang_increment, ros::Duration scan_time)
bool setTransform(const geometry_msgs::TransformStamped &transform, const std::string &authority, bool is_static=false)
TEST(laser_geometry, projectLaser2)
#define PROJECTION_TEST_RANGE_MIN
TFSIMD_FORCE_INLINE const tfScalar & y() const
geometry_msgs::TransformStamped t
#define PROJECTION_TEST_RANGE_MAX
const boost::numeric::ublas::matrix< double > & getUnitVectors(double angle_min, double angle_max, double angle_increment, unsigned int length)
TFSIMD_FORCE_INLINE const tfScalar & x() const
void test_getUnitVectors(double angle_min, double angle_max, double angle_increment, unsigned int length)
TFSIMD_FORCE_INLINE const tfScalar & z() const
Enable "intensities" channel.
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
Enable "distances" channel.
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
void transformLaserScanToPointCloud(const std::string &target_frame, const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud &cloud_out, tf::Transformer &tf, double range_cutoff, int channel_options=channel_option::Default)
Transform a sensor_msgs::LaserScan into a sensor_msgs::PointCloud in target frame.
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
def shortest_angular_distance(from_angle, to_angle)
int main(int argc, char **argv)