# Send ESDF/TSDF information from voxl-mapper to ROS2

Source: https://forum.modalai.com/topic/3456/send-esdf-tsdf-information-from-voxl-mapper-to-ros2
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: mpa
Posted: 2024-05-20 18:05:48 UTC by Jeffrey Mao
Replies: 3 · Views: 3708

## Jeffrey Mao · 2024-05-20 18:05:48 UTC

Hi Modalai,

Currently, I have the voxl mapper running, but when I run voxl_mpa_to_ros2. I see that only voxl_mapper_aligned_ptcloud is brought over to ROS2 because the interface for voxl_mpa_to_ros2 only has a pointcloud interface. What sort of interface would be needed to be made for the voxl_mapper_costmap to ROS2 or is there a certain guide. Also would it be possible to expose either the TSDF/ESDF from voxl-mapper to the MPA and then bring it to ROS2?

voxl_mapper_aligned_ptcloud
voxl_mapper_costmap
voxl_mesh
voxl_mesh_endpoint

Thanks,

Jeff

## Reply by Moderator (ModalAI staff) · 2024-05-21 00:50:26 UTC

@Jeffrey-Mao  voxl-mapper leverages voxlblox. You could look at their ROS implementation and try to port it over https://github.com/ethz-asl/voxblox/tree/master/voxblox_ros/src

## Reply by Jeffrey Mao · 2024-05-21 19:36:19 UTC (in reply to Moderator)

@Moderator Right I think that is a bit too difficult. 

I just edited the voxl-mapper library to send the pointcloud and it works now to get the map in ROS2 with the mpa_ros2 interface. It is a bit weird that you guys have this esdf publish pipe as a pointcloud but it doesn't seem exposed naturally

https://gitlab.com/voxl-public/voxl-sdk/services/voxl-mapper/-/blob/master/server/voxl-mapper/voxl_mapper.cc?ref_type=heads

    void TsdfServer::publishEsdfPointcloud(){
        std::vector<point_xyz_i> esdf_ptcloud;

        voxblox::Layer<voxblox::EsdfVoxel> *layer_ptr = esdf_map_->getEsdfLayerPtr();
        createDistancePointcloudFromEsdfLayer(*layer_ptr, esdf_ptcloud);

        // intensity ptcloud for distance
        point_cloud_metadata_t esdf_meta;
        esdf_meta.magic_number = POINT_CLOUD_MAGIC_NUMBER;
        esdf_meta.timestamp_ns = rc_nanos_monotonic_time();
        esdf_meta.n_points = esdf_ptcloud.size();
        esdf_meta.format = POINT_CLOUD_FORMAT_FLOAT_XYZC;

        pipe_server_write_point_cloud(COSTMAP_CH, esdf_meta, esdf_ptcloud.data());
    }

## Reply by Roya Salehzadeh · 2025-07-22 14:35:31 UTC (in reply to Jeffrey Mao)

@Jeffrey-Mao Hello Jeffery, We are currently working on implementing SLAM for the Starling 2 platform. Our initial approach involved using the available ROS 2 topics provided by voxl_mpa_to_ros2, installing standard SLAM packages, and using RViz for visualization. However, we've encountered a major issue: most of the topics do not have a frame_id defined, and there is no existing transform (TF) tree that can be used with RViz.

So far, we've only been able to visualize the tof_pc (Time-of-Flight point cloud) data. To do this, we had to manually publish a static transform between the TOF frame (which is named world) and map. However, in this setup, the drone's location does not update dynamically. To address this, we're considering writing a transformation node to define the relationships between coordinate frames (e.g., map, odom, base_link, tof, etc.). However, developing this from scratch is proving to be time-consuming and error-prone.

I also noticed that you were able to generate a map using voxl-mapper and et the map in ROS2 with the mpa_ros2 interface. This could be a much more efficient path for us to pursue. Could you please explain in detail:

What exact steps you followed to export the map using voxl-mapper?

Is it possible to regenerate or update the map in real-time in RViz, or export it to another visualization tool?

Thanks
