# 使用pointcloud_to_laserscan时Slam Toolbox建图左右翻转且机器人朝向…

> 原文链接：https://robotics.hellobike.com/pitfalls/2025-06-30-robotics-se-116936
> 频道：pitfalls | 更新日期：2025-06-30 | 标签：auto, stackexchange, nav2
> 核心摘要：使用pointcloud_to_laserscan转换点云后建图出现翻转问题，通过新增静态变换并调整转换节点参数解决。

# 使用pointcloud_to_laserscan时Slam Toolbox建图左右翻转且机器人朝向…

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[Map is being cut off in Slam Toolbox Using pointcloud_to_laserscan](https://robotics.stackexchange.com/questions/116936/map-is-being-cut-off-in-slam-toolbox-using-pointcloud-to-laserscan)（Robotics Stack Exchange #116936）

**状态**：有绕过办法

## 问题

使用Nav2和Slam_Toolbox建图，经pointcloud_to_laserscan将3D点云转2D激光扫描后，RViz中地图左右侧翻转，机器人朝向反向。

## 环境

硬件：Jetson Orin AGX、Ouster OS1-32激光雷达；软件：ROS2 Humble、Nav2、Slam_Toolbox、pointcloud_to_laserscan。

## 解决办法

1. 新增静态变换：执行`ros2 run tf2_ros static_transform_publisher 0 0 0 3.14159 0 0 os_lidar laser_scan_output`，创建相对os_lidar旋转180度的laser_scan_output坐标系。
2. 修改pointcloud_to_laserscan节点参数，设置`-p target_frame:=laser_scan_output`，其余参数保持不变后运行节点。

原问题作者：dannym25；采纳答案作者：Chuck。原内容依 CC BY-SA 4.0 授权，本页摘要同样依 CC BY-SA 4.0 授权。
:::

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #116936：Map is being cut off in Slam Toolbox Using pointcloud_to_laserscan](https://robotics.stackexchange.com/questions/116936/map-is-being-cut-off-in-slam-toolbox-using-pointcloud-to-laserscan)