Rviz2 and Igntion Gazebo: Message filter dropping message because queue is full
Greetings. I am new to ROS2 and I am having a difficulty in using the ROSIGNGAZEBO_DEMOS package to test different sensors models.
The ROSIGNGAZEBO_DEMOS package works fine when I directly run it from the workspace I built the package in. I do not get any error while running like this and the visualization of the LaserScan and Lidar points work fine in Rviz
But when I use the same code and build it in another package, Rviz fails to load the LaserScan topic and Lidar points gives me the following error:
[rviz2-3] [INFO] [1663661037.983189664] [rviz]: Message Filter dropping message: frame 'model_with_lidar/link/gpu_lidar' at time 13.600 for reason 'discarding message because the queue is full'
I am using the following launch file :
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
def generate_launch_description():
pkg_ros_ign_gazebo_demos = get_package_share_directory('ros_ign_gazebo_demos')
pkg_ros_ign_gazebo = get_package_share_directory('ros_ign_gazebo')
ign_gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_ign_gazebo, 'launch', 'ign_gazebo.launch.py')),
launch_arguments={
'ign_args': '-r gpu_lidar_sensor.sdf'
}.items(),
)
# RViz
rviz = Node(
package='rviz2',
executable='rviz2',
arguments=['-d', os.path.join(pkg_ros_ign_gazebo_demos, 'rviz', 'gpu_lidar.rviz')],
condition=IfCondition(LaunchConfiguration('rviz'))
)
# Bridge
bridge = Node(
package='ros_ign_bridge',
executable='parameter_bridge',
arguments=['lidar@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan',
'/lidar/points@sensor_msgs/msg/PointCloud2@ignition.msgs.PointCloudPacked'],
output='screen'
)
return LaunchDescription([
ign_gazebo,
DeclareLaunchArgument('rviz', default_value='true',
description='Open RViz.'),
bridge,
rviz,
])
Any assistance in this regard would be greatly helpful.
Asked by Kingslayer on 2022-09-20 03:14:10 UTC
Answers
I believe Rviz misses a tf (transform information) between the map frame and your model_with_lidar/link/gpu_lidar frame.
To correct this, you could publish a static tf, by launching in another terminal :
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 map model_with_lidar/link/gpu_lidar
More infos about tfs here.
Asked by Luczia on 2022-12-25 17:15:49 UTC
Comments
why would you impose a static transform on 2 frame that are not static?
Asked by guidout on 2023-06-24 19:07:01 UTC
Comments