turtlebot / turtlebot4-user-manual

Source for the TurtleBot4 User Manual
https://turtlebot.github.io/turtlebot4-user-manual/
5 stars 15 forks source link

rviz: Global Status warning : Fixed Frame: No tf data. Actual error: Frame [base_link] does not exist #12

Closed Arabinda-Ghosh-MPI closed 1 year ago

Arabinda-Ghosh-MPI commented 1 year ago

Hi everyone,

I am trying to generate a map of the environment using the instruction available as https://turtlebot.github.io/turtlebot4-user-manual/tutorials/generate_map.html

I followed the instructions. 1. Launched synchronous SLAM, 2. launched view robot/view_model. I can drive the robot using the keyboard, I launched the camera as well (using ros2 launch depthai_examples mobile_publisher.launch.py). However, I am always getting the Global Status warning : Fixed Frame: No tf data. Actual error: Frame [base_link] does not exist in Rviz and I cant see any model or robot in the map.

I know my issue is similar to https://answers.ros.org/question/195962/rviz-fixed-frame-world-does-not-exist/ and I need a static_transform_publisher. However, I am not entirely sure how to do that. Especially, I am using ROS2 Humble and all the solutions lead to the use of rosrun (which is a part of rosbash and I read that rosbash is not available in ROS2 ).

Can anyone please guide me (preferably a step by step solution) how to update the static_transform_publisher in my case? I am fairly new to this. Your help is much appreciated.

hilary-luo commented 1 year ago

@Arabinda-Ghosh Can you please enter the following information: OS: (e.g. Ubuntu 20.04) ROS Distro: (e.g. Galactic) Built from source or installed: Package version: (if from repository, give version from sudo dpkg -s ros-$ROS_VERSION-turtlebot4-PACKAGE_WITH_ISSUE, if from source, give commit hash)

You should not need to manually launch the camera or modify the static_transform_publisher. Can you please clarify:

  1. Are you using a physical turtlebot or simulation?
  2. Have you configured your your turtlebot to use a namespace?
  3. Which networking option are you using? (Simple discovery with FastDDS?)
  4. While the turtlebot is on, can you run ros2 topic list on your pc and share the output?

When you are writing up issues and indicating the steps that you have followed, please always include the exact commands that you ran, not just a description of the command. And if you have errors, please copy and include the whole output as a code exerpt. These specifics give us details in order to help you, especially as a beginner.

So that you know, often whenever you see rosrun commands in ROS 1, there is a similar command available in ROS 2 with the syntax ros2 run.

Arabinda-Ghosh-MPI commented 1 year ago

@hilary-luo Thank you so much for replying!! Sorry for not sharing the necessary info earlier as I am comparatively new to this. I appreciate your patience.

OS: Ubuntu 22.04 ROS Distro: Humble Built from source or installed: Source

Are you using a physical turtlebot or simulation?

I am trying to do both. The turtlebot doesn't appear in any of the scenarios. However, I am more concerned about the physical turtlebot.

Have you configured your your turtlebot to use a namespace? Yes (the name is Turtlebot1).

Which networking option are you using? (Simple discovery with FastDDS?) I am using Discovery Server (followed instruction from here)

I had a problem with simple discovery (I will post another issue regarding this)

While the turtlebot is on, can you run ros2 topic list on your pc and share the output? ros2 topic list_laptop

ros2 topic list in bot ros2 topic list_bot

This is the command I executed ros2 launch turtlebot4_viz view_model.launch.py namespace:=/Turtlebot1

The terminal (Is this a graphics issue? I was checking this link I am not entirely sure)

rviz2 command

The Rviz screen

rviz2 screen 2

Thanks for pointing out theros2 run command

hilary-luo commented 1 year ago

Okay, let's focus on the physical turtlebot first. I am going to be a bit more verbose in my response to share the thought process and context for you to learn from.

First off the bat, when you have set up the networking, the first thing we want to see is that the topics from each device are visible on every device. In this case the first test is to see: can your PC see all of the topics from the raspberry pi and the create3 base. In this case, you don't seem to be seeing any of the topics. This is what we should focus on first. This also makes a lot of sense that you are not seeing anything show up in RViz. RViz displays information from the topics, so if it doesn't receive any topics / messages then it has nothing to display.

You had mentioned that you can drive the robot using the keyboard and I want for you to clarify, did you ssh into the robot and run the keyboard teleoperation from there? or did you run it directly on your PC. Currently you are not getting any topics from the robot so I would be surprised if you can drive the robot directly from your PC.

Either way, I want to check and make sure that each of your devices is properly set up for Discovery Server and that they are all using the same DDS vendor (FastDDS vs CycloneDDS):

  1. If you ssh into the turtlebot, can you run cat /etc/turtlebot4/setup.bash and share the output? This is the file where the ROS settings are stored.

  2. If you go to the create3 webserver, can you share a screenshot like the following: image

  3. On your PC, can you tell me what modifications you have made to your ~/.bashrc for Turtlebot and what those files that are included contain.

