# PointCloud2 messages on a different frame\_id than "map"

**URL:** https://forum.beamng.tech/t/pointcloud2-messages-on-a-different-frame-id-than-map/474
**Category:** Simulation & Modelling
**Tags:** ros, sensor
**Created:** [23 June 2026 08:43 UTC](https://forum.beamng.tech/t/pointcloud2-messages-on-a-different-frame-id-than-map/474 "2026-06-23T08:43:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vjexposito](https://forum.beamng.tech/user_avatar/forum.beamng.tech/vjexposito/32/166_2.png) [@vjexposito](https://forum.beamng.tech/u/vjexposito)
#### Post date: [23 June 2026 08:43 UTC](https://forum.beamng.tech/t/pointcloud2-messages-on-a-different-frame-id-than-map/474/1 "2026-06-23T08:43:13Z")

</div>

I work with ROS2 and BeamNG bridge and I have realised I can only retrieve the PointCloud2 messages from the lidar placed on the “map” frame\_id. To avoid unnecessary transformations, is there any way to retrieve the PointCloud2 messages in a specific frame\_id (e.g. “base\_link” or “ego”)?.

Thanks in advance and BR!

---

<div class="post-metadata">

### Author: ![asaeed](https://forum.beamng.tech/user_avatar/forum.beamng.tech/asaeed/32/21_2.png) [@asaeed](https://forum.beamng.tech/u/asaeed)
#### Post date: [24 June 2026 11:02 UTC](https://forum.beamng.tech/t/pointcloud2-messages-on-a-different-frame-id-than-map/474/2 "2026-06-24T11:02:56Z")

</div>

Hello,

We checked this in the bridge.

Lidar `PointCloud2` messages use `frame_id = "map"` because BeamNG returns the point cloud in **world coordinates**. The header matches the data.

Some sensors often use the vehicle frame (`ego`), However, Lidar points designed to be in map/world space.

There is **no option today** to publish the cloud directly in `ego` or `base_link`. Changing only the `frame_id` without transforming the points would be wrong.

You may do the transformation on your end if you need the cloud in `ego` or `base_link` on the ROS side using TF (`map` → `ego`).

Hope that helps.

---

<div class="post-metadata">

### Author: ![vjexposito](https://forum.beamng.tech/user_avatar/forum.beamng.tech/vjexposito/32/166_2.png) [@vjexposito](https://forum.beamng.tech/u/vjexposito)
#### Post date: [29 June 2026 09:53 UTC](https://forum.beamng.tech/t/pointcloud2-messages-on-a-different-frame-id-than-map/474/3 "2026-06-29T09:53:20Z")

</div>

Hello,

Thank you for the clarification. I will then transform the messages.  
For confirmation, where exactly is the “ego” frame\_id located at the vehicle?

BR,

---

<div class="post-metadata">

### Author: ![asaeed](https://forum.beamng.tech/user_avatar/forum.beamng.tech/asaeed/32/21_2.png) [@asaeed](https://forum.beamng.tech/u/asaeed)
#### Post date: [30 June 2026 10:00 UTC](https://forum.beamng.tech/t/pointcloud2-messages-on-a-different-frame-id-than-map/474/4 "2026-06-30T10:00:25Z")

</div>

Hello,  
`ego` is your vehicle name from the scenario (`"name": "ego"`). Its pose is published in `_broadcast_vehicle_pose` in `vehicle.py` — that’s the place to look when debugging the `map` → `ego` transform.

The origin is **not** BeamNG’s raw `state["pos"]`. The offset: between the position that BeamNG provided (the main node of the vehicle) and the position we visualize (the geometric center).

```python
pos_centered = self._offset + state["pos"]

```

where `_offset` comes from `vehicle.get_bbox()`.

On ROS side you can verify with:

```bash
ros2 run tf2_ros tf2_echo map ego

```
