TheNoobInventor/lidarbot

RViz: No transform from [object] to [map]

Closed this issue · 13 comments

Hi, thanks for your project.
I followed the steps from: https://github.com/TheNoobInventor/lidarbot?tab=readme-ov-file#mapping, to launch Gazebo simulation. The Gazebo looks good but I got an error in RViz that no transform from [object] to [map].
Basically, I did not change anything but only the mapper_params_online_async.yaml file with following parameters:

map_file_name: /my_path/src/lidarbot_navigation/maps/sim_map
map_start_pose: [0.0, 0.0, 0.0]
#map_start_at_dock: true 

Do you have any idea why I have this error? Thanks in advance!
image

Hello Jasper, I am glad that you are getting some value with the project. I apologize for the late reply, for some reason I did not get notified about this issue.

I will be away from my robot for a few days so I won't be able to replicate the issue you are having. But from the looks of it, it seems like you are trying to create a map. If that is the case, the map_file_name and map_start_pose parameters need to be commented out as those are only used when you want to localize in slam_toolbox with a map (you have previously created). Try commenting out those lines and let me know what happens.

If I get back to my robot before you reply, I will update this comment with any new information I might have.

Hi Chinedu,
Thanks so much for your reply, very appreciate it.
I have tried to comment map_file_name and map_start_pose parameter out but I still got the same error. But the map on RViz is also not visible anymore if they are commented out.
image

Hello Jasper,

I think I might have recreated the issue you are having, please send me a screenshot of output of this command (after you have already run the gazebo command):

ros2 launch lidarbot_slam online_async_launch.py \
slam_params_file:=src/lidarbot_slam/config/mapper_params_online_async.yaml \
use_sim_time:=true

Thanks

Hi Chinedu, thanks for your help.
Here is the console output of ros2 launch lidarbot_slam command.
ros2_console_output.txt

Hi Jasper,

Thanks for the output file. I am still trying to figure out what exactly the issue is, but could run this command after running only the gazebo command then another time after running both the gazebo and lidarbot_slam commands:

ros2 run tf2_tools view_frames

It outputs two files in the directory you run it in. I am interested in the pdf file that shows the relationship between the different frames that make up the robot. I am not sure if you can send the pdf files here, screenshots should suffice. I am trying to see if lidar_link is connected in both cases or only after running the gazebo command alone.

The tf2_tools package should already be installed otherwise you can install it with this:

sudo apt install ros-humble-tf2-tools

Hello Chinedu. I got your point. Yes, have uploaded both pdf files.
frames_both.pdf
frames_only_gazebo.pdf

Alright, it seems like the transforms tree is fine, could you send me your mapper_params_online_async.yaml file? I want to compare it with mine

Ok, no problem. Thanks for your help.
mapper_params_online_async.zip

Hello Jasper,

I've gone through the config file and everything seems okay. I have encountered this error before but I can't remember how I resolved it. Sometimes I delete the build, install and log directories in my workspace then build everything again from scratch. Try doing that to see if it fixes things.

Otherwise please compress your workspace and send it to me, I want to build it on my computer to see if I can spot anything. You can delete the docs folder in the src directory to save some space.

I'll be away for a few days but I'll try to get back to you by the weekend at most.

Hello Chinedu,

Thanks so much for taking the time to solve this issue, very appreciate it.
I have tried to re-build this project but unfortunately, the issue is still there. So I uploaded my workspace (src) here, maybe you can try to build it in your target and see if you can reproduce this issue.
Basically, my src is nothing different from your project in GitHub but I added one extra source from another project for interacting gazebo with the keyboard. Personally, I don't think this is the reason because this issue happened before I added this source, just FYI.
Thanks again for your help.
src.tar.gz

Hello Jasper,

I am glad to help. So I used your source folder and everything works as it should, I've included some screenshots below. I am not sure what else could be the problem. It could be that a package is not installed but since you are using the lidarbot repo the dependent packages should have been installed at the beginning.

But did you ever get the SLAM command to work with rviz? And also do you remember doing anything else apart from adding the keyboard package, like uninstalling a package for instance?

One thing you could try doing though, is to upgrade your packages. I'm not sure if that will change anything but at least you can rule out having outdated packages as a possible issue. So:

sudo apt-get update then sudo apt-get upgrade -y

Screenshot from 2024-01-08 10-45-12
Screenshot from 2024-01-08 10-48-34

Hi Chinedu,
Thanks for your quick update.
I have tried again to update all packages and re-built the project, but unfortunately, the issue is still there.
But I checked your console output with mine. Basically, my gazebo looks good but slam_toolbox looks strange. I also pasted my console output here, maybe you can have a look.
Meanwhile, I also tried to google for this issue, and this error is quite similar with mine, just FYI.
https://answers.ros.org/question/389383/slam_toolbox-message-filter-dropping-message-for-reason-discarding-message-because-the-queue-is-full/
image

It is strange. I have one last question/suggestion. What operating system are you using? I originally was using PopOS (which is based on Ubuntu) but I occasionally ran into errors so I decided to install Ubuntu instead and didn't have those errors.

If you aren't using Ubuntu maybe you can try installing it on a virtual machine and build the repo to see if the error still persists.