PointCloud2 messages on a different frame_id than "map"

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!

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 (mapego).

Hope that helps.

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,

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 mapego 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).

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

where _offset comes from vehicle.get_bbox().

On ROS side you can verify with:

ros2 run tf2_ros tf2_echo map ego