Arabinda-Ghosh-MPI commented 1 year ago

Hello, you are absolutely right that I you ssh-ed into the robot and run the keyboard teleoperation from the robot. I could not do it from the PC. Now I understand that the topics were not matching. I checked my discovery server setting and found out that it was not enabled. My apologies!!

  1. If you ssh into the turtlebot, can you run cat /etc/turtlebot4/setup.bash and share the output? This is the file where the ROS settings are stored.

cat

  1. Create 3

create3

  1. bashrc in PC I have included
    source /etc/turtlebot4/setup.bash
    source /etc/turtlebot4_discovery/setup.bash

Now I can see the robot in Rviz Rviz_updated

However, now I ran into a new problem and I am not able to drive the robot, neither from the PC nor by shh ing to the robot.

I am so sorry if the questions seem very basic and immature. I appreciate your patience!!

hilary-luo commented 1 year ago

No need to apologize, we all start somewhere.

I am glad to see that you are able to visualize things in rviz now. Can you confirm that you are getting the same topic list on both your robot and your pc?

In regards to driving the robot, how are you trying to drive it? remember to include in your description here, the specific commands that you use to run/launch the elements that are causing you difficulties. That being said, my first guess would be to make sure that you included your namespacing. The robot is listening for commands on a namespaced topic. If you are publishing the commands on a different topic then it won't pay any attention to them. For example to launch the teleop twist keyboard package with a namespace I would do the following:

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap __ns:=/Turtlebot1
Arabinda-Ghosh-MPI commented 1 year ago

Hi @hilary-luo Yes the topic list is same in both PC and robot.

However, the camera in rviz is showing a warning

For slam I used ros2 launch turtlebot4_navigation slam.launch.py namespace:=/Turtlebot1 For Rviz I used ros2 launch turtlebot4_viz view_model.launch.py namespace:=/Turtlebot1 I did not launch the camera seperately. Do I need to launch the camera as well?? using ros2 launch turtlebot4_bringup oakd.launch.py namespace:=/Turtlebot1

camera_issue_1 camera_issue_2

Additionally, when I ssh to the robot and use ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap __ns:=/Turtlebot1

I can drive the robot (Thanks for the help). However, I can not drive the robot using the same command from PC.

Finally, after launching the RViz using the previous command I tried to save the map using (following instructions from here)

ros2 run nav2_map_server map_saver_cli -f "fisrt_map" --ros-args -p map_subscribe_transient_local:=true -r __ns:=/Turtlebot1

I get the following error

From terminal map_saving_error

From Rviz

map_saving_error_2

map_saving_error_3

hilary-luo commented 1 year ago

In regards to saving the map, there is currently a bug when working with namespaces so for now use:

ros2 run nav2_map_server map_saver_cli -f "map_name" --ros-args -p map_subscribe_transient_local:=true -r __ns:=/Turtlebot1

When you try to save from rviz you aren't actually trying to save the map as a map file, you are trying to save the rviz configuration. You aren't able to because you are trying to save it in /opt.

In regards to driving the robot, as long as the robot and PC are seeing all of the same topics there should not be a difference of where you run the teleop node. Can you echo the topic on the robot and make sure that you are receiving the messages no matter where you run the teleop node? (ros2 topic echo /Turtlebot1/cmd_vel)

Arabinda-Ghosh-MPI commented 1 year ago

Hi @hilary-luo ,

I tried executing the command you mentioned, got exactly the same error as mentioned in my previous comment. But this time, I was successful in saving the rviz config. But I am not sure how to use the config file for navigation. I am following instruction from this link.

For localization it need a .yaml file and I am not sure how to generate that using the config file. If you can, then please direct me towards an appropriate document. (All I want is to generate a map, next load the map, set a goal, and use some automatic navigation algorithm to start from somewhere and reach the goal in the map).

I am receiving the messages using ros2 topic echo /Turtlebot1/cmd_vel no matter where I run teleop node (Sometimes there is a delay, especially when I am running the teleop node in PC, but its publishing some values)

hilary-luo commented 1 year ago

The .rviz config file is only for use within rviz and is used to save the current configuration of the visualizations within rviz. It is not used for navigation.

I will apologize that I didn't read the problem you had with the map_saver properly before. That error that you are seeing seems to be related to not being able to find the map topic. Are you able to subscribe to the map topic (/Turtlebot1/map) where you are running the map_saver?

In regards to driving the robot, if you are able to see the messages from the robot on that topic when running the teleop node from your computer then I see no reason why it shouldn't be driving. If you are still seeing this issue, can you verify if there are any differences between the content of the messages when you send them from the robot vs when you send them from your pc? including the header.

This may be a long shot but can you try running everything without a capital in your namespace? in other words namespace:=/turtlebot1. It is generally the convention to use lower case letters. Although it shouldn't cause issues, it is worth trying.

hilary-luo commented 1 year ago

This issue is being closed due to inactivity. If you are still experiencing the issue, feel free to reopen this ticket when you are ready to continue the troubleshooting process.