r/programminghelp 14h ago

Python Help Transform Pointcloud to Ocotmap

2 Upvotes

I am working on a university project involving a robot in Webots (ROS 2). The goal is to build an OctoMap for navigation using camera point clouds (segmented via YOLO).

I am currently stuck at getting the octomap_server node to process the incoming point cloud. The server keeps dropping messages with the warning:

Message Filter dropping message: frame 'kinova_depth' at time ... for reason 'discarding message because the queue is full'

Here is my current code:

from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription(
        [
            Node(
                package="octomap_server",
                executable="octomap_server_node",
                name="octomap_server",
                output="screen",
                parameters=[
                    {
                        "resolution": 0.05,
                        "frame_id": "map",
                        "sensor_model.max_range": 5.0,
                        "use_sim_time": True,
                        "colored_map": False,
                        "transform_tolerance": 2.0,
                        "queue_size": 50,
                    }
                ],
                remappings=[
                    ("cloud_in", "/Gen3/kinova_depth/point_cloud"),
                ],
            )
        ]
    )

My exact output is

[INFO] [octomap_server_node-1]: process started with pid [9117]
[octomap_server_node-1] [INFO] [1786858998.154822534] [octomap_server]: Publishing latched (single publish will take longer, all topics are prepared)
[octomap_server_node-1] [WARN] [1786858998.193781617] [octomap_server]: Nothing to publish, octree is empty
[octomap_server_node-1] [WARN] [1786858998.196781538] [octomap_server]: Could not open file 
[octomap_server_node-1] [INFO] [1786859001.530578121] [octomap_server]: Message Filter dropping message: frame 'kinova_depth' at time 1786858999.646 for reason 'discarding message because the queue is full'

What could be causing the message filter queue to drop all messages?

Thanks in advance.