SteveMacenski / slam_toolbox

Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS
GNU Lesser General Public License v2.1
1.67k stars 525 forks source link

Message Filter dropping message: frame 'scan' for reason 'Unknown' #491

Closed maksimmasalski closed 2 years ago

maksimmasalski commented 2 years ago

Required Info:

Steps to reproduce issue

I'm using https://github.com/SICKAG/sick_safetyscanners2 A ROS2 Driver which reads the raw data from the SICK Safety Scanners and publishes the data as a laser_scan msg. I run it by default on one terminal window using command

 ros2 launch sick_safetyscanners2 sick_safetyscanners2_launch.py

Then in another terminal window I run slam_toolbox using command

ros2 run slam_toolbox async_slam_toolbox_node  --ros-args --param use_sim_time:=true --params-file /home/maksim/slam_toolbox_config_maksim.yaml

Expected behavior

I want to use slam_toolbox and visualize data from the lidar like it can be done in cartographer. So we have lidar topic /scan, slam_toolbox subscribes on it. Then I expect to view visualization in rviz2.

Actual behavior

When I run slam_toolbox I receive message

[INFO] [1651063566.664724738] [slam_toolbox]: Message Filter dropping message: frame 'scan' at time 1651063566.627 for reason 'Unknown'

In rviz2 I can see topics /slam_toolbox/scan_visualization But it doesn't visualize lidar data in rviz.

How to debug this info message?

[INFO] [1651063566.664724738] [slam_toolbox]: Message Filter dropping message: frame 'scan' at time 1651063566.627 for reason 'Unknown'

I think it is a rootcause. In ros forum I found this solution to modify launch file https://answers.ros.org/question/357762/slam_toolbox-message-filter-dropping-message/ But it doesn't help me... I modified launch file of lidar scanner, like this was described in this ros forum.

from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():
    use_sim_time = LaunchConfiguration('use_sim_time')
    return LaunchDescription([
        Node(
            package="sick_safetyscanners2",
            executable="sick_safetyscanners2_node",
            name="sick_safetyscanners2_node",
            output="screen",
            emulate_tty=True,
            parameters=[
                {"frame_id": "scan",
                 "sensor_ip": "192.168.1.5",
                 "host_ip": "192.168.1.20",
                 "interface_ip": "0.0.0.0",
                 "host_udp_port": 0,
                 "channel": 0,
                 "channel_enabled": True,
                 "skip": 0,
                 "angle_start": 0.0,
                 "angle_end": 0.0,
                 "time_offset": 0.0,
                 "general_system_state": True,
                 "derived_settings": True,
                 "measurement_data": True,
                 "intrusion_data": True,
                 "application_io_data": True,
                 "use_persistent_config": False,
                 "min_intensities": 0.0}
            ]
        ),
        Node(
            name="tf2_ros_fp_laser",
            package="tf2_ros",
            executable="static_transform_publisher",
            output="screen",
            arguments=["0", "0", "0", "0.0", "0.0", "0.0", "base_link", "laser"]
        ),
        ## tf2 - base_footprint to map
        Node(
            name="tf2_ros_fp_map",
            package="tf2_ros",
            executable="static_transform_publisher",
            output="screen",
            arguments=["0", "0", "0", "0.0", "0.0", "0.0", "base_link", "map"]
        ),
        ## tf2 - base_footprint to odom
        Node(
        name="tf2_ros_fp_odom",
        package="tf2_ros",
        executable="static_transform_publisher",
        output="screen",
        arguments=["0", "0", "0", "0.0", "0.0", "0.0", "base_link", "odom"]
        )
    ])
SteveMacenski commented 2 years ago

You need real odometry, but in general please look at ros answers, unfortunately I don't have the bandwidth to help fix folks' individual configuration issues.