Project-MANAS / slam_gmapping

Slam Gmapping for ROS2
140 stars 41 forks source link

Message Filter dropping message #6

Open samverghese13 opened 3 years ago

samverghese13 commented 3 years ago

[INFO] [launch]: All log files can be found below /home/ign/.ros/log/2021-05-12-23-14-46-522622-ign-59739 [INFO] [launch]: Default logging verbosity is set to INFO /home/ign/ROS2_workspace/gmapping_ws/install/slam_gmapping/share/slam_gmapping/launch/slam_gmapping.launch.py:10: UserWarning: The parameter 'node_executable' is deprecated, use 'executable' instead launch_ros.actions.Node( [INFO] [slam_gmapping-1]: process started with pid [59741] [slam_gmapping-1] [INFO] [1620841489.741434400] [slam_gmapping]: Message Filter dropping message: frame 'laser' at time 1620841488.319 for reason 'Unknown' [slam_gmapping-1] [INFO] [1620841489.877446678] [slam_gmapping]: Message Filter dropping message: frame 'laser' at time 1620841488.461 for reason 'Unknown' [slam_gmapping-1] [INFO] [1620841490.021399181] [slam_gmapping]: Message Filter dropping message: frame 'laser' at time 1620841488.605 for reason 'Unknown'

I tried to publish the transform for laser to base link using the below code Node( package = "tf2_ros", executable = "static_transform_publisher", arguments = ["0", "0", "0", "0", "0", "0", "base_link", "laser"])

But when I try to run ros2 launch slam_gmapping slam_gmapping.launch.py

I am getting a message drop error.

I would like to know how this could be eliminated. I am running this on ROS2(Foxy)

shiveshkhaitan commented 3 years ago

I am unable to reproduce the error mentioned. If you can share the whole package (with launch files for static_transform_publisher and other nodes you are running), maybe I can help debug the issue.

vineet131 commented 3 years ago

@samverghese13 it's because you need to publish the transform from map -> Odom and Odom -> base_link. I was getting the same error, but just used these static transforms as a trial and it worked.

Edit: I stand corrected. Only Odom -> base_link is needed.

BATAxjh commented 2 years ago

I also has the same error ,how do you solve

BATAxjh commented 2 years ago

image why odom can not link to base_link

vineet131 commented 2 years ago

@BATAxjh dude, I literally wrote exactly that. You need to publish a transform from Odom -> base_link. It's literally what is missing in the image that you posted

BATAxjh commented 2 years ago

I had sub "odom" topic ,Related ODOM and Base link relationships have been published internally image

BATAxjh commented 2 years ago

I has sub like below,maybe can running ok,thank you ! @vineet131 node_tf2= Node( package = "tf2_ros", executable = "static_transform_publisher", output='screen', arguments = ["0", "0", "0", "0", "0", "0", "odom", "base_link"])

vineet131 commented 2 years ago

I has sub like below,maybe can running ok,thank you ! @vineet131 node_tf2= Node( package = "tf2_ros", executable = "static_transform_publisher", output='screen', arguments = ["0", "0", "0", "0", "0", "0", "odom", "base_link"])

@BATAxjh If your Odom -> base_link is static (i.e. your "odom" frame doesn't change with respect to your "base_link" frame) then this is okay.

Otherwise, in your image, odom_frame_id should be "odom" and quat_tf.header.frame_id should be "base_link" and the code that you wrote in your image will work without needing the static transform.

Good luck.

BATAxjh commented 2 years ago

I had tf2::convert(odom_quat, quat_tf) in topsize , I don't know your mean, thank you

MagicalBrain commented 1 year ago

@samverghese13 You need set the another tf (odom->base_link), for example:

# set static tf odom->base_link
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 "odom" "base_link"

# set static tf base_link->laser
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 "base_link" "laser"

If you run the commands, then the rviz still can not receive the map, maybe you run the gmapping with the real robot. You can try to run slam_gmapping node as follows:

ros2 launch slam_gmapping slam_gmapping.launch.py use_sim_time:=false