修复了雷达扫描范围的bug,修复了里程计数据的发布者冲突的问题。目前存在问题:odom坐标系在运动过程中还是会飘

This commit is contained in:
2026-06-13 17:03:06 +08:00
parent 4e576888f5
commit 51ea5bd52e
12 changed files with 1624 additions and 72 deletions

View File

@@ -1134,7 +1134,7 @@ namespace lslidar_driver
{
auto scan = sensor_msgs::msg::LaserScan::UniquePtr(new sensor_msgs::msg::LaserScan());
//int scan_num = ceil((angle_able_max - angle_able_min) / 360 * count_num) + 1;
int scan_num = fixed_array_length;//cyy_addcyy_add
int scan_num = ceil((angle_able_max - angle_able_min) / 360 * count_num) + 1;
std::vector<ScanPoint> points;
rclcpp::Time start_time;
@@ -1160,7 +1160,7 @@ namespace lslidar_driver
scan->angle_min = 2 * M_PI * angle_able_min / 360;
scan->angle_max = 2 * M_PI * angle_able_max / 360;
}
scan->angle_increment = 2 * M_PI / (double)(fixed_array_length - 1);
scan->angle_increment = 2 * M_PI / (double)(scan_num - 1);
scan->range_min = min_range;
scan->range_max = max_range;
@@ -1169,7 +1169,7 @@ namespace lslidar_driver
scan->intensities.reserve(scan_num);
scan->intensities.assign(scan_num, std::numeric_limits<float>::infinity());
scan->scan_time = 0.1;
scan->time_increment = 0.1 / (double)(fixed_array_length - 1);
scan->time_increment = 0.1 / (double)(scan_num - 1);
int start_num = floor(angle_able_min * count_num / 360);
int end_num = floor(angle_able_max * count_num / 360);

File diff suppressed because it is too large Load Diff