hiep update

This commit is contained in:
2025-12-30 10:41:47 +07:00
parent 1fefb2a389
commit 831e4e00d7
244 changed files with 101 additions and 13226 deletions

View File

@@ -36,7 +36,7 @@
#include <robot/time.h>
#include <robot/duration.h>
#include "laser_geometry/laser_geometry.hpp"
#include "robot_laser_geometry/laser_geometry.hpp"
#include <robot_sensor_msgs/PointCloud2.h>
#include <robot_sensor_msgs/LaserScan.h>
@@ -105,9 +105,9 @@ T cloudData(robot_sensor_msgs::PointCloud2 cloud_out, uint32_t index)
return *reinterpret_cast<T *>(&cloud_out.data[index]);
}
TEST(laser_geometry, projectLaser2) {
TEST(robot_laser_geometry, projectLaser2) {
double tolerance = 1e-12;
laser_geometry::LaserProjection projector;
robot_laser_geometry::LaserProjection projector;
std::vector<float> ranges, intensities, min_angles, max_angles, angle_increments;
std::vector<robot::Duration> increment_times, scan_times;
@@ -160,31 +160,31 @@ TEST(laser_geometry, projectLaser2) {
robot_sensor_msgs::LaserScan scan = build_constant_scan(option);
robot_sensor_msgs::PointCloud2 cloud_out;
projector.projectLaser(scan, cloud_out, -1.0, laser_geometry::channel_option::Index);
projector.projectLaser(scan, cloud_out, -1.0, robot_laser_geometry::channel_option::Index);
EXPECT_EQ(cloud_out.fields.size(), 4u);
projector.projectLaser(scan, cloud_out, -1.0, laser_geometry::channel_option::Intensity);
projector.projectLaser(scan, cloud_out, -1.0, robot_laser_geometry::channel_option::Intensity);
EXPECT_EQ(cloud_out.fields.size(), 4u);
projector.projectLaser(scan, cloud_out, -1.0);
EXPECT_EQ(cloud_out.fields.size(), 5u);
projector.projectLaser(
scan, cloud_out, -1.0,
laser_geometry::channel_option::Intensity |
laser_geometry::channel_option::Index);
robot_laser_geometry::channel_option::Intensity |
robot_laser_geometry::channel_option::Index);
EXPECT_EQ(cloud_out.fields.size(), 5u);
projector.projectLaser(
scan, cloud_out, -1.0,
laser_geometry::channel_option::Intensity | laser_geometry::channel_option::Index |
laser_geometry::channel_option::Distance);
robot_laser_geometry::channel_option::Intensity | robot_laser_geometry::channel_option::Index |
robot_laser_geometry::channel_option::Distance);
EXPECT_EQ(cloud_out.fields.size(), 6u);
projector.projectLaser(
scan, cloud_out, -1.0,
laser_geometry::channel_option::Intensity |
laser_geometry::channel_option::Index |
laser_geometry::channel_option::Distance |
laser_geometry::channel_option::Timestamp);
robot_laser_geometry::channel_option::Intensity |
robot_laser_geometry::channel_option::Index |
robot_laser_geometry::channel_option::Distance |
robot_laser_geometry::channel_option::Timestamp);
EXPECT_EQ(cloud_out.fields.size(), 7u);
unsigned int valid_points = 0;
@@ -255,11 +255,11 @@ TEST(laser_geometry, projectLaser2) {
// TODO(Martin-Idel-SI): Reenable test if possible. Test fails due to lookupTransform failing
// Needs to publish a transform to "laser_frame" in order to work.
#if 0
TEST(laser_geometry, transformLaserScanToPointCloud2) {
TEST(robot_laser_geometry, transformLaserScanToPointCloud2) {
tf3::BufferCore tf3;
double tolerance = 1e-12;
laser_geometry::LaserProjection projector;
robot_laser_geometry::LaserProjection projector;
std::vector<double> ranges, intensities, min_angles, max_angles, angle_increments;
std::vector<robot::Duration> increment_times, scan_times;
@@ -326,36 +326,36 @@ TEST(laser_geometry, transformLaserScanToPointCloud2) {
robot_sensor_msgs::PointCloud2 cloud_out;
projector.transformLaserScanToPointCloud(
scan.header.frame_id, scan, cloud_out, tf3, -1.0,
laser_geometry::channel_option::None);
robot_laser_geometry::channel_option::None);
EXPECT_EQ(cloud_out.fields.size(), 3u);
projector.transformLaserScanToPointCloud(
scan.header.frame_id, scan, cloud_out, tf3, -1.0,
laser_geometry::channel_option::Index);
robot_laser_geometry::channel_option::Index);
EXPECT_EQ(cloud_out.fields.size(), 4u);
projector.transformLaserScanToPointCloud(
scan.header.frame_id, scan, cloud_out, tf3, -1.0,
laser_geometry::channel_option::Intensity);
robot_laser_geometry::channel_option::Intensity);
EXPECT_EQ(cloud_out.fields.size(), 4u);
projector.transformLaserScanToPointCloud(scan.header.frame_id, scan, cloud_out, tf3);
EXPECT_EQ(cloud_out.fields.size(), 5u);
projector.transformLaserScanToPointCloud(
scan.header.frame_id, scan, cloud_out, tf3, -1.0,
laser_geometry::channel_option::Intensity |
laser_geometry::channel_option::Index);
robot_laser_geometry::channel_option::Intensity |
robot_laser_geometry::channel_option::Index);
EXPECT_EQ(cloud_out.fields.size(), 5u);
projector.transformLaserScanToPointCloud(
scan.header.frame_id, scan, cloud_out, tf3, -1.0,
laser_geometry::channel_option::Intensity | laser_geometry::channel_option::Index |
laser_geometry::channel_option::Distance);
robot_laser_geometry::channel_option::Intensity | robot_laser_geometry::channel_option::Index |
robot_laser_geometry::channel_option::Distance);
EXPECT_EQ(cloud_out.fields.size(), 6u);
projector.transformLaserScanToPointCloud(
scan.header.frame_id, scan, cloud_out, tf3, -1.0,
laser_geometry::channel_option::Intensity | laser_geometry::channel_option::Index |
laser_geometry::channel_option::Distance |
laser_geometry::channel_option::Timestamp);
robot_laser_geometry::channel_option::Intensity | robot_laser_geometry::channel_option::Index |
robot_laser_geometry::channel_option::Distance |
robot_laser_geometry::channel_option::Timestamp);
EXPECT_EQ(cloud_out.fields.size(), 7u);
EXPECT_EQ(cloud_out.is_dense, false);